Adding MPI support to a C++ program

c++, mpi, openmpi, parallel-processing

Solution

I would really recommend picking up the Gropp MPI Book, it really helps for basic MPI!

Problem

I have a program that is been implemented in C++ which I now want to add MPI support. There is an MPI binding for C++, with namespace MPI and everything. In my case I have a specific object that is suitable to be the parallelized process into the cluster. My questions are: - Has anyone done something like this before? Can I get some advices on how best to implement this? - How do I initialize MPI inside the constructor? After initializing MPI inside the constructor of the Class, will all the intermediate calls be parallelized too? For example: ``` MyClass obj; x = x; //this will be parallelized ? onj.calc(); y = x++; //this will be parallelized ? z = obj.result(); ```

Original source