True. However, since these semantics are not built into the PUT, the user
would need to do it him/herself.
For the sake of completeness, let me try to rewrite the code in this way.
I will write it in the form of a program, rather than a trace as it was
originally shown. If anyone else can do better, they are welcome to.
-Dave
=================================================================
One iteration in process 2 through n (PUT/ACCEPT proposal)
MPI_PUTC(x,y,z,w,a,b,1,t)
compute
MPI_PUTC(1,x,y,z,w,a,b,1,t)
MPI_ACCEPTC(xxxxx,b,1,t)
=================================================================
One iteration in process 2 through n (BARRIER model).
I have encapsulated some of the code into routines INITSAVEARGS,
SAVEARGS and UNSAVEARGS, which just store arguments away (e.g.
in arrays) and "unstore" them by executing PUT with them.
C Clear out any saved arguments for comm b, rank 1
CALL INITSAVEARGS(b,1)
C Start up the BARRIER
CALL MPI_IBARRIER(......,IB_REQ)
FINISHED = .FALSE.
C First PUT
if (MPI_TEST(IB_REQ)) then
FINISHED = .TRUE.
CALL MPI_PUT(x,y,z,w,a,b,1)
else
C Save args of PUT for later
CALL SAVEARGS(x,y,z,w,a,b,1)
endif
C Compute
compute
C Second PUT
if (FINISHED .OR. MPI_TEST(IB_REQ)) then
C First call PUT with saved args, if any
CALL UNSAVEANYARGS(b,1)
C Now call PUT with new stuff
CALL MPI_PUT(x,y,z,w,a,b,1)
else
C Barrier still not done. Save new args, too
CALL SAVEARGS(x,y,z,w,a,b,1)
endif
C Wait for barrier to finish
CALL MPI_WAIT(IB_REQ)
C Perform any PUTs that were saved away.
CALL UNSAVEANYARGS(b,1)
=================================================================
>
> >
> > In a BARRIER-based model, like the main draft:
> >
> > Process 1 Process 2 Process 3
> >
> > read
> > BARRIER BARRIER BARRIER
> > PUT to 1 PUT to 1
> > compute compute
> > PUT to 1 PUT to 1
> > BARRIER BARRIER BARRIER
> > WINDOW_IN
> > read
> > BARRIER BARRIER BARRIER
> > PUT to 1 PUT to 1
> > compute compute
> > PUT to 1 PUT to 1
> > BARRIER BARRIER BARRIER
> > WINDOW_IN
> > etc.
> >
> > Same example in the PUT/ACCEPT model.
> >
> > read
> > ACCEPTC
> > PUTC to 1 PUTC to 1
> > compute compute
> > PUTC to 1 PUTC to 1
> > ACCEPTC ACCEPTC
> > read
> > ACCEPTC
> > PUTC to 1 PUTC to 1
> > compute compute
> > PUTC to 1 PUTC to 1
> > ACCEPTC ACCEPTC
===============================================================================
David C. DiNucci | MRJ, Inc., Rsrch Scntst |USMail: NASA Ames Rsrch Ctr
dinucci@nas.nasa.gov| NAS (Num. Aerospace Sim.)| M/S T27A-2
(415)604-4430 | Parallel Tools Group | Moffett Field, CA 94035