From f35a06119c0238622bc4840e3b64c6e6790546db Mon Sep 17 00:00:00 2001 From: Shiqing Fan Date: Mon, 5 May 2008 13:57:27 +0000 Subject: [PATCH] Use memchecker_convertor_call function instead the old one. Move the function to the place that we can use convertor. This commit was SVN r18370. --- ompi/mca/osc/pt2pt/osc_pt2pt_comm.c | 13 +++++++++++++ ompi/mca/osc/rdma/osc_rdma_comm.c | 13 +++++++++++++ ompi/mca/pml/ob1/pml_ob1_irecv.c | 10 +++++++++- ompi/mca/pml/ob1/pml_ob1_isend.c | 9 +++++++++ ompi/mpi/c/accumulate.c | 5 ----- ompi/mpi/c/get.c | 6 ------ ompi/mpi/c/irecv.c | 1 - ompi/mpi/c/irsend.c | 2 +- ompi/mpi/c/isend.c | 2 +- ompi/mpi/c/issend.c | 2 +- ompi/mpi/c/put.c | 7 ------- ompi/mpi/c/win_fence.c | 6 ------ 12 files changed, 47 insertions(+), 29 deletions(-) diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c b/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c index f85b882dfd..abf28d6264 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c @@ -23,6 +23,7 @@ #include "osc_pt2pt_sendreq.h" #include "osc_pt2pt_header.h" #include "osc_pt2pt_data_move.h" +#include "ompi/memchecker.h" static int enqueue_sendreq(ompi_osc_pt2pt_module_t *module, @@ -76,6 +77,10 @@ ompi_osc_pt2pt_module_accumulate(void *origin_addr, int origin_count, target_dt, P2P_MODULE(win), &sendreq); + MEMCHECKER( + memchecker_convertor_call(&opal_memchecker_base_mem_noaccess, + &sendreq->req_origin_convertor); + ); if (OMPI_SUCCESS != ret) return ret; sendreq->req_op_id = op->o_f_to_c_index; @@ -127,6 +132,10 @@ ompi_osc_pt2pt_module_get(void *origin_addr, target_dt, P2P_MODULE(win), &sendreq); + MEMCHECKER( + memchecker_convertor_call(&opal_memchecker_base_mem_noaccess, + &sendreq->req_origin_convertor); + ); if (OMPI_SUCCESS != ret) return ret; /* enqueue sendreq */ @@ -172,6 +181,10 @@ ompi_osc_pt2pt_module_put(void *origin_addr, int origin_count, target_dt, P2P_MODULE(win), &sendreq); + MEMCHECKER( + memchecker_convertor_call(&opal_memchecker_base_mem_noaccess, + &sendreq->req_origin_convertor); + ); if (OMPI_SUCCESS != ret) return ret; /* enqueue sendreq */ diff --git a/ompi/mca/osc/rdma/osc_rdma_comm.c b/ompi/mca/osc/rdma/osc_rdma_comm.c index 3cda484f00..9a34a793d3 100644 --- a/ompi/mca/osc/rdma/osc_rdma_comm.c +++ b/ompi/mca/osc/rdma/osc_rdma_comm.c @@ -25,6 +25,7 @@ #include "osc_rdma_sendreq.h" #include "osc_rdma_header.h" #include "osc_rdma_data_move.h" +#include "ompi/memchecker.h" static int enqueue_sendreq(ompi_osc_rdma_module_t *module, @@ -78,6 +79,10 @@ ompi_osc_rdma_module_accumulate(void *origin_addr, int origin_count, target_dt, module, &sendreq); + MEMCHECKER( + memchecker_convertor_call(&opal_memchecker_base_mem_noaccess, + &sendreq->req_origin_convertor); + ); if (OMPI_SUCCESS != ret) return ret; sendreq->req_op_id = op->o_f_to_c_index; @@ -148,6 +153,10 @@ ompi_osc_rdma_module_get(void *origin_addr, target_dt, module, &sendreq); + MEMCHECKER( + memchecker_convertor_call(&opal_memchecker_base_mem_noaccess, + &sendreq->req_origin_convertor); + ); if (OMPI_SUCCESS != ret) return ret; if (module->m_eager_send_active) { @@ -212,6 +221,10 @@ ompi_osc_rdma_module_put(void *origin_addr, int origin_count, target_dt, module, &sendreq); + MEMCHECKER( + memchecker_convertor_call(&opal_memchecker_base_mem_noaccess, + &sendreq->req_origin_convertor); + ); if (OMPI_SUCCESS != ret) return ret; if (module->m_eager_send_active) { diff --git a/ompi/mca/pml/ob1/pml_ob1_irecv.c b/ompi/mca/pml/ob1/pml_ob1_irecv.c index a8d95bdaa0..3010729fc0 100644 --- a/ompi/mca/pml/ob1/pml_ob1_irecv.c +++ b/ompi/mca/pml/ob1/pml_ob1_irecv.c @@ -22,6 +22,7 @@ #include "ompi/request/request.h" #include "pml_ob1_recvreq.h" #include "ompi/peruse/peruse-internal.h" +#include "ompi/memchecker.h" int mca_pml_ob1_irecv_init(void *addr, size_t count, @@ -40,7 +41,14 @@ int mca_pml_ob1_irecv_init(void *addr, MCA_PML_OB1_RECV_REQUEST_INIT(recvreq, addr, count, datatype, src, tag, comm, true); - + /* + * Receive request is initialized, let's start memory checking. + */ + MEMCHECKER ( + memchecker_convertor_call(&opal_memchecker_base_mem_noaccess, + &recvreq->req_recv.req_base.req_convertor); + ); + PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_ACTIVATE, &((recvreq)->req_recv.req_base), PERUSE_RECV); diff --git a/ompi/mca/pml/ob1/pml_ob1_isend.c b/ompi/mca/pml/ob1/pml_ob1_isend.c index 0fbf7f6d02..93b5384585 100644 --- a/ompi/mca/pml/ob1/pml_ob1_isend.c +++ b/ompi/mca/pml/ob1/pml_ob1_isend.c @@ -24,6 +24,7 @@ #include "pml_ob1_sendreq.h" #include "pml_ob1_recvreq.h" #include "ompi/peruse/peruse-internal.h" +#include "ompi/memchecker.h" int mca_pml_ob1_isend_init(void *buf, size_t count, @@ -48,6 +49,14 @@ int mca_pml_ob1_isend_init(void *buf, dst, tag, comm, sendmode, true); + /* + * Send request is initialized, let's start memory checking. + */ + MEMCHECKER ( + memchecker_convertor_call(&opal_memchecker_base_mem_noaccess, + &sendreq->req_send.req_base.req_convertor); + ); + PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_ACTIVATE, &(sendreq)->req_send.req_base, PERUSE_SEND); diff --git a/ompi/mpi/c/accumulate.c b/ompi/mpi/c/accumulate.c index a720356032..c13f53e8d5 100644 --- a/ompi/mpi/c/accumulate.c +++ b/ompi/mpi/c/accumulate.c @@ -221,11 +221,6 @@ int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_data return MPI_SUCCESS; } - /* Set buffer to be unaccessable before sending it. - * It's set accessable again in file osc_pt2pt_data_move. */ - MEMCHECKER ( - memchecker_call(&opal_memchecker_base_mem_noaccess, origin_addr, origin_count, origin_datatype); - ); OPAL_CR_ENTER_LIBRARY(); rc = ompi_win->w_osc_module->osc_accumulate(origin_addr, diff --git a/ompi/mpi/c/get.c b/ompi/mpi/c/get.c index 94ef090690..7da8873c5a 100644 --- a/ompi/mpi/c/get.c +++ b/ompi/mpi/c/get.c @@ -22,7 +22,6 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" #include "ompi/datatype/datatype.h" -#include "ompi/memchecker.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Get = PMPI_Get @@ -69,11 +68,6 @@ int MPI_Get(void *origin_addr, int origin_count, if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS; - /* Set buffer to be unaccessable before using it. - * It's set accessable again in file osc_pt2pt_data_move. */ - MEMCHECKER ( - memchecker_call(&opal_memchecker_base_mem_noaccess, origin_addr, origin_count, origin_datatype); - ); OPAL_CR_ENTER_LIBRARY(); rc = win->w_osc_module->osc_get(origin_addr, origin_count, origin_datatype, diff --git a/ompi/mpi/c/irecv.c b/ompi/mpi/c/irecv.c index fb95ba82bb..fecbe0081c 100644 --- a/ompi/mpi/c/irecv.c +++ b/ompi/mpi/c/irecv.c @@ -68,7 +68,6 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype type, int source, return MPI_SUCCESS; } - MEMCHECKER (memchecker_call(&opal_memchecker_base_mem_noaccess, buf, count, type)); OPAL_CR_ENTER_LIBRARY(); rc = MCA_PML_CALL(irecv(buf,count,type,source,tag,comm,request)); diff --git a/ompi/mpi/c/irsend.c b/ompi/mpi/c/irsend.c index c4b3e0630f..24ab79118a 100644 --- a/ompi/mpi/c/irsend.c +++ b/ompi/mpi/c/irsend.c @@ -72,7 +72,6 @@ int MPI_Irsend(void *buf, int count, MPI_Datatype type, int dest, return MPI_SUCCESS; } - MEMCHECKER (memchecker_call(&opal_memchecker_base_mem_noaccess, buf, count, type)); OPAL_CR_ENTER_LIBRARY(); rc = MCA_PML_CALL(isend(buf,count,type,dest,tag, @@ -80,3 +79,4 @@ int MPI_Irsend(void *buf, int count, MPI_Datatype type, int dest, OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } + diff --git a/ompi/mpi/c/isend.c b/ompi/mpi/c/isend.c index 3bf4dd9ef3..6fce52ee14 100644 --- a/ompi/mpi/c/isend.c +++ b/ompi/mpi/c/isend.c @@ -73,10 +73,10 @@ int MPI_Isend(void *buf, int count, MPI_Datatype type, int dest, return MPI_SUCCESS; } - MEMCHECKER (memchecker_call(&opal_memchecker_base_mem_noaccess, buf, count, type)); OPAL_CR_ENTER_LIBRARY(); rc = MCA_PML_CALL(isend(buf,count,type,dest,tag,MCA_PML_BASE_SEND_STANDARD,comm,request)); OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } + diff --git a/ompi/mpi/c/issend.c b/ompi/mpi/c/issend.c index 966f25f96b..840220092a 100644 --- a/ompi/mpi/c/issend.c +++ b/ompi/mpi/c/issend.c @@ -70,7 +70,6 @@ int MPI_Issend(void *buf, int count, MPI_Datatype type, int dest, return MPI_SUCCESS; } - MEMCHECKER (memchecker_call(&opal_memchecker_base_mem_noaccess, buf, count, type)); OPAL_CR_ENTER_LIBRARY(); rc = MCA_PML_CALL(isend(buf,count,type,dest,tag, @@ -78,3 +77,4 @@ int MPI_Issend(void *buf, int count, MPI_Datatype type, int dest, OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } + diff --git a/ompi/mpi/c/put.c b/ompi/mpi/c/put.c index 75e978e299..c9a0b3b19a 100644 --- a/ompi/mpi/c/put.c +++ b/ompi/mpi/c/put.c @@ -23,7 +23,6 @@ #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" #include "ompi/datatype/datatype.h" -#include "ompi/memchecker.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Put = PMPI_Put @@ -71,12 +70,6 @@ int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, } if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS; - - /* Set buffer to be unaccessable before using it. - * It's set accessable again in file osc_pt2pt_data_move. */ - MEMCHECKER ( - memchecker_call(&opal_memchecker_base_mem_noaccess, origin_addr, origin_count, origin_datatype); - ); OPAL_CR_ENTER_LIBRARY(); diff --git a/ompi/mpi/c/win_fence.c b/ompi/mpi/c/win_fence.c index a3372836e3..7962012d9d 100644 --- a/ompi/mpi/c/win_fence.c +++ b/ompi/mpi/c/win_fence.c @@ -21,7 +21,6 @@ #include "ompi/mpi/c/bindings.h" #include "ompi/win/win.h" #include "ompi/mca/osc/osc.h" -#include "ompi/memchecker.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_fence = PMPI_Win_fence @@ -52,11 +51,6 @@ int MPI_Win_fence(int assert, MPI_Win win) return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RMA_SYNC, FUNC_NAME); } } - MEMCHECKER ( - /* First, we have to make sure it's a valid and initialised win. */ - if( win->w_baseptr != NULL && win->w_size != 0 && win->w_mode != 0) - opal_memchecker_base_mem_noaccess( win->w_baseptr, win->w_size ); - ); OPAL_CR_ENTER_LIBRARY();