diff --git a/src/mca/mpool/sm/mpool_sm_component.c b/src/mca/mpool/sm/mpool_sm_component.c index 0dc28ec385..7c204a1c2e 100644 --- a/src/mca/mpool/sm/mpool_sm_component.c +++ b/src/mca/mpool/sm/mpool_sm_component.c @@ -74,6 +74,7 @@ static int mca_mpool_sm_param_register_int( */ static int mca_mpool_sm_open(void) { + fprintf(stderr, "mca_mpool_sm_open\n"); /* register SM component parameters */ mca_mpool_sm_component.sm_size = mca_mpool_sm_param_register_int("size", 512*1024*1024); diff --git a/src/mca/pml/base/pml_base_recvreq.h b/src/mca/pml/base/pml_base_recvreq.h index 3379f6d386..77103f9a63 100644 --- a/src/mca/pml/base/pml_base_recvreq.h +++ b/src/mca/pml/base/pml_base_recvreq.h @@ -61,6 +61,9 @@ typedef struct mca_pml_base_recv_request_t mca_pml_base_recv_request_t; (request)->req_base.req_mpi_done = false; \ (request)->req_base.req_pml_done = false; \ (request)->req_base.req_free_called = false; \ + \ + /* increment reference count on communicator */ \ + OBJ_RETAIN(comm); \ } #endif diff --git a/src/mca/pml/base/pml_base_sendreq.h b/src/mca/pml/base/pml_base_sendreq.h index df3d095e7c..1a8714290e 100644 --- a/src/mca/pml/base/pml_base_sendreq.h +++ b/src/mca/pml/base/pml_base_sendreq.h @@ -23,7 +23,7 @@ struct mca_pml_base_send_request_t { size_t req_bytes_packed; /**< packed size of a message given the datatype and count */ size_t req_bytes_sent; /**< number of bytes that have been sent */ mca_pml_base_send_mode_t req_send_mode; /**< type of send */ - struct mca_ptl_base_module_t* req_ptl; /**< PTL that is selected for first fragment */ + struct mca_ptl_base_module_t* req_ptl; /**< PTL that is selected for first fragment */ struct mca_ptl_base_peer_t* req_peer; /**< PTL peer instance that will be used for first fragment */ ompi_ptr_t req_peer_match; /**< matched receive at peer */ ompi_ptr_t req_peer_addr; /**< peers remote buffer address */ @@ -58,6 +58,9 @@ typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t; mode, \ persistent) \ { \ + /* increment reference count on communicator */ \ + OBJ_RETAIN(comm); \ + \ OMPI_REQUEST_INIT(&(request)->req_base.req_ompi); \ request->req_offset = 0; \ request->req_bytes_sent = 0; \ diff --git a/src/mca/pml/teg/src/pml_teg_recvreq.c b/src/mca/pml/teg/src/pml_teg_recvreq.c index 9e967fb18f..d514716923 100644 --- a/src/mca/pml/teg/src/pml_teg_recvreq.c +++ b/src/mca/pml/teg/src/pml_teg_recvreq.c @@ -69,8 +69,9 @@ void mca_pml_teg_recv_request_match_specific(mca_pml_base_recv_request_t* reques /* We didn't find any matches. Record this irecv so we can match * it when the message comes in. */ - if(request->req_base.req_type != MCA_PML_REQUEST_IPROBE) + if(request->req_base.req_type != MCA_PML_REQUEST_IPROBE) { ompi_list_append(pml_comm->c_specific_receives+req_peer, (ompi_list_item_t*)request); + } OMPI_THREAD_UNLOCK(&pml_comm->c_matching_lock); } diff --git a/src/mca/pml/teg/src/pml_teg_recvreq.h b/src/mca/pml/teg/src/pml_teg_recvreq.h index d69006ee90..0ffb7514b6 100644 --- a/src/mca/pml/teg/src/pml_teg_recvreq.h +++ b/src/mca/pml/teg/src/pml_teg_recvreq.h @@ -19,11 +19,11 @@ * @param rc (OUT) OMPI_SUCCESS or error status on failure. * @return Receive request. */ -#define MCA_PML_TEG_RECV_REQUEST_ALLOC(recvreq, rc) \ - { \ - ompi_list_item_t* item; \ - OMPI_FREE_LIST_GET(&mca_pml_teg.teg_recv_requests, item, rc); \ - recvreq = (mca_pml_base_recv_request_t*)item; \ +#define MCA_PML_TEG_RECV_REQUEST_ALLOC(recvreq, rc) \ + { \ + ompi_list_item_t* item; \ + OMPI_FREE_LIST_GET(&mca_pml_teg.teg_recv_requests, item, rc); \ + recvreq = (mca_pml_base_recv_request_t*)item; \ } /** @@ -31,9 +31,12 @@ * * @param request (IN) Receive request. */ -#define MCA_PML_TEG_RECV_REQUEST_RETURN(request) \ - OMPI_FREE_LIST_RETURN(&mca_pml_teg.teg_recv_requests, (ompi_list_item_t*)request); - +#define MCA_PML_TEG_RECV_REQUEST_RETURN(request) \ + { \ + OBJ_RELEASE(request->req_base.req_comm); \ + OMPI_FREE_LIST_RETURN(&mca_pml_teg.teg_recv_requests, (ompi_list_item_t*)request); \ + } + /** * Attempt to match the request against the unexpected fragment list * for all source ranks w/in the communicator. diff --git a/src/mca/pml/teg/src/pml_teg_sendreq.h b/src/mca/pml/teg/src/pml_teg_sendreq.h index 05ed6837bf..321e5e08e0 100644 --- a/src/mca/pml/teg/src/pml_teg_sendreq.h +++ b/src/mca/pml/teg/src/pml_teg_sendreq.h @@ -63,6 +63,10 @@ { \ mca_ptl_base_module_t* ptl = sendreq->req_ptl; \ mca_pml_base_ptl_t* ptl_base = ptl->ptl_base; \ + \ + /* Decrement reference count on communicator. */ \ + OBJ_RELEASE(request->req_base.req_comm); \ + \ /* \ * If there is a cache associated with the ptl - first attempt \ * to return the send descriptor to the cache. \ diff --git a/src/mca/ptl/base/ptl_base_recvfrag.h b/src/mca/ptl/base/ptl_base_recvfrag.h index acf6697804..64c2e16899 100644 --- a/src/mca/ptl/base/ptl_base_recvfrag.h +++ b/src/mca/ptl/base/ptl_base_recvfrag.h @@ -41,8 +41,9 @@ static inline bool mca_ptl_base_recv_frag_match( bool matched; ompi_list_t matched_frags; OBJ_CONSTRUCT(&matched_frags, ompi_list_t); - if((matched = mca_ptl_base_match(header, frag, &matched_frags)) == false) + if((matched = mca_ptl_base_match(header, frag, &matched_frags)) == false) { frag = (mca_ptl_base_recv_frag_t*)ompi_list_remove_first(&matched_frags); + } while(NULL != frag) { mca_ptl_base_module_t* ptl = frag->frag_base.frag_owner;