MPI_Comm_spawn 在 MSMPI 上失败

发布于 2024-10-20 11:45:56 字数 1872 浏览 3 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初与友歌 2024-10-27 11:45:56

根据此文档< /a>,不支持,至少在 Windows HPC Server 2008 中不支持。

来自文档:

MS MPI 包含一整套 MPI2
MPICH2 中实现的功能
动态进程生成除外
和出版,这可能是
包含在以后的版本中。

According to this document, it is not supported, at least not in Windows HPC Server 2008.

From the document:

MS MPI includes a complete set of MPI2
functionality as implemented in MPICH2
with the exception of dynamic process spawn
and publishing, which may be
included in a later release.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文