[OMPI users] Any reason why I can't start an mpirun job from within an mpi process?

2020-07-11 Thread John Retterer via users
>From the rank #0 process, I wish to start another mpi job (to create some
data to be used by the parent job).
I'm trying to do this with the command

   istat= system( "/...path.../mpirun -np 2 /...path.../prog2 args
>file.log 2>&1" )

within the code executed by the rank #0 process, where ...path...  is the
path to the executables, prog2 is the daughter program, and args its
arguments.

On return, the status istat = 256, and, although the log file file.log has
been created, it is empty.

DOes anybody have an idea why this doesn't work?


Re: [OMPI users] Any reason why I can't start an mpirun job from within an mpi process?

2020-07-11 Thread Ralph Castain via users
You cannot cascade mpirun cmds like that - the child mpirun picks up envars 
that causes it to break. You'd have to either use comm_spawn to start the child 
job, or do a fork/exec where you can set the environment to be some pristine 
set of values.


> On Jul 11, 2020, at 1:12 PM, John Retterer via users 
>  wrote:
> 
> From the rank #0 process, I wish to start another mpi job (to create some 
> data to be used by the parent job).
> I'm trying to do this with the command
> 
>istat= system( "/...path.../mpirun -np 2 /...path.../prog2 args >file.log 
> 2>&1" )
> 
> within the code executed by the rank #0 process, where ...path...  is the 
> path to the executables, prog2 is the daughter program, and args its 
> arguments.
> 
> On return, the status istat = 256, and, although the log file file.log has 
> been created, it is empty.
> 
> DOes anybody have an idea why this doesn't work?




Re: [OMPI users] Any reason why I can't start an mpirun job from within an mpi process?

2020-07-11 Thread John Retterer via users
Thank you, Ralph. I was afraid that was the reason it didn’t work but I
wanted to be sure.

   John


On Sat, Jul 11, 2020 at 5:37 PM Ralph Castain via users <
users@lists.open-mpi.org> wrote:

> You cannot cascade mpirun cmds like that - the child mpirun picks up
> envars that causes it to break. You'd have to either use comm_spawn to
> start the child job, or do a fork/exec where you can set the environment to
> be some pristine set of values.
>
>
> > On Jul 11, 2020, at 1:12 PM, John Retterer via users <
> users@lists.open-mpi.org> wrote:
> >
> > From the rank #0 process, I wish to start another mpi job (to create
> some data to be used by the parent job).
> > I'm trying to do this with the command
> >
> >istat= system( "/...path.../mpirun -np 2 /...path.../prog2 args
> >file.log 2>&1" )
> >
> > within the code executed by the rank #0 process, where ...path...  is
> the path to the executables, prog2 is the daughter program, and args its
> arguments.
> >
> > On return, the status istat = 256, and, although the log file file.log
> has been created, it is empty.
> >
> > DOes anybody have an idea why this doesn't work?
>
>
>