ENH: add a Pstream::shutdown() method (#1660)
- previously used a Pstream::exit() invoked from the argList destructor to handle all MPI shutdown, but this has the unfortunate side-effect of using a fixed return value for the program exit. Instead use the Pstream::shutdown() method in the destructor and allow the normal program exit codes as usual. This means that the following code now works as expected. ``` argList args(...); if (...) { InfoErr<< "some error\n"; return 1; } ```
Showing
- applications/test/error/Test-error.C 18 additions, 7 deletionsapplications/test/error/Test-error.C
- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H 9 additions, 4 deletionssrc/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
- src/OpenFOAM/global/argList/parRun.H 6 additions, 10 deletionssrc/OpenFOAM/global/argList/parRun.H
- src/Pstream/dummy/UPstream.C 6 additions, 2 deletionssrc/Pstream/dummy/UPstream.C
- src/Pstream/mpi/UPstream.C 12 additions, 8 deletionssrc/Pstream/mpi/UPstream.C
Please register or sign in to comment