On Jul 12, 2010, at 2:17 AM, jody wrote:

> Hi
> 
> I have a master process which spawns a number of workers of which i'd
> like to  save the output in separate files.
> 
> Usually i use the '-output-filename' option in such a situation.
> However, if i do
>  mpirun -np 1 -output-filename work_out master arg1 arg2
> all the files work_out.1, work_out.2, ... are ok,
> but work_out.0 contains both outputs of the master process(process 0
> in COMM_WORLD) and
> of the first worker (process 0 in the communicator of the spawned processes).

Crud - that's a bug.

> 
> I also tried the '-tag-output' option, but this involves several
> additional steps,
> because i have to separate the combined outputs
>  mpirun -np 1 -tag-output  master arg1 arg2 > total.out
>  grep "\[1,0\]" total.out | sed 's/\[1,0\]<stdout>://' > master.out
>  grep "\[2,0\]" outA | sed 's/\[2,0\]<stdout>://' > worker_0.out
>  grep "\[2,1\]" outA | sed 's/\[2,1\]<stdout>://' > worker_1.out
>  ...
> Of course, this could be wrapped in a script,  but it is a bit cumbersome
> (and i am not sure if the job-ids are always "1" and "2") ...
> 
> Is there some simpler way to separate the output of the two streams?

Not really.

> 
> If not, would it be possible to extend the -output-filename option i
> such a way that it
> would also combine job-id and rank withe the output file:
>  work_out.1.0
> for the master's output, and
>  work_out.2.0
>  work_out.2.1
>  work_out.2.2
>  ...
> for the worker's output?

Yeah, I can do that - will put something together. Are you doing this in the 
1.4 series?

> 
> Thank You
>  Jody
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users


Reply via email to