Debugging with MPE
From BCCD 3.0
Sometimes you just need to know what's going on. And when you need to know what's going on with mpich programs and processes (as opposed to work, life, etc.), MPE tools such as mpilog, mpitrace, and mpianim are lower-level tools to help you on your way.
Debugging with Mpilog
This option builds your mpich program to generate an MPI logfile. The three log formats mpilog can create are .alog, .clog, and .slog. .clog is created by default. The debugging program upshot uses the .alog (ASCII log) extension. To create an .alog file, do the following:
- Set an environmental variable to the .alog format:
export MPE_LOG_FORMAT="ALOG"
- Compile your program (substituting
progfor the program name below):
mpicc -mpilog -o prog -lm prog.c
Note: If you forgot to set your environmental variable and made a .clog instead, you can always convert it to an .alog with the clog2alog prog command, where prog is the name of the program without an extension.
Now you have a .alog file in your directory. It is a logfile in human-readable format. If you would like to view your logfile graphically, upshot is a good graphical program to use. For tips on using upshot, go to Debugging with Upshot.
Debugging with Mpitrace
This option generates verbose output of all MPI calls. Fun to watch. Compile your program like below (where prog is the name of your program):
mpicc -mpitrace -o prog -lm prog.c
Then run your program as usual. Be prepared for fun verbose output!
Debugging with Mpianim
This option allows you to watch a real-time animation of your process communication. Two notes:
- You NEED X for this to work.
- It goes really fast for small programs.
Log into X (the startx command usually does the trick) and issue the following command, where prog is the name of your program:
mpicc -mpianim -o prog -lm prog.c -lX11
Then run your program as usual, but look for an animated X screen!
