Hello Lisandro
Thanks a lot for your reply! Based on your suggestion and some more online searching, I found that following solves the problem of deadlock:
parent.py:
from mpi4py import MPI
... some code ...
for i in range(10):
.
.. some code ...
child_comm = MPI.COMM_SELF.Spawn(sys.executable, args=["runscript_airfoil.py"], maxprocs=9)
child_comm.Barrier()
child.py:
from mpi4py import MPI
... some code ...
comm = MPI.COMM_WORLDparent_comm = comm.Get_parent()
parent_comm.Barrier()
But, now I am facing another issue.
I know that my laptop has 10 cores (verified using lscpu command and I have a ran scripts with 10 processes using mpirun command). I found that when I keep the maxprocs as 4 or less, it works fine. But, when I keep maxprocs between 5 and 9, it starts giving "not enough slots" error in second iteration. In the first iteration of for loop, spawn method spawns 'maxprocs' number of processes. But in the second iteration, it gives 'not enough slots' error.
I am running the parent.py using 'python parent.py'. I tried to run it using 'mpirun -n 1 python parent.py' but I get the same error. I am not sure what
the problem here is.
OpenMPI: 4.0.7
mpi4py: 3.1.3