我运行简单的MPI程序破解加密的密码,程序完全编译,但如果我运行mpirun -n 3 ./密码破解。py ./ | grep时间在我的命令行,我无法运行MPI程序 程序说明: MPID_Init ....... (162):通道初始化失败 当我以前写python的时候。/密码破解。py 另一个错误程序显示: HYDU_create_process (utils/launch/launch.c:74):文件python上的execvp错误(没有这样的文件或目录) 问题来源StackOverflow 地址:/questions/59467016/mpi-program-gives-mpi-channel-initialization-failed-how-can-i-solve-this-error
估计是因为安装了open-mpi and mpich2
When I compile my program using mpicc, it will be linked to open-mpi not mpich2. To fix this problem, you can use "mpicc.mpich2" to compile your program and then use "mpiexe.mpich2" to execute your code.
测试脚本
int main(int argc, char** argv) {
int myrank, nprocs;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
printf("Hello from processor %d of %d\n", myrank, nprocs);
MPI_Finalize();
return 0;
}
mpicc MPI_Hello.c -o MPI_Hello
编译成功
mpiexec -n 5 ./MPI_Hello 运行报错
[[INVALID],INVALID] ORTE_ERROR_LOG: A system-required executable either could not be found or was not executable by this user in file ../../../../../../orte/mca/ess/singleton/ess_singleton_module.c at line 357 [[INVALID],INVALID] ORTE_ERROR_LOG: A system-required executable either could not be found or was not executable by this user in file ../../../../../../orte/mca/ess/singleton/ess_singleton_module.c at line 230
解决步骤
1、dpkg --listfiles mpich2
......
/usr/bin/mpirun.mpich2 /usr/bin/mpiexec.mpich2
从什么可以看出
2、mpicc.mpich2 MPI_Hello.c -o MPI_Hello
3、mpiexec.mpich2 -n 5 ./MPI_Hello
Hello from processor 0 of 5 Hello from processor 1 of 5 Hello from processor 3 of 5 Hello from processor 2 of 5 Hello from processor 4 of 5
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。