Commit 4bff013d authored by James Dinan's avatar James Dinan
Browse files

[svn-r10511] Removed old synch. error checking in RMA

The old "lockRank" error checking is no longer sufficient in MPI 3.0 and must
be removed to add support for locking multiple targets.

Reviewer: balaji
parent 66f63712
......@@ -1663,8 +1663,6 @@ typedef struct MPID_Win {
MPID_Comm *comm_ptr; /* Pointer to comm of window (dup) */
int myrank; /* Rank of this process in comm (used to
detect operations on self) */
int lockRank; /* If within an MPI_Win_lock epoch,
the rank that we locked */
#ifdef USE_THREADED_WINDOW_CODE
/* These were causing compilation errors. We need to figure out how to
integrate threads into MPICH before including these fields. */
......@@ -1707,12 +1705,6 @@ extern MPIU_Object_alloc_t MPID_Win_mem;
/* Preallocated win objects */
extern MPID_Win MPID_Win_direct[];
enum MPID_Win_lock_states {
/* LOCKED = 0, 1, ... */
MPID_WIN_STATE_UNLOCKED = -1,
MPID_WIN_STATE_LOCKED_ALL = -2
};
/* ------------------------------------------------------------------------- */
/* also in mpirma.h ?*/
/* ------------------------------------------------------------------------- */
......
......@@ -385,19 +385,6 @@ be in the range 0 to %d
**lockassertval %d: Invalid assert argument (%d) passed to MPI_Win_lock
**winunlockrank:Invalid rank argument
**winunlockrank %d %d:Invalid rank argument %d, should be %d
**mismatchedlockrank:Rank to unlock in MPI_Win_unlock was not locked with \
MPI_Win_lock
**mismatchedlockrank %d %d:Rank to unlock (%d) in MPI_Win_unlock was not \
locked with MPI_Win_lock (rank %d was locked)
**winunlockwithoutlock: Attempt to unlock in MPI_Win_unlock without \
first locking with MPI_Win_lock
**winfreewhilelocked: MPI_Win_free called while holding an MPI_Win_lock on \
a window
**winfreewhilelocked %d: MPI_Win_free called while holding an MPI_Win_lock on \
the process with rank %d
**lockwhilelocked: Attempt to lock a process while holding a lock
**lockwhilelocked %d: Attempt to lock a process while holding a lock on \
process %d
**nomemreq:failure occurred while allocating memory for a request object
**nomemuereq %d:Failed to allocate memory for an unexpected message. %d \
unexpected messages queued.
......
......@@ -130,7 +130,6 @@ int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
/* Initialize a few fields that have specific defaults */
win_ptr->name[0] = 0;
win_ptr->errhandler = 0;
win_ptr->lockRank = MPID_WIN_STATE_UNLOCKED;
/* return the handle of the window object to the user */
MPIU_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
......
......@@ -118,7 +118,6 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Com
/* Initialize a few fields that have specific defaults */
win_ptr->name[0] = 0;
win_ptr->errhandler = 0;
win_ptr->lockRank = MPID_WIN_STATE_UNLOCKED;
/* return the handle of the window object to the user */
MPIU_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
......
......@@ -129,7 +129,6 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info,
/* Initialize a few fields that have specific defaults */
win_ptr->name[0] = 0;
win_ptr->errhandler = 0;
win_ptr->lockRank = MPID_WIN_STATE_UNLOCKED;
/* return the handle of the window object to the user */
MPIU_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
......
......@@ -101,7 +101,6 @@ int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win)
/* Initialize a few fields that have specific defaults */
win_ptr->name[0] = 0;
win_ptr->errhandler = 0;
win_ptr->lockRank = MPID_WIN_STATE_UNLOCKED;
/* return the handle of the window object to the user */
MPIU_OBJ_PUBLISH_HANDLE(*win, win_ptr->handle);
......
......@@ -81,12 +81,7 @@ int MPI_Win_free(MPI_Win *win)
MPID_Win_valid_ptr( win_ptr, mpi_errno );
if (mpi_errno) goto fn_fail;
/* Check for unterminated lock epoch */
if (win_ptr->lockRank != MPID_WIN_STATE_UNLOCKED) {
MPIU_ERR_SET1(mpi_errno,MPI_ERR_OTHER,
"**winfreewhilelocked",
"**winfreewhilelocked %d", win_ptr->lockRank);
}
/* TODO: Check for unterminated passive target epoch */
/* TODO: check for unterminated active mode epoch */
if (mpi_errno) goto fn_fail;
......
......@@ -121,16 +121,11 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
if (mpi_errno) goto fn_fail;
}
/* Test if window is unlocked */
if (win_ptr->lockRank != MPID_WIN_STATE_UNLOCKED) {
MPIU_ERR_SET1(mpi_errno,MPI_ERR_OTHER,
"**lockwhilelocked",
"**lockwhilelocked %d", win_ptr->lockRank );
if (mpi_errno) goto fn_fail;
}
comm_ptr = win_ptr->comm_ptr;
MPIR_ERRTEST_SEND_RANK(comm_ptr, rank, mpi_errno);
/* TODO: Test if window is unlocked */
/* TODO: Validate that window is not in active mode */
}
MPID_END_ERROR_CHECKS;
......@@ -142,8 +137,6 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
mpi_errno = MPIU_RMA_CALL(win_ptr,
Win_lock(lock_type, rank, assert, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* If the lock succeeded, remember which one with locked */
win_ptr->lockRank = rank;
/* ... end of body of routine ... */
......
......@@ -111,11 +111,7 @@ int MPI_Win_lock_all(int assert, MPI_Win win)
if (mpi_errno) goto fn_fail;
}
if (win_ptr->lockRank != MPID_WIN_STATE_UNLOCKED) {
MPIU_ERR_SET1(mpi_errno,MPI_ERR_OTHER,
"**lockwhilelocked",
"**lockwhilelocked %d", win_ptr->lockRank );
}
/* TODO: Validate that window is not already locked */
/* TODO: Validate that window is not already in active mode */
if (mpi_errno) goto fn_fail;
......@@ -130,9 +126,6 @@ int MPI_Win_lock_all(int assert, MPI_Win win)
Win_lock_all(assert, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* If the lock succeeded, remember which one with locked */
win_ptr->lockRank = MPID_WIN_STATE_LOCKED_ALL;
/* ... end of body of routine ... */
fn_exit:
......
......@@ -87,18 +87,8 @@ int MPI_Win_unlock(int rank, MPI_Win win)
comm_ptr = win_ptr->comm_ptr;
MPIR_ERRTEST_SEND_RANK(comm_ptr, rank, mpi_errno);
/* Test that the rank we are unlocking is the rank that we locked */
if (win_ptr->lockRank != rank) {
if (win_ptr->lockRank < 0) {
MPIU_ERR_SET(mpi_errno,MPI_ERR_RANK,"**winunlockwithoutlock");
}
else {
MPIU_ERR_SET2(mpi_errno,MPI_ERR_RANK,
"**mismatchedlockrank",
"**mismatchedlockrank %d %d", rank, win_ptr->lockRank );
}
if (mpi_errno) goto fn_fail;
}
/* TODO: Test that the rank we are unlocking is a rank that we locked */
}
MPID_END_ERROR_CHECKS;
}
......@@ -108,9 +98,6 @@ int MPI_Win_unlock(int rank, MPI_Win win)
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_unlock(rank, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* Clear the lockRank on success with the unlock */
/* FIXME: Should this always be cleared, even on failure? */
win_ptr->lockRank = MPID_WIN_STATE_UNLOCKED;
/* ... end of body of routine ... */
......
......@@ -83,18 +83,7 @@ int MPI_Win_unlock_all(MPI_Win win)
/* If win_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
/* Test that the rank we are unlocking is the rank that we locked */
if (win_ptr->lockRank != MPID_WIN_STATE_LOCKED_ALL) {
if (win_ptr->lockRank == MPID_WIN_STATE_UNLOCKED) {
MPIU_ERR_SET(mpi_errno,MPI_ERR_RANK,"**winunlockwithoutlock");
}
else {
MPIU_ERR_SET2(mpi_errno,MPI_ERR_RANK,
"**mismatchedlockrank",
"**mismatchedlockrank %d %d", MPID_WIN_STATE_LOCKED_ALL, win_ptr->lockRank );
}
if (mpi_errno) goto fn_fail;
}
/* TODO: Test that the rank we are unlocking is the rank that we locked */
}
MPID_END_ERROR_CHECKS;
}
......@@ -104,9 +93,6 @@ int MPI_Win_unlock_all(MPI_Win win)
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_unlock_all(win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* Clear the lockRank on success with the unlock */
/* FIXME: Should this always be cleared, even on failure? */
win_ptr->lockRank = MPID_WIN_STATE_UNLOCKED;
/* ... end of body of routine ... */
......
......@@ -265,7 +265,6 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
(*win_ptr)->start_assert = 0;
(*win_ptr)->comm_ptr = win_comm_ptr;
(*win_ptr)->myrank = comm_ptr->rank;
/* (*win_ptr)->lockRank is initizlized when window is locked*/
(*win_ptr)->my_counter = 0;
/* (*win_ptr)->base_addrs[] is set by caller; */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment