0

I am implementing a large C++ project and want to use the "parallel power" of mpi.

I just start to try to learn mpi and at first I thought it would be just like multi thread programming (include the library, code and run),

but found that to compile the program I need to use cmd mpicc and to run the program I need cmd mpirun (at least in the basic examples), so how should I change the cmake file to make it compile together with other parts(other using G++)(it might just be a CMAKE question) and how to run the whole program that I can use the MPI computing just like call a function with out use the mpirun?

Peter XU
  • 63
  • 15
  • As for compilation, see [that question](http://stackoverflow.com/questions/23163075/how-to-compile-an-mpi-included-c-program-using-cmake). As for running the created program, you can either create wrapper or use `add_custom_command` / `add_custom_target` in CMake. Documentation for [FindMPI.cmake](https://cmake.org/cmake/help/v3.7/module/FindMPI.html) explains how *COMMAND* should be given with the second approach. – Tsyvarev Feb 16 '17 at 07:39
  • 1
    For an answer to the second part of the question, see [here](http://stackoverflow.com/a/41506324/1374437). – Hristo Iliev Feb 16 '17 at 08:38

0 Answers0