1

I'm benchmarking an MPI program with different compiler setups.

Right now I use Linux's time to do so:

$> $(which time) mpirun -v [executable]

The values I get look ok in terms of what I expected.

Are there any reasons why I should not be using time for this?

Measuring the needed CPU time is of main interest here.

I'm aware that benchmarking on a single machine is not necessarily going to be consistent with what's happening on a cluster, but this is out of scope.

j2L4e
  • 6,914
  • 34
  • 40

1 Answers1

1

You should not use time for the purpose of getting the CPU time of a MPI program.

Firstly, that is not going to work in a distributed setup. Now your question is not clear whether you target a single node or a cluster, but that doesn't even matter. An MPI implementation may use whatever mechanism for launching even on a single node. So time may or may not include the CPU time of the actual application processes.

But there is more conceptional issues: What does CPU time for an MPI program mean? That would be the sum of CPU time of all processes. That is a bad metric for benchmarking: It does not quantify improvement, and it does not correlate to overall runtime. For instance a very imbalanced version of your code may use less CPU time but more wall time than a balanced one. Or enabling busy waiting instead of blocking may improve overall runtime, but also increase used CPU time. To really understand what is happenening, and which process uses what kind of resources, you should resort to a proper parallel performance analysis tool.

In HPC, you are not going to be budgeted by CPU time but rather by reserved CPUs * walltime. So if you must use a one dimensional metric, then walltime is the way to go. Now you can use time mpirun ... to get that, although accuracy won't be great for short running applications.

Community
  • 1
  • 1
Zulan
  • 21,896
  • 6
  • 49
  • 109
  • thank you for your detailed answer! I have very little experience in this matter, so it's very appreciated! – j2L4e Dec 17 '16 at 17:45