[mpich-discuss] measuring time in mpi program

Jain, Rohit Rohit_Jain at mentor.com
Fri Feb 25 16:24:04 CST 2011


Is there any performance data on using MPI_WTime()? How much time does
it typically take?

We have lot of 'wait-send' and 'wait-receive' code at lot of places, and
we need to measure time spent in this sections. We currently use
gettimeofday() function to measure this time. Would MPI_WTime be faster
than that?

Regards,
Rohit


-----Original Message-----
From: mpich-discuss-bounces at mcs.anl.gov
[mailto:mpich-discuss-bounces at mcs.anl.gov] On Behalf Of Gus Correa
Sent: Friday, February 25, 2011 10:49 AM
To: Mpich Discuss
Subject: Re: [mpich-discuss] measuring time in mpi program

hatem Elshazly wrote:
> hey guys,
> 
> does anybody know how to measure execution time of mpi program?
> is there any option we can append in the mpirun\mpiexec command to 
> measure time?
> is there any time command that measure clock cycle time, execution 
> time,etc..?
> 
> 
> thank u very much
> hatem
> 
> 
>

Hi Hatem

The standard outline is something like this:

... initialize your MPI environment ...
start=MPI_Wtime()
... do your work (including MPI calls)...
end=MPI_Wtime()
if (myrank .eq. 0) then
   print *, "Time spent (in seconds) is: ", end - start
endif
... finalize MPI ...

(You could also print the results from all ranks, if you want.)

I my experience, perfomance tends to be quite variable if you don't have
a 'critical mass' of "do your work", i.e., if you do just a
couple of send/recv and get out.  Works better if your MPI calls
are on a loop in "do your work".

I hope this helps.
Gus Correa

PS - It looks like you managed to troubleshoot your network problems.
I hope so.
You never got back to the list on that subject.
_______________________________________________
mpich-discuss mailing list
mpich-discuss at mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss


More information about the mpich-discuss mailing list