OpenMPI MPI_Barrier problems

后端 未结 4 1110
花落未央
花落未央 2021-01-02 13:28

I having some synchronization issues using the OpenMPI implementation of MPI_Barrier:

int rank;
int nprocs;

int rc = MPI_Init(&argc, &argv);

if(rc          


        
4条回答
  •  轮回少年
    2021-01-02 13:54

    Output ordering is not guaranteed in MPI programs.

    This is not related to MPI_Barrier at all.

    Also, I would not spend too much time on worrying about output ordering with MPI programs.

    The most elegant way to achieve this, if you really want to, is to let the processes send their messages to one rank, say, rank 0, and let rank 0 print the output in the order it received them or ordered by ranks.

    Again, dont spend too much time on trying to order the output from MPI programs. It is not practical and is of little use.

提交回复
热议问题