TEST YOUR MPI
It sometimes amazes me how a lot of people are much happier to ask stupid questions than to just do the basic work themselves, maybe even learning something in the process. In the Gromacs community, the past couple weeks have been a great time for some nice examples of this. Version 4 came out, which *substantially* improves the scalability of parallelized molecular simulations, due to a move from the previously standard particle decomposition method to the much more general domain decomposition (DD) method. The DD method has been popular in continuum physics and in other fields for quite some time, but this is the first real application to discrete work it has seen.
So, of course, people need to know how to do parallel simulations with this code. In all major package managers 4.0.2 hasn’t made it through any appropriate channels, so people have to build it themselves. Unlike most major scientific packages, building Gromacs is absurdly simple. Things are quite beautiful actually.
Anyway, my point isn’t to extol the virtues of Gromacs but rather to suggest that if something doesn’t work, do the initial work to figure out the problem and exhaust at least the most obvious problems with the software before throwing your hands up in the air. Problem with MPI? Test it first! Anyone working with MPI should at the very least be able to look up how to write a basic MPI application.
An example:
#include "stdio.h"
#include "mpi.h"
int
main(argc, argv)
int argc;
char *argv[];
{
int rank, size, length;
char name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Get_processor_name(name, &length);
printf ("process %d of %d on %s\n", rank, size, name);
MPI_Finalize();
return 0;
}
If you’re on a modern Debian or Ubuntu build with OpenMPI installed (pretty much the standard MPI implementation you should be using), then build.
$ mpicc.openmpi -o hello hello.c
$ mpirun.openmpi -np 4 hello
process 1 of 4 on enskog
process 2 of 4 on enskog
process 3 of 4 on enskog
process 0 of 4 on enskog
I do love my MPI. And Gromacs does dynamic load balancing now … so freaking fast.
Cheers.
Nice post. Thank you for the info. Keep it up.
Ah Costa, well written sir. I’ll have to check out Gromacs at some point. Sounds interesting.