Openmpi Example Programs

Posted on by admin
Openmpi Example Programs

• Download MS-MPI SDK and Redist installers and install them. The download link can be found at our homepage • After installation you can verify that the MS-MPI environment variables have been set (you will want to use these env vars in Visual Studio) • Open up Visual Studio and create a new Visual C++ Win32 Console Application project. Let’s name it MPIHelloWorld and use default settings. • Setup the include directories so that the compiler can find the MS-MPI header files.

Note that we will be building for 64 bits so we will point the include directory to $(MSMPI_INC);$(MSMPI_INC) x64. If you will be building for 32 bits please use $(MSMPI_INC);$(MSMPI_INC) x86 • Setup the linker lib (notice I add msmpi. Frank Marino Real. lib to the additional dependencies and also add $(MSMPI_LIB64) to the Additional Library Directories). Note that we will be building for 64 bits so we will point the Additional Library Directories to $(MSMPI_LIB64). If you will be building for 32 bits please use $(MSMPI_LIB32) If you see these error messages below it is most likely you're building for 32 bits yet specifying 64 bits linking libraries. LNK1120: 5 unresolved externals LNK2019: unresolved external symbol _MPI_Comm_rank@8 referenced in function _main LNK2019: unresolved external symbol _MPI_Finalize@0 referenced in function _main LNK2019: unresolved external symbol _MPI_Init@8 referenced in function _main LNK2019: unresolved external symbol _MPI_Recv@28 referenced in function _main LNK2019: unresolved external symbol _MPI_Send@24 referenced in function _main • Code and build a simple Hello World program • Test run the program on the command line • We recommend that our users use HPC Pack to run MPI across machines. However, you can still run jobs across different machines without HPC Pack, wherein you would need to install MS-MPI on all the machines and start SMPD daemon on each machine using the command smpd –d.