I want to run parallel codes on single pc with core i7 cpu I can compile my code but I have problem with running it.
I compile my code with mpicxx and when I run it by ” mpirun -np 8 ./a.out” only one process is. My operating system is linux ubuntu 11.04.
Working what must I do?
For example I want to run this code:
#include <iostream>
#include <mpi.h>
using namespace std;
int main(int argc, char **argv)
{
int mynode, totalnodes;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD, &totalnodes);
MPI_Comm_rank(MPI_COMM_WORLD, &mynode);
cout << "Hello world from process " << mynode;
cout << " of " << totalnodes << endl;
MPI_Finalize();
}
I use mpich2 with mpirun –version:1.3.1
If you use ubuntu operating system you can execute your codes with mpiexec -n 8 /path/to/application too and no machine file is required just be sure that you installed mpich library properly for doing this you can use synaptic package manager for installing library.