Unified reference count framework. For each request (send and receive) we have to manage the ref count
on communicators and datatypes. Now the management is done on the PML base and the others PML's just have to use the corresponding macros from the base. This commit was SVN r4406.
Этот коммит содержится в:
родитель
db0891ff18
Коммит
874f497b8a
@ -58,6 +58,7 @@ typedef struct mca_pml_base_recv_request_t mca_pml_base_recv_request_t;
|
||||
{ \
|
||||
/* increment reference count on communicator */ \
|
||||
OBJ_RETAIN(comm); \
|
||||
OBJ_RETAIN(datatype); \
|
||||
\
|
||||
OMPI_REQUEST_INIT(&(request)->req_base.req_ompi); \
|
||||
(request)->req_bytes_packed = 0; \
|
||||
@ -74,6 +75,18 @@ typedef struct mca_pml_base_recv_request_t mca_pml_base_recv_request_t;
|
||||
(request)->req_base.req_free_called = false; \
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a receive request. Handle the release of the communicator and the
|
||||
* attached datatype.
|
||||
*
|
||||
* @param request (IN) Receive request.
|
||||
*/
|
||||
#define MCA_PML_BASE_RECV_REQUEST_RETURN( request ) \
|
||||
do { \
|
||||
OBJ_RELEASE( (request)->req_base.req_comm); \
|
||||
OBJ_RELEASE( (request)->req_base.req_datatype ); \
|
||||
} while (0)
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
@ -65,7 +65,7 @@ typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t;
|
||||
* @param mode (IN) Send mode (STANDARD,BUFFERED,SYNCHRONOUS,READY)
|
||||
* @param persistent (IN) Is request persistent.
|
||||
*
|
||||
* Performa any one-time initialization. Note that per-use initialization
|
||||
* Perform a any one-time initialization. Note that per-use initialization
|
||||
* is done in the send request start routine.
|
||||
*/
|
||||
|
||||
@ -81,6 +81,7 @@ typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t;
|
||||
{ \
|
||||
/* increment reference count on communicator */ \
|
||||
OBJ_RETAIN(comm); \
|
||||
OBJ_RETAIN(datatype); \
|
||||
\
|
||||
OMPI_REQUEST_INIT(&(request)->req_base.req_ompi); \
|
||||
request->req_addr = addr; \
|
||||
@ -120,6 +121,17 @@ typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t;
|
||||
} \
|
||||
}
|
||||
|
||||
/**
|
||||
* Release the ref counts on the communicator and datatype.
|
||||
*
|
||||
* @param request (IN) The send request.
|
||||
*/
|
||||
|
||||
#define MCA_PML_BASE_SEND_REQUEST_RETURN( request ) \
|
||||
do { \
|
||||
OBJ_RELEASE(request->req_base.req_comm); \
|
||||
OBJ_RELEASE(request->req_base.req_datatype); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Test to check if an acknowledgment has been received, with the match.
|
||||
|
@ -36,23 +36,23 @@ OBJ_CLASS_DECLARATION(mca_pml_teg_recv_request_t);
|
||||
* @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) \
|
||||
do { \
|
||||
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; \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* Return a recv request to the modules free list.
|
||||
*
|
||||
* @param request (IN) Receive 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); \
|
||||
}
|
||||
#define MCA_PML_TEG_RECV_REQUEST_RETURN(request) \
|
||||
do { \
|
||||
MCA_PML_BASE_RECV_REQUEST_RETURN( request ); \
|
||||
OMPI_FREE_LIST_RETURN(&mca_pml_teg.teg_recv_requests, (ompi_list_item_t*)request); \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* Attempt to match the request against the unexpected fragment list
|
||||
|
@ -98,8 +98,8 @@ OBJ_CLASS_DECLARATION(mca_pml_teg_send_request_t);
|
||||
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((sendreq)->req_base.req_comm); \
|
||||
/* Let the base handle the reference counts */ \
|
||||
MCA_PML_BASE_SEND_REQUEST_RETURN(sendreq); \
|
||||
\
|
||||
/* \
|
||||
* If there is a cache associated with the ptl - first attempt \
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user