【问题标题】:MPI stopped working on multiple cores suddenlyMPI 突然停止在多个内核上工作
【发布时间】:2020-02-23 02:55:19
【问题描述】:

这段代码在使用 mpi 之前运行良好

#include <mpi.h>
#include <iostream>

using namespace std;

int id, p;

int main(int argc, char* argv[])
{
    MPI_Init(&argc, &argv);

    MPI_Comm_rank(MPI_COMM_WORLD, &id);
    MPI_Comm_size(MPI_COMM_WORLD, &p);

    cout << "Processor " << id << " of " << p << endl;
    cout.flush();

    MPI_Barrier(MPI_COMM_WORLD);
    if (id == 0) cout << "Every process has got to this point now!" << endl;

    MPI_Finalize();
}

给出输出:

Processor 0 of 4
Processor 1 of 4
Processor 2 of 4
Processor 3 of 4
Every process has got to this point now!

使用命令mpiexec -n 4 ${executable filename}$ 在 4 核上运行时

我重新启动了我的笔记本电脑(我不确定这是否是原因)并运行了相同的代码并在一个内核上输出:

Processor 0 of 1
Every process has got to this point now!
Processor 0 of 1
Every process has got to this point now!
Processor 0 of 1
Every process has got to this point now!
Processor 0 of 1
Every process has got to this point now!

我正在使用 microsoft mpi 并且项目配置没有改变。 我真的不知道该怎么做。 我还安装了英特尔并行工作室,并在重新启动之前将其与 Visual Studio 集成。 但我仍在使用 Visual c++ 进行编译(与正常工作时相同的配置)

【问题讨论】:

  • 当您的应用使用 MPI 库(例如 MS MPI)但您使用来自其他 MPI 库(例如英特尔 MPI)的 mpiexec 时,通常会发生这种情况

标签: c++ visual-c++ parallel-processing mpi


【解决方案1】:

简单的解决方法是卸载英特尔并行工作室

【讨论】:

    猜你喜欢
    • 2017-08-22
    • 2021-02-01
    • 2016-12-29
    • 2018-05-09
    • 2015-12-07
    • 2015-08-23
    • 2014-02-05
    • 2013-09-06
    相关资源
    最近更新 更多