pvbatch not exiting properly with MPI. Invoking MPI_ABORT or only exiting head process and hanging.
Script:
import os, sys, time
sys.dont_write_bytecode = True
import paraview
from paraview.simple import *
COMMENTED paraview.servermanager.Finalize()
sys.exit()
cmd line: mpiexec -np 8 pvbatch -u script.py
I am trying to get pvbatch to exit a script cleanly without throwing errors. This is needed where a part of the code is reached where the script does not need to carry on due to some criteria being met. This is expected behaviour and thus should not throw errors on exit. However whichever way I try to exit pvbatch either by using sys.exit() or os.kill() or os.system('kill...'), pvbatch always throws mpiexec errors because 1 or more processes did not exit cleanly. The screenshot below is taken when using a simple sys.exit() without using servermanager.Finalize(). pvbatch was run on 8 processes.
You can see here that 7 processes exited improperly leading me to believe that only the head process which is reading the script is the only one exiting properly.
This lead me to use the Finalize() function which I believed would properly terminate each MPI process however I now get a segmentation fault but just on 1 process.
Is there a way for me to exit pvbatch cleanly or is this a deeper issue?