我创建了一个简单的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();
}
但是为了使程序运行,我需要smpd管理器和mpiexec,这不是ms-mpi安装的一部分。由于我的计算机运行Windows 10,因此无法安装Microsoft HPC。有没有办法让带有多个线程的桌面上运行的mpi程序?