Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread Storm Zhang
I got it. You're right, it might not related to MPI. I need to figure out what's the possible reason for it. Again, thanks for your help. Linbao On Thu, Oct 21, 2010 at 12:06 PM, Eugene Loh wrote: > My main point was that, while what Jeff said about the short-comings of

Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread Eugene Loh
My main point was that, while what Jeff said about the short-comings of calling timers after Barriers was true, I wanted to come in defense of this timing strategy.  Otherwise, I was just agreeing with him that it seems implausible that commenting out B should influence the timing of A, but

Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread Storm Zhang
Hi, Eugene, You said: " The bottom line here is that from a causal point of view it would seem that B should not impact the timings. Presumably, some other variable is actually responsible here." Could you explain it in more details for the second sentence. Thanks a lot. Linbao On Thu, Oct 21,

Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread Storm Zhang
Thanks a lot. On Thu, Oct 21, 2010 at 9:21 AM, Jeff Squyres wrote: > Ah. The original code snipit you sent was: > > MPI::COMM_WORLD.Barrier(); > if if(rank == master) t1 = clock(); > "code A"; > MPI::COMM_WORLD.Barrier(); > if if(rank == master) t2 = clock(); > "code B"; >

Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread Eugene Loh
Jeff Squyres wrote: Ah. The original code snipit you sent was: MPI::COMM_WORLD.Barrier(); if(rank == master) t1 = clock(); "code A"; MPI::COMM_WORLD.Barrier(); if(rank == master) t2 = clock(); "code B"; Remember that the time that individual processes exit barrier is not guaranteed to be

Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread Jeff Squyres
Ah. The original code snipit you sent was: MPI::COMM_WORLD.Barrier(); if if(rank == master) t1 = clock(); "code A"; MPI::COMM_WORLD.Barrier(); if if(rank == master) t2 = clock(); "code B"; Remember that the time that individual processes exit barrier is not guaranteed to be uniform (indeed, it

Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread Storm Zhang
Thanks for your suggestion. I am trying MPI_Wtime to see if there is any difference. Linbao On Thu, Oct 21, 2010 at 1:37 AM, jody wrote: > Hi > > I don't know the reason for the strange behaviour, but anyway, > to measure time in an MPI application you should use

Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread Jeff Squyres
On Oct 20, 2010, at 5:51 PM, Storm Zhang wrote: > I need to measure t2-t1 to see the time spent on the code A between these two > MPI_Barriers. I notice that if I comment code B, the time seems much less the > original time (almost half). How does it happen? What is a possible reason > for it?

Re: [OMPI users] Question about MPI_Barrier

2010-10-21 Thread jody
Hi I don't know the reason for the strange behaviour, but anyway, to measure time in an MPI application you should use MPI_Wtime(), not clock() regards jody On Wed, Oct 20, 2010 at 11:51 PM, Storm Zhang wrote: > Dear all, > > I got confused with my recent C++ MPI

[OMPI users] Question about MPI_Barrier

2010-10-20 Thread Storm Zhang
Dear all, I got confused with my recent C++ MPI program's behavior. I have an MPI program in which I use clock() to measure the time spent between to MPI_Barrier, just like this: MPI::COMM_WORLD.Barrier(); if if(rank == master) t1 = clock(); "code A"; MPI::COMM_WORLD.Barrier(); if if(rank ==