Now time your program in order to measure the efficiency of your
parallelization
in relation to the number of processes you use.
Hint:
After MPE_Update( graph );
startTime = MPI_Wtime(); //put this before the computations start
. . .
// After all the computations are over...
MPE_Update( graph );
if (rank > 0)
MPI_Send(&rank, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
/* Program Finished */
if (rank == 0) {
for (i = 1; i < size; i++)
{
MPI_Recv(&processID, 1, MPI_INT, MPI_ANY_SOURCE, 0,
MPI_COMM_WORLD, &status);
printf("Process %d is done\n", processID);
}
endTime = MPI_Wtime();
printf("Total time=%lf\n", endTime-startTime);
getchar(); //Pause for a key to be pressed
}