为什么MPI无法正常完成? [英] Why wont MPI finalize gracefully?

查看:192
本文介绍了为什么MPI无法正常完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试完成我的mpi程序时,都会收到类似于以下内容的错误.

Whenever I try to finalize my mpi program, i get errors similar to the following.

[mpiexec] HYDT_dmxu_poll_wait_for_event (./tools/demux/demux_poll.c:70): assert (!(pollfds[i].revents & ~POLLIN & ~POLLOUT & ~POLLHUP)) failed
[mpiexec] main (./pm/pmiserv/pmip.c:221): demux engine error waiting for event
[mpiexec] HYDT_bscu_wait_for_completion (./tools/bootstrap/utils/bscu_wait.c:99): one of the processes terminated badly; aborting
[mpiexec] HYDT_bsci_wait_for_completion (./tools/bootstrap/src/bsci_wait.c:18): bootstrap device returned error waiting for completion
[mpiexec] HYD_pmci_wait_for_completion (./pm/pmiserv/pmiserv_pmci.c:352): bootstrap server returned error waiting for completion
[mpiexec] main (./ui/mpich/mpiexec.c:294): process manager error waiting for completion

有时,它会收到glibc双重释放或损坏"错误.每个进程都是单线程的,并且每个进程都可以肯定地调用MPI_Finalize().知道这里可能出什么问题吗?

Sometimes, it gets a glibc "double free or corruption" error instead. Each process is single-threaded, and each process is for sure calling MPI_Finalize(). Any idea what could be going wrong here?

推荐答案

我编写了一个小型测试程序,应退出而不会出现任何错误.请尝试运行它.如果正常退出,则问题出在您的代码上.

I've written a small test programm that should exit without any errors. Please try to run it. If it exits gracefully, then the problem is with your code.

#include <mpi.h>
#include <cstdio>

int main(int argc, char *argv[])
{
    MPI_Init(&argc, &argv);
    int my_rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
    int finalize_retcode = MPI_Finalize();
    if(0 == my_rank) fprintf(stderr, "Process, return_code\n");
    fprintf(stderr, "%i, %i\n", my_rank, finalize_retcode);
    return 0;
}

这篇关于为什么MPI无法正常完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆