Alex, can you try something like call system(sh -c 'env -i /.../mpirun -np 2 /.../app_name')
-i start with an empty environment that being said, you might need to set a few environment variables manually : env -i PATH=/bin ... and that being also said, this "trick" could be just a bad idea : you might be using a scheduler, and if you empty the environment, the scheduler will not be aware of the "inside" run. on top of that, invoking system might fail depending on the interconnect you use. Bottom line, i believe Ralph's reply is still valid, even if five years have passed : changing your workflow, or using MPI_Comm_spawn is a much better approach. Cheers, Gilles On 2014/12/12 11:22, Alex A. Schmidt wrote: > Dear OpenMPI users, > > Regarding to this previous post > <http://www.open-mpi.org/community/lists/users/2009/06/9560.php> from 2009, > I wonder if the reply > from Ralph Castain is still valid. My need is similar but quite simpler: > to make a system call from an openmpi fortran application to run a > third party openmpi application. I don't need to exchange mpi messages > with the application. I just need to read the resulting output file > generated > by it. I have tried to do the following system call from my fortran openmpi > code: > > call system("sh -c 'mpirun -n 2 app_name") > > but I get > > ********************************************************** > > Open MPI does not support recursive calls of mpirun > > ********************************************************** > > Is there a way to make this work? > > Best regards, > > Alex > > > > _______________________________________________ > users mailing list > us...@open-mpi.org > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users > Link to this post: > http://www.open-mpi.org/community/lists/users/2014/12/25966.php