MPICH2 Code::Blocks IDE
MPICH2 Code::Blocks IDE
5. Go to "Search Directories" tab. In the "Compiler" option click Add and point to your
MPICH2 include folder path. Usually, it located in C:\Program Files\MPICH2\include
Denny Hermawanto 2011
#include <iostream>
#include "mpi.h"
#include <string>
return 0;
}
9. Build the code (Ctrl-F9) and your executable program result will be in folder
bin/Debug of your project folder.
To run your parallel program, you must launch it using mpiexec.exe if you use Windows
Operating System. Follow these steps:
1. Open console and change directory to the executable file in your project path. For
example, my program is located in this folder:
E:\My Documents\C++ Project\MPI\bin\Debug
Denny Hermawanto 2011
2. Suppose you want to execute your parallel program named MPI.exe using 2 nodes
locally (in your computer only), the script to execute program will look like this:
E:\My Documents\C++ Project\MPI\bin\Debug>mpiexec -n 2 -localonly MPI
14. Then you are ready to code using MPICH2 using CodeBlocks C++ IDE...