MPI_Barrier()在小型群集上不起作用 [英] MPI_Barrier() does not work on a small cluster
本文介绍了MPI_Barrier()在小型群集上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在程序中使用MPI_Barrier(),但是有一些致命错误.
I want to use MPI_Barrier() in my programme, but there are some fatal errors.
这是我的代码:
1 #include <stdio.h>
2 #include "mpi.h"
3
4 int main(int argc, char* argv[]){
5 int rank, size;
6
7 MPI_Init(&argc, &argv);
8 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
9 MPI_Comm_size(MPI_COMM_WORLD, &size);
10 printf("Hello, world, I am %d of %d. \n", rank, size);
11 MPI_Barrier(MPI_COMM_WORLD);
12 MPI_Finalize();
13
14 return 0;
15 }
这是输出:
Hello, world, I am 0 of 2.
Hello, world, I am 1 of 2.
Fatal error in PMPI_Barrier: Other MPI error, error stack:
PMPI_Barrier(425).........: MPI_Barrier(MPI_COMM_WORLD) failed
MPIR_Barrier_impl(331)....: Failure during collective
MPIR_Barrier_impl(313)....:
MPIR_Barrier_intra(83)....:
dequeue_and_set_error(596): Communication error with rank 0
有什么建议吗?
感谢和问候!
推荐答案
这通常反映出某种配置错误-主机或用户名配置在节点之间不一致,或者存在某种防火墙阻止了某些端口. MPICH2 FAQ 讨论了一些要查找的地方.
This generally reflects some sort of configuration error -- either host or username configurations are not consistent across nodes, or there is some sort of firewall blocking some ports. The MPICH2 FAQ discusses some places to look.
这篇关于MPI_Barrier()在小型群集上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文