Click to See Complete Forum and Search --> : Help for parallel computing using MPI


sitha
April 4th, 2007, 06:41 AM
Hi All,
I would like to implement my OOP C++ in computer cluster. But I dont know exactly how to do this. I am very new to this parallel computation. I tried as follows,


#include .....
#include <mpi.h>
int main(int nargs, char** args)
{
int size, my_rank;
MPI_Init (&nargs, &args);
MPI_Comm_size (MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
//here I want to run three different independent job

make_pov();
make_avs();
make_vrml();

MPI_Finalize ();
return 0;
}



Actually this is my first try, please give me how to do this job correctly with little explanation.

Thanks a lot in advance..

Sitha.
Edit/Delete Message

Philip Nicoletti
April 4th, 2007, 08:20 PM
I assume that use use the my_rank variable ...

if (my_rank == 0)
{
// whatever
}
if (my_rank == 1)
{
// whatever
}
if (my_rank == 2)
{
// whatever
}


How are you executing the run ? Are you using mpirun or some
other method ?

sitha
April 5th, 2007, 01:17 AM
I assume that use use the my_rank variable ...
How are you executing the run ? Are you using mpirun or some
other method ?

Thank you very much for your help.

Actually I am very new to this. I dont know my explanation whether correct or not for questions.
My cluster has 32 nodes.
it has MPICH2 for parallel computing
for executing we use

mpiexec -l filename -n 32 ./.out


for above application if I want to use all nodes how can I do?

Please give me the idea what is the best way to compile and run a program.

Thanks a lot.

Sitha.