[mpich-discuss] MPI_WIN_FENCE versus MPI_WIN_{LOCK|UNLOCK}

Timothy Stitt Timothy.Stitt.9 at nd.edu
Fri Jun 1 09:37:41 CDT 2012


Hi all,

Following a recent discussion on MPI_WIN_CREATE I was hoping some MPICH2 folks could shed some further light on how MPI_WIN_FENCE and MPI_{LOCK|UNLOCK} are implemented. Which of the two attempts below is better from a performance point-of-view when executed regularly within my code:

* Attempt 1 *

loop 1..n

	call MPI_LOCK(...)
	call MPI_PUT(...)
	call MPI_UNLOCK(...)

end loop

or 

* Attempt 2 *

loop 1..n

	call MPI_PUT(...)

end loop

call MPI_WIN_FENCE(...)

I also have a third attempt that uses active target RMA using MPI_WIN_{START|COMPLETE} and MPI_WIN_{POST|WAIT}. Is there any benefit to using one approach over the other, in general?

Thanks in advance for your advice,

Tim.


More information about the mpich-discuss mailing list