{\bf Amendment to chapter 5 by Rolf Rabenseifner}
The following functions should be added:
\begchangeoct
\begin{funcdef}{MPI\_WIN\_TEST(win, flag)}
\funcarg{\IN}{win}{window object (handle)}
\funcarg{\OUT}{flag}{success flag (Boolean)}
\end{funcdef}
\mpibind{MPI\_Win\_test(MPI\_Win win, int *flag)}
\mpifbind{MPI\_WIN\_TEST(WIN, FLAG, IERROR)\fargs INTEGER WIN, IERROR \fargs LOGICAL FLAG}
\mpicppbind{MPI::Win::test(bool\& flag)}
This is the nonblocking version of \mpifunc{MPI\_WIN\_WAIT}. it
returns \mpiarg{flag = true} if \mpifunc{MPI\_WIN\_WAIT} would return,
\mpiarg{flag = false}, otherwise.
Semantically a call to \mpifunc{MPI\_WIN\_TEST} that returns
\mpiarg{flag = true} is equivalent to a call to
\mpifunc{MPI\_WIN\_WAIT}, and
a call to \mpifunc{MPI\_WIN\_TEST} that returns \mpiarg{flag = false}
is equivalent to a no-op.
\endchangeoct
\begchangeoct
\begin{funcdef}{MPI\_IWIN\_BARRIER(flag, win, request)}
\funcarg{\IN}{flag}{flag argument (integer)}
\funcarg{\IN}{win}{window object (handle)}
\funcarg{\OUT}{request}{request (handle)}
\end{funcdef}
\mpibind{MPI\_Iwin\_barrier( int~flag, MPI\_Win~win, MPI\_Request~request)}
\mpifbind{MPI\_IWIN\_BARRIER(FLAG, WIN, REQUEST, IERROR)\fargs INTEGER FLAG, WIN, REQUEST, IERROR}
\mpicppbind{MPI::Win::Ibarrier(int flag, MPI::Request\& request)}
\alter{
\mpifunc{MPI\_WIN\_{\bf I}BARRIER} instead of
\mpifunc{MPI\_{\bf I}WIN\_BARRIER}.
\\
Pros: No exception in the naming rule for C++ binding.
\\
Cons: Exception in the naming rule for non-blocking.
}
This is the nonblocking version of \mpifunc{MPI\_WIN\_BARRIER}. The
execution of a call to \mpifunc{MPI\_WIN\_BARRIER} is equivalent to
the execution of calls to post-start-complete-wait. The execution of
\mpifunc{MPI\_IWIN\_BARRIER} is equivalent to the execution of
win\_post, win\_complete and win\_start with \mpiarg{flag = MPI\_WEAK},
whereas the successful execution of
the matching wait or test on the request is equivalent to a
strengthen of win\_start to \mpiarg{flag = MPI\_STRONG} and
the execution of win\_start and win\_wait.
I.e., the execution of \mpifunc{MPI\_IWIN\_BARRIER}
completes the execution of preceding RMA calls locally at the origin,
and
posts the window as a target for RMA calls issued by processes after
the barrier, and RMA may be started with the risc that they can block;
the successful completion of this nonblocking call
signals that RMA may be started without blocking
to the processes that have used
\mpifunc{MPI\_IWIN\_BARRIER} to post their window as target,
and that RMA calls issued before the \mpifunc{MPI\_IWIN\_BARRIER}
at the origin were completed at the target.
\mpifunc{MPI\_WIN\_BARRIER} is identical to
\mpifunc{MPI\_IWIN\_BARRIER} followed by \mpifunc{MPI\_WAIT}
and the blocking and non-blocking version can be used by
different processes for the same barrier.
It is not allowed to finish an \mpifunc{MPI\_IWIN\_BARRIER}
request by \mpifunc{MPI\_REQUEST\_FREE} or \mpifunc{MPI\_CANCEL}.
Consider the following code fragment.
\begin{verbatim}
while (...) {
MPI_Iwin_barrier(flag, win, request);
/* some computation */
MPI_Put(&x,...,win);
MPI_Wait(request);
MPI_Iwin_barrier(flag, win, request);
/* some computation */
MPI_Wait(request);
/* local access to the window */
}
\end{verbatim}
In this example the first \mpifunc{MPI\_Iwin\_barrier} finishes
a local-access epoch and starts the RMA epoch.
The second \mpifunc{MPI\_Iwin\_barrier} finishes the RMA eopch
and the ensuing \mpifunc{MPI\_Wait} starts the local-access epoch.
The first \mpifunc{MPI\_Iwin\_barrier} posts the window for RMA,
i.e. from now no local access to the window should be done.
Local computation can prohibit that the process must idle
in the first \mpifunc{MPI\_Wait}.
After this \mpifunc{MPI\_Wait} RMA access can be done.
After the second \mpifunc{MPI\_Iwin\_barrier} the local buffer
{\tt x} can be reused, but it is not guaranteed that the
RMA calls have completed at the target.
Again local computation can prohibit that the process must idle
in the following \mpifunc{MPI\_Wait}.
After that \mpifunc{MPI\_Wait} the data stored by \mpifunc{MPI\_Put}
can be accessed in the local windows.
\endchangeoct