NCSA Home
Contact Us | Intranet | Search

ncsa

Debugging and Timing MPI Programs

  1. Debugging
  2. Timing


1. Debugging

  • SGI Origin 2000

  • The TotalView Multiprocess Debugger is available. See the Performance Tools page for general information on TotalView, and follow the link here for specific information on debugging MPI programs.

2. Timing an MPI program

  • Within the code

  • To get an idea of how much CPU time was used in various parts of your code so that you can determine where you need to tune things, you can use dtime or etime for Fortran codes. However, the timings will be per thread when you do this so you'll need to either print the timings from each thread or use an MPI_gather() operation to collect the times from all of the nodes. If you are programming with C you can use the times() system call which may be easier to use for C programmers.

    In C, the routine MPI_wtime() gives you the wallclock time used by your MPI job. This gets you the amount of wallclock time that your job requires which will allow you to calculate speedup. You should be warned that speedup measurements are only accurate in the dedicated queues and you should not take too much stock in the effective speedup you see in the batch queues due to the range of load conditions and context switching that occurs there.

  • Outside the code

    • SGI Origin

    • /bin/time or timex do not work with SGI native MPI. As a workaround, a close approximation can be obtained by using the perfex command as follows:

             mpirun -np n perfex -y -o filename a.out
      

    Note that the time obtained from perfex is the sum of all the MPI processes.