Gilles,

Thanks for your suggestions! I just tried both of them, see below:

On 11/1/19 1:15 AM, Gilles Gouaillardet via users wrote:
Joseph,


you can achieve this via an agent (and it works with DDT too)


For example, the nostderr script below redirects each MPI task's stderr to /dev/null (so it is not forwarded to mpirun)


$ cat nostderr
#!/bin/sh

exec 2> /dev/null

exec "$@"


and then you can simply


$ mpirun --mca orte_fork_agent /.../nostderr ...


It does not seem to work for me. No matter how I specify the fork agent (relative/absolute paths), mpirun can't seem to find it:

$ mpirun --mca orte_fork_agent ./nostderr -n 1 -N 1 hostname
--------------------------------------------------------------------------
The specified fork agent was not found:

  Node:        nid06016
  Fork agent:  ./nostderr

The application cannot be launched.
--------------------------------------------------------------------------
$ ll nostderr
-rwx------ 1 hpcjschu s31540 41 Nov  1 13:56 nostderr




FWIW, and even simpler option (that might not work with DDT though) is to

$ mpirun bash -c './a.out 2> /dev/null'


That suppresses the output on stderr, but unfortunately also in the resulting output file. Where does Open MPI intercept stdout/stderr to tee it to the output file?

Cheers
Joseph


Cheers,


Gilles

On 11/1/2019 7:43 AM, Joseph Schuchart via users wrote:
On 10/30/19 2:06 AM, Jeff Squyres (jsquyres) via users wrote:

Oh, did the prior behavior *only* output to the file and not to stdout/stderr?  Huh.

I guess a workaround for that would be:

     mpirun  ... > /dev/null

Just to throw in my $0.02: I recently found that the output to stdout/stderr may not be desirable: in an application that writes a lot of log data to stderr on all ranks, stdout was significantly slower than the files I redirected stdio to (I ended up seeing the application complete in the file output while the terminal wasn't even halfway through). Redirecting stderr to /dev/null as Jeff suggests does not help much because the output first has to be sent to the head node.

Things got even worse when I tried to use the stdout redirection with DDT: it barfed at me for doing pipe redirection in the command specification! The DDT terminal is just really slow and made the whole exercise worthless.

Point to make: it would be nice to have an option to suppress the output on stdout and/or stderr when output redirection to file is requested. In my case, having stdout still visible on the terminal is desirable but having a way to suppress output of stderr to the terminal would be immensely helpful.

Joseph


--
Jeff Squyres
jsquy...@cisco.com <mailto:jsquy...@cisco.com>


Reply via email to