An infinite loop in lrsOutputReadRay?

15 views
Skip to first unread message

Taneli Pusa

unread,
Sep 15, 2019, 1:16:37 PM9/15/19
to COBRA Toolbox
I was wondering why testAll was taking forever with testExtremePathways. When I finally stopped it, it seems to have been stuck here, in line 18 of function lrsOutputReadRay:

while 1
    if strcmp(fgetl(fid), 'begin')
        break;
    end
end

What is the purpose of the loop?

-Taneli

Ronan M.T. Fleming

unread,
Sep 15, 2019, 6:47:53 PM9/15/19
to COBRA Toolbox
Hi Taneli,
it may be that lrs changed its export format for extreme rays and
'begin' is no longer the first line. Check how the lrs output file
looks.
Regards,
Ronan
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "COBRA Toolbox" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/28257e74-a396-43e4-8357-e6fe14dffefd%40googlegroups.com.



--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Assistant Professor,
Division of Systems Biomedicine and Pharmacology,
Leiden Academic Centre for Drug Research,
Faculty of Science,
Leiden University.
https://www.universiteitleiden.nl/en/staffmembers/ronan-fleming
&
H2020 Project Coordinator
Systems Medicine of Mitochondrial Parkinson’s Disease
http://sysmedpd.eu
----------------------------------------------------------------------------
Peer-reviewed publications: https://goo.gl/FZPG23
Mobile: +353 873 413 072
Skype: ronan.fleming
----------------------------------------------------------------------------
(This message is confidential and may contain privileged information.
It is intended for the named recipient only. If you receive it in
error please notify me and permanently delete the original message and
any copies.)

Taneli Pusa

unread,
Sep 16, 2019, 2:55:44 AM9/16/19
to COBRA Toolbox
Hi Ronan,
so I figured out what happened: lrs fails on my machine in a way that the function calling it is not expecting. So it's not caught but the lrs output file that the loop is trying to read is empty. And hence 'begin' never comes and loop gets stuck.

In any case, I'm thinking that this is not the best way to read the file. At least there should be a check to see if the end of the file has been reached to avoid the loop getting stuck if the output file is not what is expected.

-Taneli

ps. I'm working on adding MOOMIN to the Toolbox.


On Monday, September 16, 2019 at 1:47:53 AM UTC+3, Ronan M.T. Fleming wrote:
Hi Taneli,
it may be that lrs changed its export format for extreme rays and
'begin' is no longer the first line. Check how the lrs output file
looks.
Regards,
Ronan

On Sun, 15 Sep 2019 at 18:16, Taneli Pusa <tanel...@gmail.com> wrote:
>
> I was wondering why testAll was taking forever with testExtremePathways. When I finally stopped it, it seems to have been stuck here, in line 18 of function lrsOutputReadRay:
>
> while 1
>     if strcmp(fgetl(fid), 'begin')
>         break;
>     end
> end
>
> What is the purpose of the loop?
>
> -Taneli
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "COBRA Toolbox" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cobra-...@googlegroups.com.

Ronan M.T. Fleming

unread,
Sep 16, 2019, 6:37:05 AM9/16/19
to COBRA Toolbox
Hi Taneli,
yes, please consider to provide an improvement and submit a pull request.
https://opencobra.github.io/cobratoolbox/stable/contributing.html
Regards,
Ronan
> To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/d19a3e1d-cd76-4d0c-baea-0018f61020ac%40googlegroups.com.



--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Assistant Professor,
Division of Systems Biomedicine and Pharmacology,
Leiden Academic Centre for Drug Research,
Faculty of Science,
Leiden University.
https://www.universiteitleiden.nl/en/staffmembers/ronan-fleming
&
H2020 Project Coordinator,
Systems Medicine of Mitochondrial Parkinson’s Disease,
http://sysmedpd.eu
&
Adjunct Lecturer,
School of Medicine,
National University of Ireland, Galway.
----------------------------------------------------------------------------
Peer-reviewed publications: https://goo.gl/FZPG23
Mobile: +353 873 413 072
Skype: ronan.fleming
----------------------------------------------------------------------------
Upcoming course from 25-29 November 2019, at Leiden University on
"Constraint-based modelling: introduction and advanced topics".
https://www.biosb.nl/archive-courses/constraint-based-modelling-introduction-and-advanced-topics-2019/
Reply all
Reply to author
Forward
0 new messages