feature request: separate stdouts

Pete Wyckoff pw at osc.edu
Wed Feb 21 11:10:23 EST 2007


vanw at tticluster.com wrote on Tue, 20 Feb 2007 21:06 -0500:
> Maybe it's already possible, but just hasn't occurred to me how, but I'd
> like to be able to have the stdout and stderr from each process sent to a
> separate file. Something like 'mpiexec -sep-stdout a.out >
> stdout.\$MPIEXEC_RANK'.

It might be nice, but it's not easy.  The shell decides where ">"
goes, so your example wouldn't quite work.  But you could imagine
something like

    mpiexec -sep-stdout=stdout a.out

where the program opens all the output files itself using the
pattern stdout.%d as you suggest.

If you get crazy interested, here's some suggestions:

Add another int stdout_fds[numtask] array.

In accept_new_conn(), open the file for the connecting host if the
stream is stdout.  You won't know which one it is, but I can help
with that if you get this far.

In aggregate_output(), write to the appropriate stdout_fds[i].

You might want to handle stderr, and error checking if the files
exist already, etc.  And closing the files appropriately as tasks
exit.

Sounds like some work.

As an alternative, you could check the #if0 code already in
aggregate_output() that prefixes each line with <IPaddr> of the host
that caused that output.  Some grep/sed could pick out the output of
just the rank you want.

		-- Pete


More information about the mpiexec mailing list