MPI_Comm_spawn 在 MSMPI 上失败
我正在尝试使用 MPI_Comm_spawn 启动第二个进程。仅用于演示目的。该程序非常简单:
int main(int argc, char* argv[])
{ int my_id, numprocs;
MPI_Comm All;
MPI_Init(&argc, &argv) ;
MPI_Comm_rank(MPI_COMM_WORLD, &my_id) ;
MPI_Comm_size(MPI_COMM_WORLD, &numprocs) ;
cout << "I'm process "<< my_id << " and we are " << numprocs <<endl;
MPI_Comm_spawn("child.exe",MPI_ARGV_NULL,2,MPI_INFO_NULL,my_id,MPI_COMM_WORLD, &All,MPI_ERRCODES_IGNORE);
MPI_Comm_size(All, &numprocs) ;
cout << "I'm process "<< my_id << " and we are " << numprocs <<endl;
{
int i;
cin >> i;
}
MPI_Finalize();
return 0;
}
child.exe 与编译后的程序位于同一目录中,并且也非常简单:
int main(int argc, char* argv[])
{
int my_id, numprocs,length;
MPI_Comm Parent;
MPI_Win pwin,gwin;
MPI_Init(&argc, &argv) ;
MPI_Comm_rank(MPI_COMM_WORLD, &my_id) ;
MPI_Comm_size(MPI_COMM_WORLD, &numprocs) ;
MPI_Comm_get_parent(&Parent);
cout << "I'm child process "<< my_id << " and we are " << numprocs <<endl;
MPI_Comm_size(Parent, &numprocs) ;
cout << "My parent communicator size is: "<< numprocs <<endl;
MPI_Finalize();
return 0;
}
父进程失败并出现错误: C:\Users.....\Documents\Visual Studio 2010\Projects\mpi\x64\Release>mpi.exe 我是进程 0,我们有 1 个
作业被中止: [排名] 消息
[0] 致命错误 MPI_Comm_spawn 中的致命错误:其他 MPI 错误,错误堆栈: MPI_Comm_spawn(106)........: MPI_Comm_spawn(cmd="child.exe", argv=0x0000000000 000000,maxprocs = 2,MPI_INFO_NULL,根= 0,MPI_COMM_WORLD,内部通信= 0x000000000 026FC20,错误=0x0000000000000000)失败 MPID_Comm_spawn_multiple(314):函数未实现
我做错了什么......看起来很简单...... MSMPI 没有实现 MPI_Comm_spawn ?
I'm trying to use MPI_Comm_spawn to start a second process. Just for demonstration pourposes. The program is quite simple:
int main(int argc, char* argv[])
{ int my_id, numprocs;
MPI_Comm All;
MPI_Init(&argc, &argv) ;
MPI_Comm_rank(MPI_COMM_WORLD, &my_id) ;
MPI_Comm_size(MPI_COMM_WORLD, &numprocs) ;
cout << "I'm process "<< my_id << " and we are " << numprocs <<endl;
MPI_Comm_spawn("child.exe",MPI_ARGV_NULL,2,MPI_INFO_NULL,my_id,MPI_COMM_WORLD, &All,MPI_ERRCODES_IGNORE);
MPI_Comm_size(All, &numprocs) ;
cout << "I'm process "<< my_id << " and we are " << numprocs <<endl;
{
int i;
cin >> i;
}
MPI_Finalize();
return 0;
}
The child.exe is in the same directory of the compiled program, and is also terribly simple:
int main(int argc, char* argv[])
{
int my_id, numprocs,length;
MPI_Comm Parent;
MPI_Win pwin,gwin;
MPI_Init(&argc, &argv) ;
MPI_Comm_rank(MPI_COMM_WORLD, &my_id) ;
MPI_Comm_size(MPI_COMM_WORLD, &numprocs) ;
MPI_Comm_get_parent(&Parent);
cout << "I'm child process "<< my_id << " and we are " << numprocs <<endl;
MPI_Comm_size(Parent, &numprocs) ;
cout << "My parent communicator size is: "<< numprocs <<endl;
MPI_Finalize();
return 0;
}
The parent process fails with a criptic error:
C:\Users.....\Documents\Visual Studio 2010\Projects\mpi\x64\Release>mpi.exe
I'm process 0 and we are 1
job aborted:
[ranks] message
[0] fatal error
Fatal error in MPI_Comm_spawn: Other MPI error, error stack:
MPI_Comm_spawn(106)..........: MPI_Comm_spawn(cmd="child.exe", argv=0x0000000000
000000, maxprocs=2, MPI_INFO_NULL, root=0, MPI_COMM_WORLD, intercomm=0x000000000
026FC20, errors=0x0000000000000000) failed
MPID_Comm_spawn_multiple(314): Function not implemented
What I'm doing wrong.... seem so simple.... MSMPI does not implement MPI_Comm_spawn ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据此文档< /a>,不支持,至少在 Windows HPC Server 2008 中不支持。
来自文档:
According to this document, it is not supported, at least not in Windows HPC Server 2008.
From the document: