From a78b9d0575626f060f89e3c786d3cc90c6f20c0f Mon Sep 17 00:00:00 2001 From: Ioannis Magkanaris Date: Fri, 14 Jul 2023 10:08:18 +0000 Subject: [PATCH] Replace sys.exit with h.quit to fix issue with MPI_Finalize ## 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 --- init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.py b/init.py index 6473e9d2..b696bfb3 100644 --- a/init.py +++ b/init.py @@ -6,6 +6,7 @@ """ import sys from neurodamus import commands +from neuron import h def main(): @@ -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())