I have a c++ program that is using the openMPI library to pass messages between different processors. It is a parallel program that uses a genetic algorithm to get a good solution for the traveling salesperson problem. I am trying to set up the MPI environment on my two dual processor computers at my house so that I can run it. When I first created this program a year ago, I was able to run it fine on a cluster that was not set up by me. The problem that I am having now is that whenever I run it, all the processes are saying that they are of rank 0. If I have 3 nodes, instead of them being nodes 1, 2, and 3, they are all node 0. If anyone knows what is going on, I would sure appreciate some help. Thanks.
+1
A:
Perhaps your initialization is wrong or you have some error checking the rank. This should be the right way to do this:
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
printf("I am process %d of %d.\n", rank, size);
But I assume you did that right, so I agree to Harleqin, showing the commands/scripts you use would be helpful.
schnaader
2008-12-08 08:28:42