TEST YOUR MPI

Personal, Science, Technical — acosta @ 4:53 pm

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.

A RANT (ALITALIA SUCKS)

Personal — acosta @ 8:09 pm

Ah it’s time to go on a bit of a rant here. I learned a number of important travel tips while I was trying to get back to the states from Italy. They are:

  • Flying random airlines localized to a specific country is usually a very bad idea
  • … Especially when those airlines are localized to a country where strikes are often completely random in nature.
  • Never, ever, when traveling internationally, book multiple trips on the same day.

Now some specifics:

I arrive, after a really fantastic trip in Italy, to the major Rome international airport (FCO). My flight was to London on Alitalia, where I was to pick up a seperate set of flights back to Indianapolis. The UK government paid for my trip to and from London whereas my trip to Italy was for personal business, so these two trips were booked separately.

Accordingly to Alitalia, my flight was “confirmed” and my ticket was “valid”. Ha! Well it turns out that Alitalia was randomly striking at the time, but only sort of striking, as some pilots would show up to fly the planes and others would not. This seemed to be completely par for the course there, which didn’t make much sense to me. Turns out people had been waiting there for a flight to London for over 3 days. None of their flights had left due to this strike. And of course all other flights to London were way overbooked because Alitalia hadn’t had a flight there in nearly a week. But, of course, according to the airline, the tickets were still “valid”, they just didn’t have pilots to fly the planes.

As the time came where it became obvious that I wasn’t going to make my connections in London, I started to freak out a bit, since it seemed no one was going anywhere from Rome and I was never going to be able to get home. I forfeited my flights from London to Indianapolis and was stuck in Rome because of this crappy airline. So, I had to wake up my parents at 2 am on the west coast to book me new flights back to Indianapolis through Frankfurt and DC. What was a nearly free 2 week stay in Europe had just become much more expensive.

Obviously I couldn’t show up for my flights in London, so those tickets were just flat gone. Would Alitalia at the very least give me my money back? Of course not, they claimed my tickets were still “valid”. Good lord. Screw you people.

When I arrived in Rome and told the people I was staying with that I was flying out on Alitalia, they openly laughed at me and said “good luck getting home”. Ugh.

Never fly Alitalia.

Cheers.

vdov.net is an anthony costa production. ownership of the content provided is retained by the author and by vdov.net.