Neither_8
Neither_8

Reputation: 111

Suppress Messages from MPI

I have a simple question (in my mind) and I cannot find an answer. How do I suppress output messages from mpirun?

For example, I have an MPI based program that takes input file names. If a file name is bad, the program generates a log file such as:

Beginning initialization...
*****************************

Reading topology file...
Error: Topology file mysample.top was not found.

--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD 
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun has exited due to process rank 0 with PID 21581 on
node newton-compute-2-25.local exiting improperly. There are two reasons this could occur:

1. this process did not call "init" before exiting, but others in
the job did. This can cause a job to hang indefinitely while it waits
for all processes to call "init". By rule, if one process calls "init",
then ALL processes must call "init" prior to termination.

2. this process called "init", but exited without calling "finalize".
By rule, all processes that call "init" MUST call "finalize" prior to
exiting or it will be considered an "abnormal termination"

This may have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------

The behavior is correct; the program terminates execution (by calling MPI_Abort) with a message that the input file is bad. The messages from MPI are not necessary, and these are what I would like to suppress.

I did try adding the -q and --quiet options to the mpirun call, but they appear to do nothing for this particular problem. I am also using OpenMPI, if the implementation matters.

Edit: I should mention the MPI messages go to stderr, which is not necessarily stdout. That is fine, but I still do not want to see them with error messages from the program.

Upvotes: 2

Views: 2408

Answers (1)

Christian Sarofeen
Christian Sarofeen

Reputation: 2250

As MPI must be capable of handling errors from all nodes it is run on, I'm pretty confident you can't split the MPI error stream and the processes error streams. You can remove all the stderr with 2>/dev/null or to an error log with 2> err.log, but again, I don't believe you can split the errors.

Upvotes: 3

Related Questions