1
1

Move things around a little bit. Mainly fields from the send and receive

request in the base request. Rearrange the fields to keep the data
together. Remove some useless tests.

This commit was SVN r12482.
Этот коммит содержится в:
George Bosilca 2006-11-08 04:58:23 +00:00
родитель 63462331c9
Коммит eb45a5e402
9 изменённых файлов: 138 добавлений и 172 удалений

Просмотреть файл

@ -31,7 +31,7 @@ mca_pml_cm_cancel(struct ompi_request_t *ompi_req, int flag)
{
mca_pml_cm_hvy_send_request_t *request =
(mca_pml_cm_hvy_send_request_t*) base_request;
mtl_req = &request->req_mtl;
mtl_req = &request->req_send.req_base.req_mtl;
}
break;
@ -39,7 +39,7 @@ mca_pml_cm_cancel(struct ompi_request_t *ompi_req, int flag)
{
mca_pml_cm_thin_send_request_t *request =
(mca_pml_cm_thin_send_request_t*) base_request;
mtl_req = &request->req_mtl;
mtl_req = &request->req_send.req_base.req_mtl;
}
break;
@ -47,7 +47,7 @@ mca_pml_cm_cancel(struct ompi_request_t *ompi_req, int flag)
{
mca_pml_cm_hvy_recv_request_t *request =
(mca_pml_cm_hvy_recv_request_t*) base_request;
mtl_req = &request->req_mtl;
mtl_req = &request->req_base.req_mtl;
}
break;
@ -55,7 +55,7 @@ mca_pml_cm_cancel(struct ompi_request_t *ompi_req, int flag)
{
mca_pml_cm_thin_recv_request_t *request =
(mca_pml_cm_thin_recv_request_t*) base_request;
mtl_req = &request->req_mtl;
mtl_req = &request->req_base.req_mtl;
}
break;

Просмотреть файл

@ -11,6 +11,8 @@
#include "ompi_config.h"
#include "opal/prefetch.h"
#include "ompi/request/request.h"
#include "ompi/datatype/datatype.h"
#include "ompi/communicator/communicator.h"
@ -33,7 +35,7 @@ mca_pml_cm_irecv_init(void *addr,
ompi_proc_t* ompi_proc;
MCA_PML_CM_HVY_RECV_REQUEST_ALLOC(recvreq, ret);
if (NULL == recvreq || OMPI_SUCCESS != ret) return ret;
if( OPAL_UNLIKELY(OMPI_SUCCESS != ret) ) return ret;
MCA_PML_CM_HVY_RECV_REQUEST_INIT(recvreq, ompi_proc, comm, tag, src,
datatype, addr, count, true);
@ -58,7 +60,7 @@ mca_pml_cm_irecv(void *addr,
ompi_proc_t* ompi_proc;
MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq, ret);
if (NULL == recvreq || OMPI_SUCCESS != ret) return ret;
if( OPAL_UNLIKELY(OMPI_SUCCESS != ret) ) return ret;
MCA_PML_CM_THIN_RECV_REQUEST_INIT(recvreq,
ompi_proc,
@ -71,7 +73,7 @@ mca_pml_cm_irecv(void *addr,
MCA_PML_CM_THIN_RECV_REQUEST_START(recvreq, comm, tag, src, ret);
if (OMPI_SUCCESS == ret) *request = (ompi_request_t*) recvreq;
if( OPAL_LIKELY(OMPI_SUCCESS == ret) ) *request = (ompi_request_t*) recvreq;
return ret;
}
@ -91,7 +93,7 @@ mca_pml_cm_recv(void *addr,
ompi_proc_t* ompi_proc;
MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq, ret);
if (NULL == recvreq || OMPI_SUCCESS != ret) return ret;
if( OPAL_LIKELY(OMPI_SUCCESS != ret) ) return ret;
MCA_PML_CM_THIN_RECV_REQUEST_INIT(recvreq,
ompi_proc,
@ -104,9 +106,10 @@ mca_pml_cm_recv(void *addr,
MCA_PML_CM_THIN_RECV_REQUEST_START(recvreq, comm, tag, src, ret);
if (OMPI_SUCCESS != ret) {
if( OPAL_LIKELY(OMPI_SUCCESS != ret) ) {
/* BWB - XXX - need cleanup of request here */
MCA_PML_CM_THIN_RECV_REQUEST_RETURN(recvreq);
return ret;
}
if (recvreq->req_base.req_ompi.req_complete == false) {

Просмотреть файл

@ -64,8 +64,8 @@ mca_pml_cm_hvy_recv_request_free(struct ompi_request_t** request)
static void
mca_pml_cm_thin_recv_request_construct(mca_pml_cm_thin_recv_request_t* recvreq)
{
recvreq->req_mtl.ompi_req = (ompi_request_t*) recvreq;
recvreq->req_mtl.completion_callback = mca_pml_cm_thin_recv_request_completion;
recvreq->req_base.req_mtl.ompi_req = (ompi_request_t*) recvreq;
recvreq->req_base.req_mtl.completion_callback = mca_pml_cm_thin_recv_request_completion;
recvreq->req_base.req_ompi.req_free = mca_pml_cm_thin_recv_request_free;
recvreq->req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
@ -76,8 +76,8 @@ mca_pml_cm_thin_recv_request_construct(mca_pml_cm_thin_recv_request_t* recvreq)
static void
mca_pml_cm_hvy_recv_request_construct(mca_pml_cm_hvy_recv_request_t* recvreq)
{
recvreq->req_mtl.ompi_req = (ompi_request_t*) recvreq;
recvreq->req_mtl.completion_callback = mca_pml_cm_hvy_recv_request_completion;
recvreq->req_base.req_mtl.ompi_req = (ompi_request_t*) recvreq;
recvreq->req_base.req_mtl.completion_callback = mca_pml_cm_hvy_recv_request_completion;
recvreq->req_base.req_ompi.req_free = mca_pml_cm_hvy_recv_request_free;
recvreq->req_base.req_ompi.req_cancel = mca_pml_cm_cancel;

Просмотреть файл

@ -25,9 +25,6 @@
struct mca_pml_cm_thin_recv_request_t {
mca_pml_cm_request_t req_base;
struct ompi_communicator_t *req_comm; /**< communicator pointer */
struct ompi_datatype_t *req_datatype; /**< pointer to data type */
mca_mtl_request_t req_mtl; /**< the mtl specific memory */
};
typedef struct mca_pml_cm_thin_recv_request_t mca_pml_cm_thin_recv_request_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_thin_recv_request_t);
@ -38,12 +35,9 @@ struct mca_pml_cm_hvy_recv_request_t {
size_t req_count; /**< count of user datatype elements */
int32_t req_peer; /**< peer process - rank w/in this communicator */
int32_t req_tag; /**< user defined tag */
struct ompi_communicator_t *req_comm; /**< communicator pointer */
struct ompi_datatype_t *req_datatype; /**< pointer to data type */
void *req_buff; /**< pointer to send buffer - may not be application buffer */
size_t req_bytes_packed; /**< packed size of a message given the datatype and count */
void *req_buff; /**< pointer to send buffer - may not be application buffer */
size_t req_bytes_packed; /**< packed size of a message given the datatype and count */
bool req_blocking;
mca_mtl_request_t req_mtl; /**< the mtl specific memory */
};
typedef struct mca_pml_cm_hvy_recv_request_t mca_pml_cm_hvy_recv_request_t;
@ -95,8 +89,8 @@ do { \
(request)->req_base.req_ompi.req_mpi_object.comm = comm; \
(request)->req_base.req_pml_complete = false; \
(request)->req_base.req_free_called = false; \
request->req_comm = comm; \
request->req_datatype = datatype; \
request->req_base.req_comm = comm; \
request->req_base.req_datatype = datatype; \
OBJ_RETAIN(comm); \
OBJ_RETAIN(datatype); \
\
@ -128,10 +122,10 @@ do { \
(request)->req_base.req_ompi.req_mpi_object.comm = comm; \
(request)->req_base.req_pml_complete = OPAL_INT_TO_BOOL(persistent); \
(request)->req_base.req_free_called = false; \
request->req_comm = comm; \
request->req_base.req_comm = comm; \
request->req_base.req_datatype = datatype; \
request->req_tag = tag; \
request->req_peer = src; \
request->req_datatype = datatype; \
request->req_addr = addr; \
request->req_count = count; \
OBJ_RETAIN(comm); \
@ -177,7 +171,7 @@ do { \
src, \
tag, \
&recvreq->req_base.req_convertor, \
&recvreq->req_mtl)); \
&recvreq->req_base.req_mtl)); \
} while (0)
@ -197,11 +191,11 @@ do { \
request->req_base.req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; \
request->req_base.req_ompi.req_status._cancelled = 0; \
ret = OMPI_MTL_CALL(irecv(ompi_mtl, \
request->req_comm, \
request->req_base.req_comm, \
request->req_peer, \
request->req_tag, \
&recvreq->req_base.req_convertor, \
&recvreq->req_mtl)); \
&recvreq->req_base.req_mtl)); \
} while (0)
@ -271,8 +265,8 @@ do { \
*/
#define MCA_PML_CM_HVY_RECV_REQUEST_RETURN(recvreq) \
{ \
OBJ_RELEASE((recvreq)->req_comm); \
OBJ_RELEASE((recvreq)->req_datatype); \
OBJ_RELEASE((recvreq)->req_base.req_comm); \
OBJ_RELEASE((recvreq)->req_base.req_datatype); \
OMPI_REQUEST_FINI(&(recvreq)->req_base.req_ompi); \
ompi_convertor_cleanup( &((recvreq)->req_base.req_convertor) ); \
OMPI_FREE_LIST_RETURN( &ompi_pml_cm.cm_hvy_recv_requests, \
@ -284,8 +278,8 @@ do { \
*/
#define MCA_PML_CM_THIN_RECV_REQUEST_RETURN(recvreq) \
{ \
OBJ_RELEASE((recvreq)->req_comm); \
OBJ_RELEASE((recvreq)->req_datatype); \
OBJ_RELEASE((recvreq)->req_base.req_comm); \
OBJ_RELEASE((recvreq)->req_base.req_datatype); \
OMPI_REQUEST_FINI(&(recvreq)->req_base.req_ompi); \
ompi_convertor_cleanup( &((recvreq)->req_base.req_convertor) ); \
OMPI_FREE_LIST_RETURN( &ompi_pml_cm.cm_thin_recv_requests, \

Просмотреть файл

@ -35,9 +35,6 @@ typedef enum {
MCA_PML_CM_REQUEST_NULL
} mca_pml_cm_request_type_t;
/**
* Base type for PML CM P2P requests
*/
@ -46,6 +43,9 @@ struct mca_pml_cm_request_t {
volatile bool req_pml_complete; /**< flag indicating if the pt-2-pt layer is done with this request */
volatile bool req_free_called; /**< flag indicating if the user has freed this request */
mca_pml_cm_request_type_t req_pml_type;
struct ompi_communicator_t *req_comm; /**< communicator pointer */
struct ompi_datatype_t *req_datatype; /**< pointer to data type */
mca_mtl_request_t req_mtl; /**< the mtl specific memory */
ompi_convertor_t req_convertor; /**< always need the convertor */
};
typedef struct mca_pml_cm_request_t mca_pml_cm_request_t;

Просмотреть файл

@ -10,6 +10,8 @@
#include "ompi_config.h"
#include "opal/prefetch.h"
#include "ompi/datatype/datatype.h"
#include "ompi/communicator/communicator.h"
#include "ompi/datatype/convertor.h"
@ -32,7 +34,7 @@ mca_pml_cm_isend_init(void* buf,
ompi_proc_t* ompi_proc;
MCA_PML_CM_HVY_SEND_REQUEST_ALLOC(sendreq, comm, dst, ompi_proc, ret);
if (NULL == sendreq || OMPI_SUCCESS != ret) return ret;
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) return ret;
MCA_PML_CM_HVY_SEND_REQUEST_INIT(sendreq, ompi_proc, comm, tag, dst,
datatype, sendmode, true, false, buf, count);
@ -60,7 +62,7 @@ mca_pml_cm_isend(void* buf,
ompi_proc_t* ompi_proc;
MCA_PML_CM_HVY_SEND_REQUEST_ALLOC(sendreq, comm, dst, ompi_proc, ret);
if (NULL == sendreq || OMPI_SUCCESS != ret) return ret;
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) return ret;
MCA_PML_CM_HVY_SEND_REQUEST_INIT(sendreq,
ompi_proc,
@ -76,14 +78,13 @@ mca_pml_cm_isend(void* buf,
MCA_PML_CM_HVY_SEND_REQUEST_START( sendreq, ret);
if (OMPI_SUCCESS == ret) *request = (ompi_request_t*) sendreq;
if (OPAL_LIKELY(OMPI_SUCCESS == ret)) *request = (ompi_request_t*) sendreq;
} else {
mca_pml_cm_thin_send_request_t* sendreq;
ompi_proc_t* ompi_proc;
MCA_PML_CM_THIN_SEND_REQUEST_ALLOC(sendreq, comm, dst, ompi_proc, ret);
if (NULL == sendreq || OMPI_SUCCESS != ret) return ret;
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) return ret;
MCA_PML_CM_THIN_SEND_REQUEST_INIT(sendreq,
ompi_proc,
@ -104,7 +105,7 @@ mca_pml_cm_isend(void* buf,
false,
ret);
if (OMPI_SUCCESS == ret) *request = (ompi_request_t*) sendreq;
if (OPAL_LIKELY(OMPI_SUCCESS == ret)) *request = (ompi_request_t*) sendreq;
}
@ -127,7 +128,7 @@ mca_pml_cm_send(void *buf,
mca_pml_cm_hvy_send_request_t *sendreq;
ompi_proc_t * ompi_proc;
MCA_PML_CM_HVY_SEND_REQUEST_ALLOC(sendreq, comm, dst, ompi_proc, ret);
if (NULL == sendreq || OMPI_SUCCESS != ret) return ret;
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) return ret;
MCA_PML_CM_HVY_SEND_REQUEST_INIT(sendreq,
ompi_proc,
@ -141,7 +142,7 @@ mca_pml_cm_send(void *buf,
buf,
count);
MCA_PML_CM_HVY_SEND_REQUEST_START(sendreq, ret);
if (OMPI_SUCCESS != ret) {
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
MCA_PML_CM_HVY_SEND_REQUEST_RETURN(sendreq);
return ret;
}
@ -151,7 +152,7 @@ mca_pml_cm_send(void *buf,
mca_pml_cm_thin_send_request_t *sendreq;
ompi_proc_t * ompi_proc;
MCA_PML_CM_THIN_SEND_REQUEST_ALLOC(sendreq, comm, dst, ompi_proc, ret);
if (NULL == sendreq || OMPI_SUCCESS != ret) return ret;
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) return ret;
MCA_PML_CM_THIN_SEND_REQUEST_INIT(sendreq,
ompi_proc,
@ -170,7 +171,7 @@ mca_pml_cm_send(void *buf,
sendmode,
false,
ret);
if (OMPI_SUCCESS != ret) {
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
MCA_PML_CM_THIN_SEND_REQUEST_RETURN(sendreq);
return ret;
}
@ -191,12 +192,10 @@ mca_pml_cm_send(void *buf,
ompi_request_waiting--;
}
}
ompi_request_free( (ompi_request_t**)&sendreq );
} else {
MCA_PML_CM_SEND_REQUEST_START_SETUP((&sendreq->req_send));
if (OMPI_SUCCESS != ret) {
MCA_PML_CM_THIN_SEND_REQUEST_RETURN(sendreq);
return ret;
}
ret = OMPI_MTL_CALL(send(ompi_mtl,
comm,
@ -204,10 +203,10 @@ mca_pml_cm_send(void *buf,
tag,
&sendreq->req_send.req_base.req_convertor,
sendmode));
/* Allow a quick path for the request return */
sendreq->req_send.req_base.req_free_called = true;
MCA_PML_CM_THIN_SEND_REQUEST_PML_COMPLETE(sendreq);
}
ompi_request_free( (ompi_request_t**)&sendreq );
}
return ret;

Просмотреть файл

@ -48,8 +48,8 @@ OBJ_CLASS_INSTANCE(mca_pml_cm_hvy_send_request_t,
static void mca_pml_cm_thin_send_request_construct(mca_pml_cm_thin_send_request_t* sendreq)
{
/* no need to reinit for every send -- never changes */
sendreq->req_mtl.ompi_req = (ompi_request_t*) sendreq;
sendreq->req_mtl.completion_callback = mca_pml_cm_thin_send_request_completion;
sendreq->req_send.req_base.req_mtl.ompi_req = (ompi_request_t*) sendreq;
sendreq->req_send.req_base.req_mtl.completion_callback = mca_pml_cm_thin_send_request_completion;
sendreq->req_send.req_base.req_ompi.req_free = mca_pml_cm_thin_send_request_free;
sendreq->req_send.req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_THIN;
@ -59,8 +59,8 @@ static void mca_pml_cm_thin_send_request_construct(mca_pml_cm_thin_send_request_
static void mca_pml_cm_hvy_send_request_construct(mca_pml_cm_hvy_send_request_t* sendreq)
{
/* no need to reinit for every send -- never changes */
sendreq->req_mtl.ompi_req = (ompi_request_t*) sendreq;
sendreq->req_mtl.completion_callback = mca_pml_cm_hvy_send_request_completion;
sendreq->req_send.req_base.req_mtl.ompi_req = (ompi_request_t*) sendreq;
sendreq->req_send.req_base.req_mtl.completion_callback = mca_pml_cm_hvy_send_request_completion;
sendreq->req_send.req_base.req_ompi.req_free = mca_pml_cm_hvy_send_request_free;
sendreq->req_send.req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_HEAVY;

Просмотреть файл

@ -28,8 +28,6 @@
struct mca_pml_cm_send_request_t {
mca_pml_cm_request_t req_base;
mca_pml_base_send_mode_t req_send_mode;
struct ompi_communicator_t *req_comm; /**< communicator pointer */
struct ompi_datatype_t *req_datatype; /**< pointer to data type */
};
typedef struct mca_pml_cm_send_request_t mca_pml_cm_send_request_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_send_request_t);
@ -37,8 +35,6 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_send_request_t);
struct mca_pml_cm_thin_send_request_t {
mca_pml_cm_send_request_t req_send;
mca_mtl_request_t req_mtl; /**< the mtl specific memory */
};
typedef struct mca_pml_cm_thin_send_request_t mca_pml_cm_thin_send_request_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_thin_send_request_t);
@ -52,7 +48,6 @@ struct mca_pml_cm_hvy_send_request_t {
int32_t req_tag; /**< user defined tag */
void *req_buff; /**< pointer to send buffer - may not be application buffer */
bool req_blocking;
mca_mtl_request_t req_mtl; /**< the mtl specific memory */
};
typedef struct mca_pml_cm_hvy_send_request_t mca_pml_cm_hvy_send_request_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
@ -60,8 +55,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
#define MCA_PML_CM_THIN_SEND_REQUEST_ALLOC(sendreq, comm, dst, \
ompi_proc, rc) \
{ \
do{ \
do { \
ompi_free_list_item_t* item; \
ompi_proc = ompi_comm_peer_lookup( comm, dst ); \
\
@ -70,12 +64,11 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
sendreq = NULL; \
} else { \
rc = OMPI_SUCCESS; \
OMPI_FREE_LIST_WAIT(&ompi_pml_cm.cm_thin_send_requests, \
item, rc); \
sendreq = (mca_pml_cm_thin_send_request_t*)item; \
OMPI_FREE_LIST_WAIT(&ompi_pml_cm.cm_thin_send_requests, \
item, rc); \
sendreq = (mca_pml_cm_thin_send_request_t*)item; \
} \
}while(0); \
}
} while(0)
#define MCA_PML_CM_HVY_SEND_REQUEST_ALLOC(sendreq, comm, dst, \
@ -106,22 +99,22 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
{ \
OBJ_RETAIN(comm); \
OBJ_RETAIN(datatype); \
req_send->req_comm = comm; \
req_send->req_datatype = datatype; \
(req_send)->req_base.req_comm = comm; \
(req_send)->req_base.req_datatype = datatype; \
ompi_convertor_copy_and_prepare_for_send( \
ompi_proc->proc_convertor, \
datatype, \
count, \
buf, \
0, \
&req_send->req_base.req_convertor ); \
req_send->req_base.req_ompi.req_mpi_object.comm = comm; \
req_send->req_base.req_ompi.req_status.MPI_SOURCE = \
&(req_send)->req_base.req_convertor ); \
(req_send)->req_base.req_ompi.req_mpi_object.comm = comm; \
(req_send)->req_base.req_ompi.req_status.MPI_SOURCE = \
comm->c_my_rank; \
req_send->req_base.req_ompi.req_status.MPI_TAG = tag; \
req_send->req_base.req_ompi.req_status._count = count; \
req_send->req_send_mode = sendmode; \
req_send->req_base.req_free_called = false; \
(req_send)->req_base.req_ompi.req_status.MPI_TAG = tag; \
(req_send)->req_base.req_ompi.req_status._count = count; \
(req_send)->req_send_mode = sendmode; \
(req_send)->req_base.req_free_called = false; \
}
#define MCA_PML_CM_HVY_SEND_REQUEST_INIT( sendreq, \
@ -135,7 +128,6 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
blocking, \
buf, \
count) \
{ \
do { \
OMPI_REQUEST_INIT(&(sendreq->req_send.req_base.req_ompi), \
persistent); \
@ -143,26 +135,22 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
sendreq->req_peer = dst; \
sendreq->req_addr = buf; \
sendreq->req_count = count; \
MCA_PML_CM_SEND_REQUEST_INIT_COMMON( \
(&sendreq->req_send), \
ompi_proc, \
comm, \
tag, \
datatype, \
sendmode, \
buf, \
count); \
MCA_PML_CM_SEND_REQUEST_INIT_COMMON( (&sendreq->req_send), \
ompi_proc, \
comm, \
tag, \
datatype, \
sendmode, \
buf, \
count); \
ompi_convertor_get_packed_size( \
&sendreq->req_send.req_base.req_convertor, \
&sendreq->req_count ); \
\
&sendreq->req_count ); \
\
sendreq->req_blocking = blocking; \
sendreq->req_send.req_base.req_pml_complete = \
(persistent ? true:false); \
}while(0); \
}
} while(0)
#define MCA_PML_CM_THIN_SEND_REQUEST_INIT( sendreq, \
@ -174,34 +162,29 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
sendmode, \
buf, \
count) \
{ \
do { \
OMPI_REQUEST_INIT(&(sendreq->req_send.req_base.req_ompi), \
false); \
MCA_PML_CM_SEND_REQUEST_INIT_COMMON( \
(&sendreq->req_send), \
ompi_proc, \
comm, \
tag, \
datatype, \
sendmode, \
buf, \
count); \
MCA_PML_CM_SEND_REQUEST_INIT_COMMON( (&sendreq->req_send), \
ompi_proc, \
comm, \
tag, \
datatype, \
sendmode, \
buf, \
count); \
sendreq->req_send.req_base.req_pml_complete = false; \
}while(0); \
}
} while(0)
#define MCA_PML_CM_SEND_REQUEST_START_SETUP(req_send) \
do { \
\
req_send->req_base.req_pml_complete = false; \
req_send->req_base.req_ompi.req_complete = false; \
req_send->req_base.req_ompi.req_state = \
OMPI_REQUEST_ACTIVE; \
req_send->req_base.req_ompi.req_status._cancelled = 0; \
\
} while (0)
(req_send)->req_base.req_pml_complete = false; \
(req_send)->req_base.req_ompi.req_complete = false; \
(req_send)->req_base.req_ompi.req_state = \
OMPI_REQUEST_ACTIVE; \
(req_send)->req_base.req_ompi.req_status._cancelled = 0; \
} while (0)
#define MCA_PML_CM_THIN_SEND_REQUEST_START(sendreq, \
@ -212,7 +195,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
blocking, \
ret) \
do { \
MCA_PML_CM_SEND_REQUEST_START_SETUP((&sendreq->req_send)); \
MCA_PML_CM_SEND_REQUEST_START_SETUP(&(sendreq)->req_send); \
ret = OMPI_MTL_CALL(isend(ompi_mtl, \
comm, \
dst, \
@ -220,7 +203,7 @@ do { \
&sendreq->req_send.req_base.req_convertor, \
sendmode, \
blocking, \
&sendreq->req_mtl)); \
&sendreq->req_send.req_base.req_mtl)); \
} while (0)
#define MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC(sendreq, ret) \
@ -249,27 +232,27 @@ do { \
} while(0);
#define MCA_PML_CM_HVY_SEND_REQUEST_START(sendreq, ret) \
do { \
ret = OMPI_SUCCESS; \
MCA_PML_CM_SEND_REQUEST_START_SETUP((&sendreq->req_send)); \
if (sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) { \
MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC(sendreq, ret); \
} \
if (OMPI_SUCCESS == ret) { \
ret = OMPI_MTL_CALL(isend(ompi_mtl, \
sendreq->req_send.req_comm, \
sendreq->req_peer, \
sendreq->req_tag, \
#define MCA_PML_CM_HVY_SEND_REQUEST_START(sendreq, ret) \
do { \
ret = OMPI_SUCCESS; \
MCA_PML_CM_SEND_REQUEST_START_SETUP(&(sendreq)->req_send); \
if (sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) { \
MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC(sendreq, ret); \
} \
if (OMPI_SUCCESS == ret) { \
ret = OMPI_MTL_CALL(isend(ompi_mtl, \
sendreq->req_send.req_base.req_comm, \
sendreq->req_peer, \
sendreq->req_tag, \
&sendreq->req_send.req_base.req_convertor, \
sendreq->req_send.req_send_mode, \
sendreq->req_blocking, \
&sendreq->req_mtl)); \
if(OMPI_SUCCESS == ret && \
sendreq->req_send.req_send_mode, \
sendreq->req_blocking, \
&sendreq->req_send.req_base.req_mtl)); \
if(OMPI_SUCCESS == ret && \
sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) { \
MCA_PML_BASE_REQUEST_MPI_COMPLETE(&(sendreq->req_send.req_base.req_ompi)); \
} \
} \
MCA_PML_BASE_REQUEST_MPI_COMPLETE(&(sendreq)->req_send.req_base.req_ompi); \
} \
} \
} while (0)
/*
@ -295,10 +278,10 @@ do { \
} \
sendreq->req_send.req_base.req_pml_complete = true; \
\
if( sendreq->req_send.req_base.req_free_called ) { \
if( sendreq->req_send.req_base.req_free_called ) { \
MCA_PML_CM_HVY_SEND_REQUEST_RETURN( sendreq ); \
} else { \
if(sendreq->req_send.req_base.req_ompi.req_persistent) { \
if(sendreq->req_send.req_base.req_ompi.req_persistent) { \
/* rewind convertor */ \
size_t offset = 0; \
ompi_convertor_set_position(&sendreq->req_send.req_base.req_convertor, \
@ -315,13 +298,12 @@ do { \
#define MCA_PML_CM_HVY_SEND_REQUEST_RETURN(sendreq) \
{ \
/* Let the base handle the reference counts */ \
OBJ_RELEASE(sendreq->req_send.req_datatype); \
OBJ_RELEASE(sendreq->req_send.req_comm); \
OBJ_RELEASE(sendreq->req_send.req_base.req_datatype); \
OBJ_RELEASE(sendreq->req_send.req_base.req_comm); \
OMPI_REQUEST_FINI(&sendreq->req_send.req_base.req_ompi); \
ompi_convertor_cleanup( &(sendreq->req_send.req_base.req_convertor) ); \
OMPI_FREE_LIST_RETURN( \
&ompi_pml_cm.cm_hvy_send_requests, \
(ompi_free_list_item_t*)sendreq); \
OMPI_FREE_LIST_RETURN( &ompi_pml_cm.cm_hvy_send_requests, \
(ompi_free_list_item_t*)sendreq); \
}
/*
@ -333,7 +315,7 @@ do { \
*/
#define MCA_PML_CM_THIN_SEND_REQUEST_PML_COMPLETE(sendreq) \
do { \
assert( false == sendreq->req_send.req_base.req_pml_complete ); \
assert( false == sendreq->req_send.req_base.req_pml_complete ); \
\
OPAL_THREAD_LOCK(&ompi_request_lock); \
if( false == sendreq->req_send.req_base.req_ompi.req_complete ) { \
@ -355,13 +337,12 @@ do { \
#define MCA_PML_CM_THIN_SEND_REQUEST_RETURN(sendreq) \
{ \
/* Let the base handle the reference counts */ \
OBJ_RELEASE(sendreq->req_send.req_datatype); \
OBJ_RELEASE(sendreq->req_send.req_comm); \
OBJ_RELEASE(sendreq->req_send.req_base.req_datatype); \
OBJ_RELEASE(sendreq->req_send.req_base.req_comm); \
OMPI_REQUEST_FINI(&sendreq->req_send.req_base.req_ompi); \
ompi_convertor_cleanup( &(sendreq->req_send.req_base.req_convertor) ); \
OMPI_FREE_LIST_RETURN( \
&ompi_pml_cm.cm_thin_send_requests, \
(ompi_free_list_item_t*)sendreq); \
OMPI_FREE_LIST_RETURN( &ompi_pml_cm.cm_thin_send_requests, \
(ompi_free_list_item_t*)sendreq); \
}
#endif

Просмотреть файл

@ -40,7 +40,6 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
continue;
}
if (NULL == pml_request) {
/* opal_output(0, "hmm, null request!\n"); */
continue;
}
/* If the persistent request is currebtly active - obtain the
@ -51,16 +50,12 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
*/
switch (pml_request->req_ompi.req_state) {
case OMPI_REQUEST_INACTIVE:
/* opal_output(0, "ereIbe!\n"); */
if (pml_request->req_pml_complete == true)
break;
case OMPI_REQUEST_ACTIVE: {
/* otherwise fall through */
ompi_request_t *request;
/* opal_output(0, "ereIam!\n"); */
OPAL_THREAD_LOCK(&ompi_request_lock);
if (pml_request->req_pml_complete == false) {
@ -76,27 +71,25 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
switch (pml_request->req_pml_type) {
case MCA_PML_CM_REQUEST_SEND_HEAVY: {
mca_pml_cm_hvy_send_request_t* sendreq = (mca_pml_cm_hvy_send_request_t*) pml_request;
rc = mca_pml_cm_isend_init(
sendreq->req_addr,
sendreq->req_count,
sendreq->req_send.req_datatype,
sendreq->req_peer,
sendreq->req_tag,
sendreq->req_send.req_send_mode,
sendreq->req_send.req_comm,
&request);
rc = mca_pml_cm_isend_init( sendreq->req_addr,
sendreq->req_count,
sendreq->req_send.req_base.req_datatype,
sendreq->req_peer,
sendreq->req_tag,
sendreq->req_send.req_send_mode,
sendreq->req_send.req_base.req_comm,
&request );
break;
}
case MCA_PML_CM_REQUEST_RECV_HEAVY: {
mca_pml_cm_hvy_recv_request_t* recvreq = (mca_pml_cm_hvy_recv_request_t*) pml_request;
rc = mca_pml_cm_irecv_init(
recvreq->req_addr,
recvreq->req_count,
recvreq->req_datatype,
recvreq->req_peer,
recvreq->req_tag,
recvreq->req_comm,
&request);
rc = mca_pml_cm_irecv_init( recvreq->req_addr,
recvreq->req_count,
recvreq->req_base.req_datatype,
recvreq->req_peer,
recvreq->req_tag,
recvreq->req_base.req_comm,
&request );
break;
}
default:
@ -111,7 +104,6 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
break;
}
default:
/* opal_output(0,"unknown request state!\n"); */
return OMPI_ERR_REQUEST;
}
@ -130,17 +122,14 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
{
mca_pml_cm_hvy_recv_request_t* recvreq =
(mca_pml_cm_hvy_recv_request_t*)pml_request;
/* opal_output(0, "calling recv request start\n"); */
MCA_PML_CM_HVY_RECV_REQUEST_START(recvreq, rc);
if(rc != OMPI_SUCCESS)
return rc;
break;
}
default:
/* opal_output(0, "can't start an unknown request type!"); */
return OMPI_ERR_REQUEST;
}
}
return OMPI_SUCCESS;
}