Joseph,

I had to use the absolute path of the fork agent.

I may have misunderstood your request.
Now it seems you want to have each task stderr redirected to a unique file but 
not to (duplicated) to mpirun stderr. Is that right?
If so, instead of the --output-filename option, you can do it "manually" in the 
fork agent, and you can use the $OMPI_WORLD_RANK environment variable in order 
to build the output file name. Note this can only work if the MPI tasks can 
write to the shared filesystem visible by mpirun.

Cheers,

Gilles

On November 1, 2019, at 10:03 PM, Joseph Schuchart via users 
<users@lists.open-mpi.org> wrote:

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