Skip to content

Commit

Permalink
Replace sys.exit with h.quit to fix issue with MPI_Finalize
Browse files Browse the repository at this point in the history
## Context
With `sys.exit` the application was forced to exit and didn't call `MPI_Finalize` in the end which especially with `singularity` generated problems.
Now with `h.quit()` `MPI_Finalize` is called and it also returns the proper exit value to the shell.

## Scope
Neuron exit codes and MPI Finalize

## Testing
Should be tests by the CI.

## Review
* [x] PR description is complete
* [ ] Coding style (imports, function length, New functions, classes or files) are good
* [ ] Unit/Scientific test added 
* [x] Updated Readme, in-code, developer documentation
  • Loading branch information
iomaganaris committed Jul 14, 2023
1 parent 6ee46fa commit a78b9d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions init.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
import sys
from neurodamus import commands
from neuron import h


def main():
Expand All @@ -31,5 +32,5 @@ def main():


if __name__ == "__main__":
# We truly require this so that, when launched with special, the process finishes
sys.exit(main())
# Returns exit code and calls MPI.Finalize
h.quit(main())

0 comments on commit a78b9d0

Please sign in to comment.