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

[PyFoam] Why no non-zero return codes?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2012, 05:55
Default Why no non-zero return codes?
  #1
Member
 
Florian
Join Date: Nov 2009
Posts: 59
Rep Power: 17
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, 07:49
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 11:05
Default
  #3
Member
 
Florian
Join Date: Nov 2009
Posts: 59
Rep Power: 17
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, 11:25
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined reference to a C++'s class member function linyanx OpenFOAM Programming & Development 5 May 12, 2017 13:44
error adding void fraction into the solver & Error when chemistry is on cmigueis OpenFOAM Programming & Development 23 August 14, 2016 15:53
Help! Delete the UDM codes in the UDF Messi Fluent UDF and Scheme Programming 2 January 28, 2014 10:01
Return Codes in CFX fayaazhussain CFX 1 June 16, 2011 19:56
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48


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