CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

pyFoam: Why no non-zero return codes?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 8, 2012, 04:55
Default pyFoam: Why no non-zero return codes?
  #1
Member
 
Florian
Join Date: Nov 2009
Posts: 59
Rep Power: 7
Horus is on a distinguished road
Hello,

I'm wondering why some (all?) pyFoam tools do not return a non-zero return code if the openfoam tool fails.

For example:

pyFoamRunner.py --autosense-parallel potentialFoam -noFunctionObjects

fails because there is some dictionary entry missing, the return code is 0.

mpirun -n 2 potentialFoam -noFunctionObjects

fails too, but with a return code of 1.

Same for pyFoamRunner.py.

Returning non-zero exit code to indicate an error makes it much easier for scripts to use pyFoam.

Any reason for this design decision or just not implemented yet?

Regards,

Florian
Horus is offline   Reply With Quote

Old   May 8, 2012, 06:49
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,905
Rep Power: 39
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Horus View Post
Hello,

I'm wondering why some (all?) pyFoam tools do not return a non-zero return code if the openfoam tool fails.

For example:

pyFoamRunner.py --autosense-parallel potentialFoam -noFunctionObjects

fails because there is some dictionary entry missing, the return code is 0.

mpirun -n 2 potentialFoam -noFunctionObjects

fails too, but with a return code of 1.

Same for pyFoamRunner.py.

Returning non-zero exit code to indicate an error makes it much easier for scripts to use pyFoam.

Any reason for this design decision or just not implemented yet?

Regards,

Florian
Reasons are:

- I didn't need it yet (I don't check return codes in shell-scripts. If that is necessary I use Python)
- there was no feature-request on the Mantis yet

So this is NO design decision
gschaider is offline   Reply With Quote

Old   May 8, 2012, 10:05
Default
  #3
Member
 
Florian
Join Date: Nov 2009
Posts: 59
Rep Power: 7
Horus is on a distinguished road
Ok, the bugtracker is offline at the moment, I will file a request later and will also have a look at the code and see if I can produce a patch.
Horus is offline   Reply With Quote

Old   May 8, 2012, 10:25
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,905
Rep Power: 39
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Horus View Post
Ok, the bugtracker is offline at the moment, I will file a request later and
OK. I admit it. I hacked them so that this request would not come through

Quote:
Originally Posted by Horus View Post
will also have a look at the code and see if I can produce a patch.
Oh. Great. Under these circumstances I will allow sourceforge to continue with its operations

gschaider is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return Codes in CFX fayaazhussain CFX 1 June 16, 2011 18:56
pyFoam batch set up for OF 1.7 eelcovv OpenFOAM Running, Solving & CFD 3 January 19, 2011 09:38
Error in CFX Solver Leuchte CFX 5 November 6, 2010 07:12
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
Comparison of CFD Codes Kerem Main CFD Forum 9 May 9, 2003 04:29


All times are GMT -4. The time now is 03:03.