/* C Example */
#include <mpi.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
int main (int argc, char* argv[])
{
int rank, size;
int buffer_length = MPI_MAX_PROCESSOR_NAME;
char hostname[buffer_length];
MPI_Init (&argc, &argv); /* starts MPI */
MPI_Comm_rank (MPI_COMM_WORLD, &rank); /* get current process id */
MPI_Comm_size (MPI_COMM_WORLD, &size); /* get number of processes */
MPI_Get_processor_name(hostname, &buffer_length); /* get hostname */
printf( "Hello world from process %d running on %s of %d\n", rank, hostname, size );
MPI_Finalize();
return 0;
}
上面的程序在ubuntu 12.04上成功编译并运行,用于较小的编号。进程但是当我尝试使用1000个进程执行时它失败了。为什么会这样? 我期望调度程序将线程保持在队列中并且可以逐个调度(我在单个核心机器上运行此代码)
为什么以下错误即将发生。流程以及如何解决此问题?
root@ubuntu:/home# mpiexec -n 1000 ./hello
[proxy:0:0@ubuntu] HYDU_create_process (./utils/launch/launch.c:26): pipe error (Too many open files)
[proxy:0:0@ubuntu] launch_procs (./pm/pmiserv/pmip_cb.c:751): create process returned error
[proxy:0:0@ubuntu] HYD_pmcd_pmip_control_cmd_cb (./pm/pmiserv/pmip_cb.c:935): launch_procs returned error
[proxy:0:0@ubuntu] HYDT_dmxu_poll_wait_for_event (./tools/demux/demux_poll.c:77): callback returned error status
[proxy:0:0@ubuntu] main (./pm/pmiserv/pmip.c:226): demux engine error waiting for event
Killed
答案 0 :(得分:2)
您正在遇到系统上的打开文件限制。 Ubuntu中的默认值是1024.您可以尝试使用ulimit命令提高会话限制。
ulimit -n 2048