From e0555889a90dcdddfdc1f13f0e4a2c2a9542fe3b Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Thu, 31 Aug 2006 21:07:52 +0000 Subject: [PATCH] * RMA_SYNC is a more appropriate error message for these than RmA_CONFLICT * Print a warning error message if a target is not in an exposure epoch and an update is received. This results in the app continuing with that call having never happened, rather than evil hangs. refs trac:325 This commit was SVN r11514. The following Trac tickets were found above: Ticket 325 --> https://svn.open-mpi.org/trac/ompi/ticket/325 --- contrib/platform/redstorm | 1 + ompi/mca/osc/pt2pt/osc_pt2pt_component.c | 18 ++++++++++++++++++ ompi/mca/osc/rdma/osc_rdma_component.c | 18 ++++++++++++++++++ ompi/mpi/c/accumulate.c | 2 +- ompi/mpi/c/get.c | 2 +- ompi/mpi/c/put.c | 2 +- ompi/mpi/c/win_complete.c | 2 +- ompi/mpi/c/win_fence.c | 2 +- ompi/mpi/c/win_free.c | 2 +- ompi/mpi/c/win_lock.c | 2 +- ompi/mpi/c/win_post.c | 2 +- ompi/mpi/c/win_start.c | 2 +- ompi/mpi/c/win_test.c | 2 +- ompi/mpi/c/win_unlock.c | 2 +- ompi/mpi/c/win_wait.c | 2 +- ompi/win/win.h | 6 ++++++ 16 files changed, 55 insertions(+), 12 deletions(-) diff --git a/contrib/platform/redstorm b/contrib/platform/redstorm index 99e74b4691..ac806976ab 100644 --- a/contrib/platform/redstorm +++ b/contrib/platform/redstorm @@ -12,6 +12,7 @@ enable_pty_support=no enable_mem_debug=no enable_mem_profile=no enable_debug_symbols=no +enable_binaries=no ompi_cv_f77_sizeof_LOGICAL=${ompi_cv_f77_sizeof_LOGICAL=4} ompi_cv_f77_alignment_LOGICAL=${ompi_cv_f77_alignment_LOGICAL=4} diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_component.c b/ompi/mca/osc/pt2pt/osc_pt2pt_component.c index b4a05045c0..e353a53913 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_component.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_component.c @@ -410,6 +410,12 @@ ompi_osc_pt2pt_component_fragment_cb(ompi_osc_pt2pt_module_t *module, assert(module == ompi_osc_pt2pt_windx_to_module(header->hdr_windx)); + if (!ompi_win_exposure_epoch(module->p2p_win)) { + opal_output(0, "Invalid MPI_PUT on Window %s. Window not in exposure epoch", + module->p2p_win->w_name); + break; + } + ret = ompi_osc_pt2pt_sendreq_recv_put(module, header, payload); } break; @@ -431,6 +437,12 @@ ompi_osc_pt2pt_component_fragment_cb(ompi_osc_pt2pt_module_t *module, assert(module == ompi_osc_pt2pt_windx_to_module(header->hdr_windx)); + if (!ompi_win_exposure_epoch(module->p2p_win)) { + opal_output(0, "Invalid MPI_ACCUMULATE on Window %s. Window not in exposure epoch", + module->p2p_win->w_name); + break; + } + /* receive into temporary buffer */ ret = ompi_osc_pt2pt_sendreq_recv_accum(module, header, payload); } @@ -456,6 +468,12 @@ ompi_osc_pt2pt_component_fragment_cb(ompi_osc_pt2pt_module_t *module, assert(module == ompi_osc_pt2pt_windx_to_module(header->hdr_windx)); + if (!ompi_win_exposure_epoch(module->p2p_win)) { + opal_output(0, "Invalid MPI_GET on Window %s. Window not in exposure epoch", + module->p2p_win->w_name); + break; + } + /* create or get a pointer to our datatype */ proc = module->p2p_comm->c_pml_procs[header->hdr_origin]->proc_ompi; datatype = ompi_osc_pt2pt_datatype_create(proc, &payload); diff --git a/ompi/mca/osc/rdma/osc_rdma_component.c b/ompi/mca/osc/rdma/osc_rdma_component.c index adfbb881bc..a2c90337be 100644 --- a/ompi/mca/osc/rdma/osc_rdma_component.c +++ b/ompi/mca/osc/rdma/osc_rdma_component.c @@ -429,6 +429,12 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl, module = ompi_osc_rdma_windx_to_module(header->hdr_windx); if (NULL == module) return; + if (!ompi_win_exposure_epoch(module->p2p_win)) { + opal_output(0, "Invalid MPI_PUT on Window %s. Window not in exposure epoch", + module->p2p_win->w_name); + break; + } + ret = ompi_osc_rdma_sendreq_recv_put(module, header, payload); } break; @@ -452,6 +458,12 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl, module = ompi_osc_rdma_windx_to_module(header->hdr_windx); if (NULL == module) return; + if (!ompi_win_exposure_epoch(module->p2p_win)) { + opal_output(0, "Invalid MPI_ACCUMULATE on Window %s. Window not in exposure epoch", + module->p2p_win->w_name); + break; + } + /* receive into temporary buffer */ ret = ompi_osc_rdma_sendreq_recv_accum(module, header, payload); } @@ -479,6 +491,12 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl, module = ompi_osc_rdma_windx_to_module(header->hdr_windx); if (NULL == module) return; + if (!ompi_win_exposure_epoch(module->p2p_win)) { + opal_output(0, "Invalid MPI_GET on Window %s. Window not in exposure epoch", + module->p2p_win->w_name); + break; + } + /* create or get a pointer to our datatype */ proc = module->p2p_comm->c_pml_procs[header->hdr_origin]->proc_ompi; datatype = ompi_osc_rdma_datatype_create(proc, &payload); diff --git a/ompi/mpi/c/accumulate.c b/ompi/mpi/c/accumulate.c index 6d1c25c7e0..a319297b3f 100644 --- a/ompi/mpi/c/accumulate.c +++ b/ompi/mpi/c/accumulate.c @@ -58,7 +58,7 @@ int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_data } else if (MPI_OP_NULL == op) { rc = MPI_ERR_OP; } else if (!ompi_win_comm_allowed(win)) { - rc = MPI_ERR_RMA_CONFLICT; + rc = MPI_ERR_RMA_SYNC; } else { OMPI_CHECK_DATATYPE_FOR_SEND(rc, origin_datatype, origin_count); } diff --git a/ompi/mpi/c/get.c b/ompi/mpi/c/get.c index f7746d7158..fccd53d402 100644 --- a/ompi/mpi/c/get.c +++ b/ompi/mpi/c/get.c @@ -54,7 +54,7 @@ int MPI_Get(void *origin_addr, int origin_count, (MPI_PROC_NULL != target_rank)) { rc = MPI_ERR_RANK; } else if (!ompi_win_comm_allowed(win)) { - rc = MPI_ERR_RMA_CONFLICT; + rc = MPI_ERR_RMA_SYNC; } else { OMPI_CHECK_DATATYPE_FOR_SEND(rc, origin_datatype, origin_count); } diff --git a/ompi/mpi/c/put.c b/ompi/mpi/c/put.c index fda254e3be..70c3db0e50 100644 --- a/ompi/mpi/c/put.c +++ b/ompi/mpi/c/put.c @@ -53,7 +53,7 @@ int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, (MPI_PROC_NULL != target_rank)) { rc = MPI_ERR_RANK; } else if (!ompi_win_comm_allowed(win)) { - rc = MPI_ERR_RMA_CONFLICT; + rc = MPI_ERR_RMA_SYNC; } else { OMPI_CHECK_DATATYPE_FOR_SEND(rc, origin_datatype, origin_count); } diff --git a/ompi/mpi/c/win_complete.c b/ompi/mpi/c/win_complete.c index 91bbd9a511..45387081ef 100644 --- a/ompi/mpi/c/win_complete.c +++ b/ompi/mpi/c/win_complete.c @@ -43,7 +43,7 @@ int MPI_Win_complete(MPI_Win win) if (ompi_win_invalid(win)) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_WIN, FUNC_NAME); } else if (0 == (ompi_win_get_mode(win) & OMPI_WIN_STARTED)) { - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_CONFLICT, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } } diff --git a/ompi/mpi/c/win_fence.c b/ompi/mpi/c/win_fence.c index e2a164a3b0..03444906ee 100644 --- a/ompi/mpi/c/win_fence.c +++ b/ompi/mpi/c/win_fence.c @@ -48,7 +48,7 @@ int MPI_Win_fence(int assert, MPI_Win win) } else if (0 != (ompi_win_get_mode(win) & (OMPI_WIN_POSTED | OMPI_WIN_STARTED))) { /* If we're in a post or start, we can't be in a fence */ - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_CONFLICT, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } } diff --git a/ompi/mpi/c/win_free.c b/ompi/mpi/c/win_free.c index 894b0759dc..b92bf90dc7 100644 --- a/ompi/mpi/c/win_free.c +++ b/ompi/mpi/c/win_free.c @@ -44,7 +44,7 @@ int MPI_Win_free(MPI_Win *win) } else if ((OMPI_WIN_ACCESS_EPOCH|OMPI_WIN_EXPOSE_EPOCH) & ompi_win_get_mode(*win)) { return OMPI_ERRHANDLER_INVOKE(*win, - MPI_ERR_RMA_CONFLICT, + MPI_ERR_RMA_SYNC, FUNC_NAME); } } diff --git a/ompi/mpi/c/win_lock.c b/ompi/mpi/c/win_lock.c index bcb4f369b6..21b5447e43 100644 --- a/ompi/mpi/c/win_lock.c +++ b/ompi/mpi/c/win_lock.c @@ -50,7 +50,7 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win) } else if (0 != (assert & ~(MPI_MODE_NOCHECK))) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ASSERT, FUNC_NAME); } else if (0 != (ompi_win_get_mode(win) & OMPI_WIN_ACCESS_EPOCH)) { - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_CONFLICT, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } else if (! ompi_win_allow_locks(win)) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } diff --git a/ompi/mpi/c/win_post.c b/ompi/mpi/c/win_post.c index f2cef4a36f..de6d0a3760 100644 --- a/ompi/mpi/c/win_post.c +++ b/ompi/mpi/c/win_post.c @@ -46,7 +46,7 @@ int MPI_Win_post(MPI_Group group, int assert, MPI_Win win) MPI_MODE_NOPUT))) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ASSERT, FUNC_NAME); } else if (0 != (ompi_win_get_mode(win) & OMPI_WIN_EXPOSE_EPOCH)) { - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_CONFLICT, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } } diff --git a/ompi/mpi/c/win_start.c b/ompi/mpi/c/win_start.c index d5f86a1d5a..2f5d2150d7 100644 --- a/ompi/mpi/c/win_start.c +++ b/ompi/mpi/c/win_start.c @@ -45,7 +45,7 @@ int MPI_Win_start(MPI_Group group, int assert, MPI_Win win) } else if (0 != (assert & ~(MPI_MODE_NOCHECK))) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ASSERT, FUNC_NAME); } else if (0 != (ompi_win_get_mode(win) & OMPI_WIN_ACCESS_EPOCH)) { - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_CONFLICT, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } } diff --git a/ompi/mpi/c/win_test.c b/ompi/mpi/c/win_test.c index 979cb7e063..3230f582aa 100644 --- a/ompi/mpi/c/win_test.c +++ b/ompi/mpi/c/win_test.c @@ -43,7 +43,7 @@ int MPI_Win_test(MPI_Win win, int *flag) if (ompi_win_invalid(win)) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_WIN, FUNC_NAME); } else if (0 == (ompi_win_get_mode(win) & OMPI_WIN_POSTED)) { - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_CONFLICT, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } } diff --git a/ompi/mpi/c/win_unlock.c b/ompi/mpi/c/win_unlock.c index 88bcd468f4..800f5491f1 100644 --- a/ompi/mpi/c/win_unlock.c +++ b/ompi/mpi/c/win_unlock.c @@ -45,7 +45,7 @@ int MPI_Win_unlock(int rank, MPI_Win win) } else if (ompi_win_peer_invalid(win, rank)) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RANK, FUNC_NAME); } else if (0 == (ompi_win_get_mode(win) & OMPI_WIN_LOCK_ACCESS)) { - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_CONFLICT, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } } diff --git a/ompi/mpi/c/win_wait.c b/ompi/mpi/c/win_wait.c index 3baa76c9b5..75dfc5ec75 100644 --- a/ompi/mpi/c/win_wait.c +++ b/ompi/mpi/c/win_wait.c @@ -43,7 +43,7 @@ int MPI_Win_wait(MPI_Win win) if (ompi_win_invalid(win)) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_WIN, FUNC_NAME); } else if (0 == (ompi_win_get_mode(win) & OMPI_WIN_POSTED)) { - return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_CONFLICT, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } } diff --git a/ompi/win/win.h b/ompi/win/win.h index 5d3b065ae9..2949670c6d 100644 --- a/ompi/win/win.h +++ b/ompi/win/win.h @@ -164,6 +164,12 @@ static inline bool ompi_win_access_epoch(ompi_win_t *win) { return (OMPI_WIN_ACCESS_EPOCH & mode); } +/* already in an exposure epoch */ +static inline bool ompi_win_exposure_epoch(ompi_win_t *win) { + int16_t mode = ompi_win_get_mode(win); + return (OMPI_WIN_EXPOSE_EPOCH & mode); +} + /* we're either already in an access epoch or can easily start one (stupid fence rule). Either way, it's ok to be the origin of a communication call. */