[MPICH] Best way to time MPI_Allreduce

Rajeev Thakur thakur at mcs.anl.gov
Thu Aug 10 14:24:29 CDT 2006


You can also use the SKaMPI benchmark, which has a sophisticated method for
measuring performance of collectives that avoids the barriers.
http://liinwww.ira.uka.de/~skampi/

Rajeev
 

> -----Original Message-----
> From: owner-mpich-discuss at mcs.anl.gov 
> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of Ashley Pittman
> Sent: Thursday, August 10, 2006 12:44 PM
> To: Mehmet Belgin
> Cc: mpich-discuss at mcs.anl.gov
> Subject: Re: [MPICH] Best way to time MPI_Allreduce
> 
> On Thu, 2006-08-10 at 13:20 -0400, Mehmet Belgin wrote:
> > Hi, 
> > 
> > I am trying to do some timing measurements with MPI_Allreduce. I get
> > different results from every processor, as expected. Should 
> I use the
> > MPI_Barrier before and after the MPI_Allreduce call and then time it
> > (which will include the overhead of MPI_Barrier to the timing)? Or
> > will it be accurate if I simply get the maximum of the 
> timing results
> > I collected form each processor. 
> 
> The easiest way would be to use IMB which does it already but assuming
> you want to roll your own, I'd suggest something like this:
> 
>   int warmup = 10;
>   int reps = 10000;
> 
>   for ( count = 0 ; count < warmup ; count++)
>   {
>      MPI_Allreduce(..)
>   }
>   start = time();
>   for ( count = 0 ; count < reps ; count++)
>   {
>      MPI_Allreduce(..)
>   }
>   end = time() - start;
> 
>   MPI_Reduce(&end,&sum,1,MPI_INT,MPI_SUM,0,...)
> 
> Ashley,
> 
> 




More information about the mpich-discuss mailing list