Compile C++ MPI Code on Windows

。_饼干妹妹 提交于 2019-12-11 12:58:15

问题


I have just installed Microsoft MPI (MS-MPI) which "is a Microsoft implementation of the Message Passing Interface standard for developing and running parallel applications on the Windows platform".

The site also contains a link to a featured tutorial: How to compile and run a simple MS-MPI program.

The compilation there is done using Visual Studio.

How to compile a C++ MPI code at the command line (without using VS)?


A simple program to be compiled:

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

int main(int argc, char *argv[]) { 
MPI::Init(argc, argv);

     int num_procs = MPI::COMM_WORLD.Get_size();
     int rank = MPI::COMM_WORLD.Get_rank();
     std::cout << "Hello world from processes " << rank
                << " of " << num_procs << "\n";
MPI::Finalize();

return 0;
}

来源:https://stackoverflow.com/questions/37554020/compile-c-mpi-code-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!