在台式机上运行MPI程序?

时间:2020-01-24 08:38:52

标签: windows visual-studio mpi desktop

我创建了一个简单的Hello World程序来测试MPI,如Microsoft所述,代码为:

#include <mpi.h>
#include <stdio.h>

int main(int argc, char** argv) {
    printf("Hello");
    int node;
    // Initialize the MPI environment
    MPI_Init(&argc, &argv);

    // Get the rank of the process
    MPI_Comm_rank(MPI_COMM_WORLD, &node);

    // Print off a hello world message
    printf("Hello world from node %d\n",node);

    // Finalize the MPI environment.
    MPI_Finalize();
}

程序编译没有错误: enter image description here

但是为了使程序运行,我需要smpd管理器和mpiexec,这不是ms-mpi安装的一部分。由于我的计算机运行Windows 10,因此无法安装Microsoft HPC。有没有办法让带有多个线程的桌面上运行的mpi程序?

1 个答案:

答案 0 :(得分:0)

不是在桌面上运行MPI程序所需的Microsoft HPC Pack,而是Microsoft HPC Pack SDK。轻微但重要的区别。

相关问题