【发布时间】:2015-08-10 05:16:43
【问题描述】:
我有一个简单的问题(在我的脑海中),但我找不到答案。如何抑制来自 mpirun 的输出消息?
例如,我有一个基于 MPI 的程序,它接受输入文件名。如果文件名错误,程序会生成一个日志文件,例如:
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).
--------------------------------------------------------------------------
行为正确;程序终止执行(通过调用 MPI_Abort)并显示输入文件错误的消息。来自 MPI 的消息不是必需的,这些是我想禁止的。
我确实尝试在 mpirun 调用中添加 -q 和 --quiet 选项,但它们似乎对这个特定问题没有任何作用。如果实施很重要,我也在使用 OpenMPI。
编辑:我应该提到 MPI 消息转到标准错误,这不一定是标准输出。这很好,但我仍然不想看到它们带有来自程序的错误消息。
【问题讨论】:
-
MPICH 有一个选项可以使至少一些错误消息静音。 PETSc 团队发起了一些关于用户列表的讨论。 Jed Brown 和我创建了一些补丁来实现静默选项。我不确定这对你来说是否足够。如果您安装 MPICH 3.2,我会查找控制选项详细信息。
标签: mpi