This patch bring full support for message queues in Open MPI. Now the send and
receive queues are shared among all PMLs, they are declared in the base PML, and the selected PML is in charge of initializing and releasing them. The CM PML is slightly different compared with OB1 or DR. Internally it use 2 different types of requests: light and heavy. However, now with this patch both types of requests are stored in the same queue, and cast appropriately on the allocation macro. This means we might use less memory than we allocate, but in exchange we got full support for most of the parallel debuggers. Another thing with this patch, is that now for all PML (CM included) the basic PML requests start with the same fields, and they are declared in the same order in the request structure. Moreover, the fields have been moved in such a way that only one volatile/atomic will exist per line of cache (hopefully). This commit was SVN r15346.
Этот коммит содержится в:
родитель
87dd4bbd47
Коммит
433f8a7694
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -249,7 +249,7 @@ int mca_pml_base_bsend_request_start(ompi_request_t* request)
|
||||
iov.iov_len = sendreq->req_bytes_packed;
|
||||
iov_count = 1;
|
||||
max_data = iov.iov_len;
|
||||
if((rc = ompi_convertor_pack( &sendreq->req_convertor,
|
||||
if((rc = ompi_convertor_pack( &sendreq->req_base.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data )) < 0) {
|
||||
@ -257,7 +257,7 @@ int mca_pml_base_bsend_request_start(ompi_request_t* request)
|
||||
}
|
||||
|
||||
/* setup convertor to point to packed buffer (at position zero) */
|
||||
ompi_convertor_prepare_for_send( &sendreq->req_convertor, MPI_PACKED,
|
||||
ompi_convertor_prepare_for_send( &sendreq->req_base.req_convertor, MPI_PACKED,
|
||||
max_data, sendreq->req_addr );
|
||||
/* increment count of pending requests */
|
||||
mca_pml_bsend_count++;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
||||
@ -39,7 +39,7 @@ static void mca_pml_base_recv_request_construct(mca_pml_base_recv_request_t* req
|
||||
{
|
||||
/* no need to reinit for every recv -- never changes */
|
||||
request->req_base.req_type = MCA_PML_REQUEST_RECV;
|
||||
OBJ_CONSTRUCT(&request->req_convertor, ompi_convertor_t);
|
||||
OBJ_CONSTRUCT(&request->req_base.req_convertor, ompi_convertor_t);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -35,7 +35,6 @@ extern "C" {
|
||||
*/
|
||||
struct mca_pml_base_recv_request_t {
|
||||
mca_pml_base_request_t req_base; /**< base request */
|
||||
ompi_convertor_t req_convertor; /**< convertor that describes this datatype */
|
||||
size_t req_bytes_packed; /**< size of message being received */
|
||||
};
|
||||
typedef struct mca_pml_base_recv_request_t mca_pml_base_recv_request_t;
|
||||
@ -115,12 +114,12 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_recv_request_t);
|
||||
*
|
||||
* @param request (IN) Receive request.
|
||||
*/
|
||||
#define MCA_PML_BASE_RECV_REQUEST_FINI( request ) \
|
||||
do { \
|
||||
OMPI_REQUEST_FINI(&(request)->req_base.req_ompi); \
|
||||
OBJ_RELEASE( (request)->req_base.req_comm); \
|
||||
OBJ_RELEASE( (request)->req_base.req_datatype ); \
|
||||
ompi_convertor_cleanup( &((request)->req_convertor) ); \
|
||||
#define MCA_PML_BASE_RECV_REQUEST_FINI( request ) \
|
||||
do { \
|
||||
OMPI_REQUEST_FINI(&(request)->req_base.req_ompi); \
|
||||
OBJ_RELEASE( (request)->req_base.req_comm); \
|
||||
OBJ_RELEASE( (request)->req_base.req_datatype ); \
|
||||
ompi_convertor_cleanup( &((request)->req_base.req_convertor) ); \
|
||||
} while (0)
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
||||
@ -20,6 +20,13 @@
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
#include "ompi/mca/pml/base/pml_base_request.h"
|
||||
|
||||
/**
|
||||
* If you wonder why these 2 freelists are declared here read the comment
|
||||
* in the pml_base_request.h file.
|
||||
*/
|
||||
ompi_free_list_t mca_pml_base_send_requests;
|
||||
ompi_free_list_t mca_pml_base_recv_requests;
|
||||
|
||||
static void mca_pml_base_request_construct(mca_pml_base_request_t* req)
|
||||
{
|
||||
req->req_ompi.req_type = OMPI_REQUEST_PML;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -23,11 +23,20 @@
|
||||
|
||||
#include "ompi/class/ompi_free_list.h"
|
||||
#include "ompi/request/request.h"
|
||||
#include "ompi/datatype/convertor.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
OMPI_DECLSPEC extern opal_class_t mca_pml_base_request_t_class;
|
||||
|
||||
/**
|
||||
* External list for the requests. They are declared as lists of
|
||||
* the basic request type, which will allow all PML to overload
|
||||
* the list. Beware these free lists have to be initialized
|
||||
* directly by the PML who win the PML election.
|
||||
*/
|
||||
OMPI_DECLSPEC extern ompi_free_list_t mca_pml_base_send_requests;
|
||||
OMPI_DECLSPEC extern ompi_free_list_t mca_pml_base_recv_requests;
|
||||
|
||||
/**
|
||||
* Type of request.
|
||||
@ -46,20 +55,23 @@ typedef enum {
|
||||
*/
|
||||
struct mca_pml_base_request_t {
|
||||
ompi_request_t req_ompi; /**< base request */
|
||||
volatile bool req_pml_complete; /**< flag indicating if the pt-2-pt layer is done with this request */
|
||||
mca_pml_base_request_type_t req_type; /**< MPI request type - used for test */
|
||||
struct ompi_communicator_t *req_comm; /**< communicator pointer */
|
||||
struct ompi_datatype_t *req_datatype; /**< pointer to data type */
|
||||
volatile bool req_free_called; /**< flag indicating if the user has freed this request */
|
||||
ompi_convertor_t req_convertor; /**< always need the convertor */
|
||||
void *req_addr; /**< pointer to application buffer */
|
||||
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_proc_t* req_proc; /**< peer process */
|
||||
uint64_t req_sequence; /**< sequence number for MPI pt-2-pt ordering */
|
||||
struct ompi_datatype_t *req_datatype; /**< pointer to data type */
|
||||
mca_pml_base_request_type_t req_type; /**< MPI request type - used for test */
|
||||
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 */
|
||||
};
|
||||
typedef struct mca_pml_base_request_t mca_pml_base_request_t;
|
||||
|
||||
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_request_t);
|
||||
|
||||
/*
|
||||
* Mark the MPI request as completed and trigger the condition if required.
|
||||
*/
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
||||
@ -36,7 +36,7 @@ static void mca_pml_base_send_request_construct(mca_pml_base_send_request_t* req
|
||||
{
|
||||
/* no need to reinit for every send -- never changes */
|
||||
request->req_base.req_type = MCA_PML_REQUEST_SEND;
|
||||
OBJ_CONSTRUCT(&request->req_convertor, ompi_convertor_t);
|
||||
OBJ_CONSTRUCT(&request->req_base.req_convertor, ompi_convertor_t);
|
||||
}
|
||||
|
||||
static void mca_pml_base_send_request_destruct(mca_pml_base_send_request_t* req)
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -41,7 +41,6 @@ struct mca_pml_base_send_request_t {
|
||||
void *req_addr; /**< pointer to send buffer - may not be application buffer */
|
||||
size_t req_bytes_packed; /**< packed size of a message given the datatype and count */
|
||||
mca_pml_base_send_mode_t req_send_mode; /**< type of send */
|
||||
ompi_convertor_t req_convertor; /**< convertor that describes this datatype */
|
||||
};
|
||||
typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t;
|
||||
|
||||
@ -104,8 +103,8 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION( mca_pml_base_send_request_t );
|
||||
(request)->req_base.req_count, \
|
||||
(request)->req_base.req_addr, \
|
||||
0, \
|
||||
&(request)->req_convertor ); \
|
||||
ompi_convertor_get_packed_size( &(request)->req_convertor, \
|
||||
&(request)->req_base.req_convertor ); \
|
||||
ompi_convertor_get_packed_size( &(request)->req_base.req_convertor, \
|
||||
&((request)->req_bytes_packed) );\
|
||||
} \
|
||||
PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_ACTIVATE, \
|
||||
@ -139,7 +138,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION( mca_pml_base_send_request_t );
|
||||
OBJ_RELEASE((request)->req_base.req_comm); \
|
||||
if( 0 != (request)->req_base.req_count ) \
|
||||
OBJ_RELEASE((request)->req_base.req_datatype); \
|
||||
ompi_convertor_cleanup( &((request)->req_convertor) ); \
|
||||
ompi_convertor_cleanup( &((request)->req_base.req_convertor) ); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
@ -2,6 +2,9 @@
|
||||
* Copyright (c) 2006-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -154,38 +157,3 @@ mca_pml_cm_dump(struct ompi_communicator_t* comm, int verbose)
|
||||
{
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
mca_pml_cm_thin_send_request_completion(struct mca_mtl_request_t *mtl_request)
|
||||
{
|
||||
mca_pml_cm_send_request_t *base_request =
|
||||
(mca_pml_cm_send_request_t*) mtl_request->ompi_req;
|
||||
MCA_PML_CM_THIN_SEND_REQUEST_PML_COMPLETE(((mca_pml_cm_thin_send_request_t*) base_request));
|
||||
}
|
||||
void
|
||||
mca_pml_cm_hvy_send_request_completion(struct mca_mtl_request_t *mtl_request)
|
||||
{
|
||||
mca_pml_cm_send_request_t *base_request =
|
||||
(mca_pml_cm_send_request_t*) mtl_request->ompi_req;
|
||||
MCA_PML_CM_HVY_SEND_REQUEST_PML_COMPLETE(((mca_pml_cm_hvy_send_request_t*) base_request));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
mca_pml_cm_thin_recv_request_completion(struct mca_mtl_request_t *mtl_request)
|
||||
{
|
||||
mca_pml_cm_request_t *base_request =
|
||||
(mca_pml_cm_request_t*) mtl_request->ompi_req;
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_PML_COMPLETE(((mca_pml_cm_thin_recv_request_t*) base_request));
|
||||
}
|
||||
|
||||
void
|
||||
mca_pml_cm_hvy_recv_request_completion(struct mca_mtl_request_t *mtl_request)
|
||||
{
|
||||
mca_pml_cm_request_t *base_request =
|
||||
(mca_pml_cm_request_t*) mtl_request->ompi_req;
|
||||
MCA_PML_CM_HVY_RECV_REQUEST_PML_COMPLETE(((mca_pml_cm_hvy_recv_request_t*) base_request));
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -11,7 +17,6 @@
|
||||
#ifndef PML_CM_H
|
||||
#define PML_CM_H
|
||||
|
||||
#include "ompi/class/ompi_free_list.h"
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "ompi/request/request.h"
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
@ -21,24 +26,14 @@
|
||||
#include "opal/class/opal_free_list.h"
|
||||
#include "ompi/mca/mtl/mtl.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
OMPI_DECLSPEC extern mca_pml_base_component_1_0_0_t mca_pml_cm_component;
|
||||
|
||||
|
||||
struct mca_mtl_request_t;
|
||||
|
||||
struct ompi_pml_cm_t {
|
||||
mca_pml_base_module_t super;
|
||||
/** free list of send request structures */
|
||||
ompi_free_list_t cm_thin_send_requests;
|
||||
ompi_free_list_t cm_hvy_send_requests;
|
||||
/** free list of recv request structures */
|
||||
ompi_free_list_t cm_thin_recv_requests;
|
||||
ompi_free_list_t cm_hvy_recv_requests;
|
||||
};
|
||||
typedef struct ompi_pml_cm_t ompi_pml_cm_t;
|
||||
extern ompi_pml_cm_t ompi_pml_cm;
|
||||
@ -54,14 +49,6 @@ extern int mca_pml_cm_add_comm(struct ompi_communicator_t* comm);
|
||||
extern int mca_pml_cm_del_comm(struct ompi_communicator_t* comm);
|
||||
|
||||
extern int mca_pml_cm_irecv_init(void *buf,
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int src,
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
struct ompi_request_t **request);
|
||||
|
||||
extern int mca_pml_cm_irecv(void *buf,
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int src,
|
||||
@ -69,24 +56,23 @@ extern int mca_pml_cm_irecv(void *buf,
|
||||
struct ompi_communicator_t* comm,
|
||||
struct ompi_request_t **request);
|
||||
|
||||
extern int mca_pml_cm_irecv(void *buf,
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int src,
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
struct ompi_request_t **request);
|
||||
|
||||
extern int mca_pml_cm_recv(void *buf,
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int src,
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
ompi_status_public_t* status );
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int src,
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
ompi_status_public_t* status );
|
||||
|
||||
extern int mca_pml_cm_isend_init(void *buf,
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int dst,
|
||||
int tag,
|
||||
mca_pml_base_send_mode_t mode,
|
||||
struct ompi_communicator_t* comm,
|
||||
struct ompi_request_t **request);
|
||||
|
||||
extern int mca_pml_cm_isend(void *buf,
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int dst,
|
||||
@ -95,41 +81,42 @@ extern int mca_pml_cm_isend(void *buf,
|
||||
struct ompi_communicator_t* comm,
|
||||
struct ompi_request_t **request);
|
||||
|
||||
extern int mca_pml_cm_isend(void *buf,
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int dst,
|
||||
int tag,
|
||||
mca_pml_base_send_mode_t mode,
|
||||
struct ompi_communicator_t* comm,
|
||||
struct ompi_request_t **request);
|
||||
|
||||
extern int mca_pml_cm_send(void *buf,
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int dst,
|
||||
int tag,
|
||||
mca_pml_base_send_mode_t mode,
|
||||
struct ompi_communicator_t* comm);
|
||||
size_t count,
|
||||
ompi_datatype_t *datatype,
|
||||
int dst,
|
||||
int tag,
|
||||
mca_pml_base_send_mode_t mode,
|
||||
struct ompi_communicator_t* comm);
|
||||
|
||||
extern int mca_pml_cm_iprobe(int dst,
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
int *matched,
|
||||
ompi_status_public_t* status);
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
int *matched,
|
||||
ompi_status_public_t* status);
|
||||
|
||||
extern int mca_pml_cm_probe(int dst,
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
ompi_status_public_t* status);
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
ompi_status_public_t* status);
|
||||
|
||||
extern int mca_pml_cm_start(size_t count, ompi_request_t** requests);
|
||||
|
||||
|
||||
extern int mca_pml_cm_dump(struct ompi_communicator_t* comm,
|
||||
int verbose);
|
||||
int verbose);
|
||||
|
||||
extern int mca_pml_cm_cancel(struct ompi_request_t *request, int flag);
|
||||
|
||||
extern void mca_pml_cm_thin_send_request_completion(struct mca_mtl_request_t *mtl_request);
|
||||
extern void mca_pml_cm_hvy_send_request_completion(struct mca_mtl_request_t *mtl_request);
|
||||
|
||||
extern void mca_pml_cm_thin_recv_request_completion(struct mca_mtl_request_t *mtl_request);
|
||||
extern void mca_pml_cm_hvy_recv_request_completion(struct mca_mtl_request_t *mtl_request);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* PML_CM_H_HAS_BEEN_INCLUDED */
|
||||
|
@ -2,6 +2,9 @@
|
||||
* Copyright (c) 2006-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -149,40 +152,20 @@ mca_pml_cm_component_init(int* priority,
|
||||
ompi_pml_cm.super.pml_max_contextid = ompi_mtl->mtl_max_contextid;
|
||||
ompi_pml_cm.super.pml_max_tag = ompi_mtl->mtl_max_tag;
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_pml_cm.cm_thin_send_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(&ompi_pml_cm.cm_thin_send_requests,
|
||||
sizeof(mca_pml_cm_thin_send_request_t) +
|
||||
ompi_mtl->mtl_request_size,
|
||||
OBJ_CLASS(mca_pml_cm_thin_send_request_t),
|
||||
free_list_num,
|
||||
free_list_max,
|
||||
free_list_inc,
|
||||
NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_pml_cm.cm_hvy_send_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(&ompi_pml_cm.cm_hvy_send_requests,
|
||||
sizeof(mca_pml_cm_hvy_send_request_t) +
|
||||
ompi_mtl->mtl_request_size,
|
||||
OBJ_CONSTRUCT(&mca_pml_base_send_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(&mca_pml_base_send_requests,
|
||||
MAX(sizeof(mca_pml_cm_thin_send_request_t),
|
||||
sizeof(mca_pml_cm_hvy_send_request_t)) + ompi_mtl->mtl_request_size,
|
||||
OBJ_CLASS(mca_pml_cm_hvy_send_request_t),
|
||||
free_list_num,
|
||||
free_list_max,
|
||||
free_list_inc,
|
||||
NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_pml_cm.cm_thin_recv_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(&ompi_pml_cm.cm_thin_recv_requests,
|
||||
sizeof(mca_pml_cm_thin_recv_request_t) +
|
||||
ompi_mtl->mtl_request_size,
|
||||
OBJ_CLASS(mca_pml_cm_thin_recv_request_t),
|
||||
free_list_num,
|
||||
free_list_max,
|
||||
free_list_inc,
|
||||
NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_pml_cm.cm_hvy_recv_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(&ompi_pml_cm.cm_hvy_recv_requests,
|
||||
sizeof(mca_pml_cm_hvy_recv_request_t) +
|
||||
ompi_mtl->mtl_request_size,
|
||||
OBJ_CONSTRUCT(&mca_pml_base_recv_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(&mca_pml_base_send_requests,
|
||||
MAX(sizeof(mca_pml_cm_thin_recv_request_t),
|
||||
sizeof(mca_pml_cm_hvy_recv_request_t)) + ompi_mtl->mtl_request_size,
|
||||
OBJ_CLASS(mca_pml_cm_hvy_recv_request_t),
|
||||
free_list_num,
|
||||
free_list_max,
|
||||
@ -205,10 +188,8 @@ mca_pml_cm_component_fini(void)
|
||||
/* shut down buffered send code */
|
||||
mca_pml_base_bsend_fini();
|
||||
|
||||
OBJ_DESTRUCT(&ompi_pml_cm.cm_thin_send_requests);
|
||||
OBJ_DESTRUCT(&ompi_pml_cm.cm_hvy_send_requests);
|
||||
OBJ_DESTRUCT(&ompi_pml_cm.cm_thin_recv_requests);
|
||||
OBJ_DESTRUCT(&ompi_pml_cm.cm_hvy_recv_requests);
|
||||
OBJ_DESTRUCT(&mca_pml_base_send_requests);
|
||||
OBJ_DESTRUCT(&mca_pml_base_recv_requests);
|
||||
|
||||
if (NULL != ompi_mtl && NULL != ompi_mtl->mtl_finalize) {
|
||||
return ompi_mtl->mtl_finalize(ompi_mtl);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -21,28 +21,8 @@
|
||||
#include "pml_cm.h"
|
||||
#include "pml_cm_recvreq.h"
|
||||
|
||||
|
||||
static int
|
||||
mca_pml_cm_thin_recv_request_free(struct ompi_request_t** request)
|
||||
{
|
||||
mca_pml_cm_request_t* recvreq = *(mca_pml_cm_request_t**)request;
|
||||
|
||||
assert( false == recvreq->req_free_called );
|
||||
|
||||
OPAL_THREAD_LOCK(&ompi_request_lock);
|
||||
recvreq->req_free_called = true;
|
||||
if( true == recvreq->req_pml_complete ) {
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_RETURN((mca_pml_cm_thin_recv_request_t*) recvreq );
|
||||
}
|
||||
|
||||
OPAL_THREAD_UNLOCK(&ompi_request_lock);
|
||||
|
||||
*request = MPI_REQUEST_NULL;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
static int
|
||||
mca_pml_cm_hvy_recv_request_free(struct ompi_request_t** request)
|
||||
mca_pml_cm_recv_request_free(struct ompi_request_t** request)
|
||||
{
|
||||
mca_pml_cm_request_t* recvreq = *(mca_pml_cm_request_t**)request;
|
||||
|
||||
@ -51,7 +31,11 @@ mca_pml_cm_hvy_recv_request_free(struct ompi_request_t** request)
|
||||
OPAL_THREAD_LOCK(&ompi_request_lock);
|
||||
recvreq->req_free_called = true;
|
||||
if( true == recvreq->req_pml_complete ) {
|
||||
MCA_PML_CM_HVY_RECV_REQUEST_RETURN((mca_pml_cm_hvy_recv_request_t*) recvreq );
|
||||
if( MCA_PML_CM_REQUEST_RECV_THIN == recvreq->req_pml_type ) {
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_RETURN((mca_pml_cm_hvy_recv_request_t*)recvreq );
|
||||
} else {
|
||||
MCA_PML_CM_HVY_RECV_REQUEST_RETURN((mca_pml_cm_hvy_recv_request_t*)recvreq );
|
||||
}
|
||||
}
|
||||
|
||||
OPAL_THREAD_UNLOCK(&ompi_request_lock);
|
||||
@ -61,38 +45,37 @@ mca_pml_cm_hvy_recv_request_free(struct ompi_request_t** request)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mca_pml_cm_recv_request_completion(struct mca_mtl_request_t *mtl_request)
|
||||
{
|
||||
mca_pml_cm_request_t *base_request =
|
||||
(mca_pml_cm_request_t*) mtl_request->ompi_req;
|
||||
if( MCA_PML_CM_REQUEST_RECV_THIN == base_request->req_pml_type ) {
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_PML_COMPLETE(((mca_pml_cm_thin_recv_request_t*)base_request));
|
||||
} else {
|
||||
MCA_PML_CM_HVY_RECV_REQUEST_PML_COMPLETE(((mca_pml_cm_hvy_recv_request_t*)base_request));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mca_pml_cm_thin_recv_request_construct(mca_pml_cm_thin_recv_request_t* recvreq)
|
||||
mca_pml_cm_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_mtl.completion_callback = mca_pml_cm_recv_request_completion;
|
||||
|
||||
recvreq->req_base.req_ompi.req_free = mca_pml_cm_thin_recv_request_free;
|
||||
recvreq->req_base.req_ompi.req_free = mca_pml_cm_recv_request_free;
|
||||
recvreq->req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
|
||||
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_THIN;
|
||||
OBJ_CONSTRUCT( &(recvreq->req_base.req_convertor), ompi_convertor_t );
|
||||
}
|
||||
|
||||
|
||||
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_ompi.req_free = mca_pml_cm_hvy_recv_request_free;
|
||||
recvreq->req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
|
||||
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_HEAVY;
|
||||
OBJ_CONSTRUCT( &(recvreq->req_base.req_convertor), ompi_convertor_t );
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_pml_cm_thin_recv_request_t,
|
||||
mca_pml_cm_request_t,
|
||||
mca_pml_cm_thin_recv_request_construct,
|
||||
mca_pml_cm_recv_request_construct,
|
||||
NULL);
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_pml_cm_hvy_recv_request_t,
|
||||
mca_pml_cm_request_t,
|
||||
mca_pml_cm_hvy_recv_request_construct,
|
||||
mca_pml_cm_recv_request_construct,
|
||||
NULL);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -51,18 +51,20 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_recv_request_t);
|
||||
* @param rc (OUT) OMPI_SUCCESS or error status on failure.
|
||||
* @return Receive request.
|
||||
*/
|
||||
#define MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq, rc) \
|
||||
do { \
|
||||
ompi_free_list_item_t*item; \
|
||||
OMPI_FREE_LIST_GET(&ompi_pml_cm.cm_thin_recv_requests, item, rc); \
|
||||
#define MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq, rc) \
|
||||
do { \
|
||||
ompi_free_list_item_t*item; \
|
||||
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item, rc); \
|
||||
recvreq = (mca_pml_cm_thin_recv_request_t*) item; \
|
||||
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_THIN; \
|
||||
} while (0)
|
||||
|
||||
#define MCA_PML_CM_HVY_RECV_REQUEST_ALLOC(recvreq, rc) \
|
||||
do { \
|
||||
ompi_free_list_item_t*item; \
|
||||
OMPI_FREE_LIST_GET(&ompi_pml_cm.cm_hvy_recv_requests, item, rc); \
|
||||
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item, rc); \
|
||||
recvreq = (mca_pml_cm_hvy_recv_request_t*) item; \
|
||||
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_HEAVY; \
|
||||
} while (0)
|
||||
|
||||
|
||||
@ -271,8 +273,8 @@ do { \
|
||||
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, \
|
||||
(ompi_free_list_item_t*)(recvreq)); \
|
||||
OMPI_FREE_LIST_RETURN( &mca_pml_base_recv_requests, \
|
||||
(ompi_free_list_item_t*)(recvreq)); \
|
||||
}
|
||||
|
||||
/**
|
||||
@ -284,7 +286,7 @@ do { \
|
||||
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, \
|
||||
OMPI_FREE_LIST_RETURN( &mca_pml_base_recv_requests, \
|
||||
(ompi_free_list_item_t*)(recvreq)); \
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -41,11 +41,11 @@ typedef enum {
|
||||
struct mca_pml_cm_request_t {
|
||||
ompi_request_t req_ompi; /**< base request */
|
||||
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 */
|
||||
ompi_convertor_t req_convertor; /**< always need the convertor */
|
||||
volatile bool req_free_called; /**< flag indicating if the user has freed this request */
|
||||
ompi_convertor_t req_convertor; /**< convertor that describes the memory layout */
|
||||
};
|
||||
typedef struct mca_pml_cm_request_t mca_pml_cm_request_t;
|
||||
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_request_t);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -22,51 +22,6 @@
|
||||
#include "pml_cm_sendreq.h"
|
||||
|
||||
|
||||
static int
|
||||
mca_pml_cm_thin_send_request_free(struct ompi_request_t** request);
|
||||
static int
|
||||
mca_pml_cm_hvy_send_request_free(struct ompi_request_t** request);
|
||||
|
||||
static void mca_pml_cm_thin_send_request_construct(mca_pml_cm_thin_send_request_t* req);
|
||||
static void mca_pml_cm_hvy_send_request_construct(mca_pml_cm_hvy_send_request_t* sendreq);
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_pml_cm_send_request_t,
|
||||
mca_pml_cm_request_t,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_pml_cm_thin_send_request_t,
|
||||
mca_pml_cm_send_request_t,
|
||||
mca_pml_cm_thin_send_request_construct,
|
||||
NULL);
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_pml_cm_hvy_send_request_t,
|
||||
mca_pml_cm_send_request_t,
|
||||
mca_pml_cm_hvy_send_request_construct,
|
||||
NULL);
|
||||
|
||||
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_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;
|
||||
}
|
||||
|
||||
|
||||
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_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;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The free call mark the final stage in a request
|
||||
* life-cycle. Starting from this point the request is completed at
|
||||
@ -75,7 +30,7 @@ static void mca_pml_cm_hvy_send_request_construct(mca_pml_cm_hvy_send_request_t*
|
||||
* added to the free request list.
|
||||
*/
|
||||
static int
|
||||
mca_pml_cm_thin_send_request_free(struct ompi_request_t** request)
|
||||
mca_pml_cm_send_request_free(struct ompi_request_t** request)
|
||||
{
|
||||
mca_pml_cm_send_request_t* sendreq = *(mca_pml_cm_send_request_t**)request;
|
||||
assert( false == sendreq->req_base.req_free_called );
|
||||
@ -83,7 +38,11 @@ mca_pml_cm_thin_send_request_free(struct ompi_request_t** request)
|
||||
OPAL_THREAD_LOCK(&ompi_request_lock);
|
||||
sendreq->req_base.req_free_called = true;
|
||||
if( true == sendreq->req_base.req_pml_complete ) {
|
||||
MCA_PML_CM_THIN_SEND_REQUEST_RETURN( ((mca_pml_cm_thin_send_request_t*) sendreq) );
|
||||
if( MCA_PML_CM_REQUEST_SEND_THIN == sendreq->req_base.req_pml_type ) {
|
||||
MCA_PML_CM_THIN_SEND_REQUEST_RETURN( ((mca_pml_cm_thin_send_request_t*) sendreq) );
|
||||
} else {
|
||||
MCA_PML_CM_HVY_SEND_REQUEST_RETURN( ((mca_pml_cm_hvy_send_request_t*) sendreq) );
|
||||
}
|
||||
}
|
||||
|
||||
OPAL_THREAD_UNLOCK(&ompi_request_lock);
|
||||
@ -92,20 +51,39 @@ mca_pml_cm_thin_send_request_free(struct ompi_request_t** request)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
static int
|
||||
mca_pml_cm_hvy_send_request_free(struct ompi_request_t** request)
|
||||
static void
|
||||
mca_pml_cm_send_request_completion(struct mca_mtl_request_t *mtl_request)
|
||||
{
|
||||
mca_pml_cm_send_request_t* sendreq = *(mca_pml_cm_send_request_t**)request;
|
||||
assert( false == sendreq->req_base.req_free_called );
|
||||
|
||||
OPAL_THREAD_LOCK(&ompi_request_lock);
|
||||
sendreq->req_base.req_free_called = true;
|
||||
if( true == sendreq->req_base.req_pml_complete ) {
|
||||
MCA_PML_CM_HVY_SEND_REQUEST_RETURN( ((mca_pml_cm_hvy_send_request_t*) sendreq) );
|
||||
mca_pml_cm_send_request_t *base_request =
|
||||
(mca_pml_cm_send_request_t*) mtl_request->ompi_req;
|
||||
if( MCA_PML_CM_REQUEST_SEND_THIN == base_request->req_base.req_pml_type ) {
|
||||
MCA_PML_CM_THIN_SEND_REQUEST_PML_COMPLETE(((mca_pml_cm_thin_send_request_t*) base_request));
|
||||
} else {
|
||||
MCA_PML_CM_HVY_SEND_REQUEST_PML_COMPLETE(((mca_pml_cm_hvy_send_request_t*) base_request));
|
||||
}
|
||||
|
||||
OPAL_THREAD_UNLOCK(&ompi_request_lock);
|
||||
|
||||
*request = MPI_REQUEST_NULL;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
static void mca_pml_cm_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_send_request_completion;
|
||||
sendreq->req_send.req_base.req_ompi.req_free = mca_pml_cm_send_request_free;
|
||||
sendreq->req_send.req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_pml_cm_send_request_t,
|
||||
mca_pml_cm_request_t,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_pml_cm_thin_send_request_t,
|
||||
mca_pml_cm_send_request_t,
|
||||
mca_pml_cm_send_request_construct,
|
||||
NULL);
|
||||
|
||||
OBJ_CLASS_INSTANCE(mca_pml_cm_hvy_send_request_t,
|
||||
mca_pml_cm_send_request_t,
|
||||
mca_pml_cm_send_request_construct,
|
||||
NULL);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -24,6 +24,7 @@
|
||||
#include "ompi/mca/pml/base/pml_base_bsend.h"
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
#include "ompi/mca/mtl/mtl.h"
|
||||
#include "opal/prefetch.h"
|
||||
|
||||
struct mca_pml_cm_send_request_t {
|
||||
mca_pml_cm_request_t req_base;
|
||||
@ -47,7 +48,7 @@ struct mca_pml_cm_hvy_send_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 */
|
||||
void *req_buff; /**< pointer to send buffer - may not be application buffer */
|
||||
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. This field should be the last in the struct */
|
||||
};
|
||||
@ -61,14 +62,15 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
|
||||
ompi_free_list_item_t* item; \
|
||||
ompi_proc = ompi_comm_peer_lookup( comm, dst ); \
|
||||
\
|
||||
if(NULL == ompi_proc) { \
|
||||
if(OPAL_UNLIKELY(NULL == ompi_proc)) { \
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE; \
|
||||
sendreq = NULL; \
|
||||
} else { \
|
||||
rc = OMPI_SUCCESS; \
|
||||
OMPI_FREE_LIST_WAIT(&ompi_pml_cm.cm_thin_send_requests, \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_base_send_requests, \
|
||||
item, rc); \
|
||||
sendreq = (mca_pml_cm_thin_send_request_t*)item; \
|
||||
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_THIN; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
@ -78,14 +80,15 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
|
||||
{ \
|
||||
ompi_free_list_item_t* item; \
|
||||
ompi_proc = ompi_comm_peer_lookup( comm, dst ); \
|
||||
if(NULL == ompi_proc) { \
|
||||
if(OPAL_UNLIKELY(NULL == ompi_proc)) { \
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE; \
|
||||
sendreq = NULL; \
|
||||
} else { \
|
||||
rc = OMPI_SUCCESS; \
|
||||
OMPI_FREE_LIST_WAIT(&ompi_pml_cm.cm_hvy_send_requests, \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_base_send_requests, \
|
||||
item, rc); \
|
||||
sendreq = (mca_pml_cm_hvy_send_request_t*)item; \
|
||||
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_HEAVY; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -305,7 +308,7 @@ do { \
|
||||
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_RETURN( &mca_pml_base_send_requests, \
|
||||
(ompi_free_list_item_t*)sendreq); \
|
||||
}
|
||||
|
||||
@ -344,7 +347,7 @@ do { \
|
||||
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_RETURN( &mca_pml_base_send_requests, \
|
||||
(ompi_free_list_item_t*)sendreq); \
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -67,8 +67,6 @@ struct mca_pml_dr_t {
|
||||
opal_list_t send_active;
|
||||
|
||||
/* free lists */
|
||||
ompi_free_list_t send_requests;
|
||||
ompi_free_list_t recv_requests;
|
||||
ompi_free_list_t recv_frags;
|
||||
ompi_free_list_t vfrags;
|
||||
ompi_free_list_t buffers;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -114,9 +114,9 @@ int mca_pml_dr_component_open(void)
|
||||
mca_pml_dr_param_register_int("enable_csum", 1);
|
||||
|
||||
/* requests */
|
||||
OBJ_CONSTRUCT(&mca_pml_dr.send_requests, ompi_free_list_t);
|
||||
OBJ_CONSTRUCT(&mca_pml_base_send_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(
|
||||
&mca_pml_dr.send_requests,
|
||||
&mca_pml_base_send_requests,
|
||||
sizeof(mca_pml_dr_send_request_t),
|
||||
OBJ_CLASS(mca_pml_dr_send_request_t),
|
||||
mca_pml_dr.free_list_num,
|
||||
@ -124,9 +124,9 @@ int mca_pml_dr_component_open(void)
|
||||
mca_pml_dr.free_list_inc,
|
||||
NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&mca_pml_dr.recv_requests, ompi_free_list_t);
|
||||
OBJ_CONSTRUCT(&mca_pml_base_recv_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(
|
||||
&mca_pml_dr.recv_requests,
|
||||
&mca_pml_base_recv_requests,
|
||||
sizeof(mca_pml_dr_recv_request_t),
|
||||
OBJ_CLASS(mca_pml_dr_recv_request_t),
|
||||
mca_pml_dr.free_list_num,
|
||||
@ -181,7 +181,8 @@ int mca_pml_dr_component_close(void)
|
||||
OBJ_DESTRUCT(&mca_pml_dr.send_pending);
|
||||
OBJ_DESTRUCT(&mca_pml_dr.send_active);
|
||||
OBJ_DESTRUCT(&mca_pml_dr.acks_pending);
|
||||
OBJ_DESTRUCT(&mca_pml_dr.recv_requests);
|
||||
OBJ_DESTRUCT(&mca_pml_base_recv_requests);
|
||||
OBJ_DESTRUCT(&mca_pml_base_send_requests);
|
||||
OBJ_DESTRUCT(&mca_pml_dr.recv_frags);
|
||||
OBJ_DESTRUCT(&mca_pml_dr.buffers);
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -67,7 +67,7 @@ OBJ_CLASS_DECLARATION(mca_pml_dr_recv_request_t);
|
||||
do { \
|
||||
ompi_free_list_item_t* item; \
|
||||
rc = OMPI_SUCCESS; \
|
||||
OMPI_FREE_LIST_GET(&mca_pml_dr.recv_requests, item, rc); \
|
||||
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item, rc); \
|
||||
recvreq = (mca_pml_dr_recv_request_t*)item; \
|
||||
} while(0)
|
||||
|
||||
@ -153,7 +153,8 @@ do {
|
||||
do { \
|
||||
/* decrement reference counts */ \
|
||||
MCA_PML_BASE_RECV_REQUEST_FINI(&(recvreq)->req_recv); \
|
||||
OMPI_FREE_LIST_RETURN(&mca_pml_dr.recv_requests, (ompi_free_list_item_t*)(recvreq)); \
|
||||
OMPI_FREE_LIST_RETURN(&mca_pml_base_recv_requests, \
|
||||
(ompi_free_list_item_t*)(recvreq)); \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
@ -254,7 +255,7 @@ do {
|
||||
(request)->req_recv.req_base.req_count, \
|
||||
(request)->req_recv.req_base.req_addr, \
|
||||
(do_csum ? CONVERTOR_WITH_CHECKSUM: 0), \
|
||||
&(request)->req_recv.req_convertor ); \
|
||||
&(request)->req_recv.req_base.req_convertor ); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@ -292,19 +293,17 @@ do {
|
||||
iov_count++; \
|
||||
} \
|
||||
} \
|
||||
ompi_convertor_set_position( \
|
||||
&(request->req_recv.req_convertor), \
|
||||
&data_offset); \
|
||||
assert((request->req_recv.req_convertor.flags & CONVERTOR_COMPLETED) == 0); \
|
||||
ompi_convertor_unpack( \
|
||||
&(request)->req_recv.req_convertor, \
|
||||
iov, \
|
||||
&iov_count, \
|
||||
&max_data); \
|
||||
ompi_convertor_set_position( &(request->req_recv.req_base.req_convertor), \
|
||||
&data_offset); \
|
||||
assert((request->req_recv.req_base.req_convertor.flags & CONVERTOR_COMPLETED) == 0); \
|
||||
ompi_convertor_unpack( &(request)->req_recv.req_base.req_convertor, \
|
||||
iov, \
|
||||
&iov_count, \
|
||||
&max_data); \
|
||||
bytes_delivered = max_data; \
|
||||
if(bytes_received && !bytes_delivered) assert(0); \
|
||||
csum = (do_csum ? \
|
||||
request->req_recv.req_convertor.checksum : OPAL_CSUM_ZERO); \
|
||||
request->req_recv.req_base.req_convertor.checksum : OPAL_CSUM_ZERO); \
|
||||
} else { \
|
||||
bytes_delivered = 0; \
|
||||
csum = OPAL_CSUM_ZERO; \
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -397,15 +397,14 @@ int mca_pml_dr_send_request_start_buffered(
|
||||
iov.iov_len = size;
|
||||
iov_count = 1;
|
||||
max_data = size;
|
||||
if((rc = ompi_convertor_pack(
|
||||
&sendreq->req_send.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
if((rc = ompi_convertor_pack( &sendreq->req_send.req_base.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
mca_bml_base_free(bml_btl, descriptor);
|
||||
return rc;
|
||||
}
|
||||
csum = sendreq->req_send.req_convertor.checksum;
|
||||
csum = sendreq->req_send.req_base.req_convertor.checksum;
|
||||
|
||||
/* update lengths */
|
||||
segment->seg_len = sizeof(mca_pml_dr_rendezvous_hdr_t) + max_data;
|
||||
@ -429,11 +428,10 @@ int mca_pml_dr_send_request_start_buffered(
|
||||
iov.iov_len = sendreq->req_send.req_bytes_packed - max_data;
|
||||
|
||||
max_data = iov.iov_len;
|
||||
if((rc = ompi_convertor_pack(
|
||||
&sendreq->req_send.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
if((rc = ompi_convertor_pack( &sendreq->req_send.req_base.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
mca_bml_base_free(bml_btl, descriptor);
|
||||
return rc;
|
||||
}
|
||||
@ -457,7 +455,7 @@ int mca_pml_dr_send_request_start_buffered(
|
||||
OPAL_CSUM_ZERO);
|
||||
|
||||
/* re-init convertor for packed data (it keep the flags) */
|
||||
ompi_convertor_prepare_for_send( &sendreq->req_send.req_convertor,
|
||||
ompi_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor,
|
||||
MPI_BYTE,
|
||||
sendreq->req_send.req_bytes_packed,
|
||||
sendreq->req_send.req_addr );
|
||||
@ -513,11 +511,10 @@ int mca_pml_dr_send_request_start_copy(
|
||||
iov_count = 1;
|
||||
max_data = size;
|
||||
if(size > 0) {
|
||||
if((rc = ompi_convertor_pack(
|
||||
&sendreq->req_send.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
if((rc = ompi_convertor_pack( &sendreq->req_send.req_base.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
mca_bml_base_free(bml_btl, descriptor);
|
||||
return rc;
|
||||
}
|
||||
@ -534,7 +531,7 @@ int mca_pml_dr_send_request_start_copy(
|
||||
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
|
||||
hdr->hdr_match.hdr_seq = sendreq->req_send.req_base.req_sequence;
|
||||
hdr->hdr_match.hdr_csum = (size > 0 && do_csum ?
|
||||
sendreq->req_send.req_convertor.checksum : OPAL_CSUM_ZERO);
|
||||
sendreq->req_send.req_base.req_convertor.checksum : OPAL_CSUM_ZERO);
|
||||
hdr->hdr_match.hdr_src_ptr.pval = &sendreq->req_vfrag0;
|
||||
hdr->hdr_common.hdr_vid = sendreq->req_vfrag0.vf_id;
|
||||
hdr->hdr_common.hdr_csum = (do_csum ?
|
||||
@ -584,14 +581,13 @@ int mca_pml_dr_send_request_start_prepare(
|
||||
(bml_btl->btl_flags & MCA_BTL_FLAGS_NEED_CSUM);
|
||||
|
||||
/* prepare descriptor */
|
||||
mca_bml_base_prepare_src(
|
||||
bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_match_hdr_t),
|
||||
&size,
|
||||
&descriptor);
|
||||
mca_bml_base_prepare_src( bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_match_hdr_t),
|
||||
&size,
|
||||
&descriptor);
|
||||
if(NULL == descriptor) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
@ -609,7 +605,7 @@ int mca_pml_dr_send_request_start_prepare(
|
||||
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
|
||||
hdr->hdr_match.hdr_seq = sendreq->req_send.req_base.req_sequence;
|
||||
hdr->hdr_match.hdr_csum = (size > 0 && do_csum ?
|
||||
sendreq->req_send.req_convertor.checksum : OPAL_CSUM_ZERO);
|
||||
sendreq->req_send.req_base.req_convertor.checksum : OPAL_CSUM_ZERO);
|
||||
hdr->hdr_match.hdr_src_ptr.pval = &sendreq->req_vfrag0;
|
||||
hdr->hdr_common.hdr_vid = sendreq->req_vfrag0.vf_id;
|
||||
hdr->hdr_common.hdr_csum = (do_csum ?
|
||||
@ -657,21 +653,18 @@ int mca_pml_dr_send_request_start_rndv(
|
||||
|
||||
/* prepare descriptor */
|
||||
if(size == 0) {
|
||||
mca_bml_base_alloc(
|
||||
bml_btl,
|
||||
&des,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_rendezvous_hdr_t)
|
||||
);
|
||||
mca_bml_base_alloc( bml_btl,
|
||||
&des,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_rendezvous_hdr_t) );
|
||||
} else {
|
||||
mca_bml_base_prepare_src(
|
||||
bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_rendezvous_hdr_t),
|
||||
&size,
|
||||
&des);
|
||||
mca_bml_base_prepare_src( bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_rendezvous_hdr_t),
|
||||
&size,
|
||||
&des);
|
||||
}
|
||||
|
||||
if(NULL == des) {
|
||||
@ -692,7 +685,7 @@ int mca_pml_dr_send_request_start_rndv(
|
||||
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
|
||||
hdr->hdr_match.hdr_seq = sendreq->req_send.req_base.req_sequence;
|
||||
hdr->hdr_match.hdr_src_ptr.pval = &sendreq->req_vfrag0;
|
||||
hdr->hdr_match.hdr_csum = size > 0 ? sendreq->req_send.req_convertor.checksum : OPAL_CSUM_ZERO;
|
||||
hdr->hdr_match.hdr_csum = size > 0 ? sendreq->req_send.req_base.req_convertor.checksum : OPAL_CSUM_ZERO;
|
||||
hdr->hdr_rndv.hdr_msg_length = sendreq->req_send.req_bytes_packed;
|
||||
hdr->hdr_common.hdr_csum = (do_csum ?
|
||||
opal_csum(hdr, sizeof(mca_pml_dr_rendezvous_hdr_t)) :
|
||||
@ -775,16 +768,14 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
|
||||
}
|
||||
|
||||
/* pack into a descriptor */
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_convertor, &offset_in_msg);
|
||||
mca_bml_base_prepare_src(
|
||||
bml_btl,
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_base.req_convertor, &offset_in_msg);
|
||||
mca_bml_base_prepare_src( bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_convertor,
|
||||
&sendreq->req_send.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_frag_hdr_t),
|
||||
&size,
|
||||
&des
|
||||
);
|
||||
&des );
|
||||
if(des == NULL) {
|
||||
OPAL_THREAD_LOCK(&ompi_request_lock);
|
||||
opal_list_remove_item(&mca_pml_dr.send_active, (opal_list_item_t*)sendreq);
|
||||
@ -806,7 +797,7 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
|
||||
hdr->hdr_common.hdr_ctx = sendreq->req_send.req_base.req_comm->c_contextid;
|
||||
hdr->hdr_vlen = vfrag->vf_len;
|
||||
hdr->hdr_frag_idx = vfrag->vf_idx;
|
||||
hdr->hdr_frag_csum = sendreq->req_send.req_convertor.checksum;
|
||||
hdr->hdr_frag_csum = sendreq->req_send.req_base.req_convertor.checksum;
|
||||
hdr->hdr_frag_offset = offset_in_msg;
|
||||
hdr->hdr_src_ptr.pval = vfrag;
|
||||
hdr->hdr_dst_ptr = sendreq->req_vfrag0.vf_recv;
|
||||
@ -900,16 +891,14 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
|
||||
}
|
||||
|
||||
/* pack into a descriptor */
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_convertor, &sendreq->req_send_offset);
|
||||
mca_bml_base_prepare_src(
|
||||
bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_frag_hdr_t),
|
||||
&size,
|
||||
&des
|
||||
);
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_base.req_convertor, &sendreq->req_send_offset);
|
||||
mca_bml_base_prepare_src( bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_dr_frag_hdr_t),
|
||||
&size,
|
||||
&des );
|
||||
if(des == NULL) {
|
||||
OPAL_THREAD_LOCK(&mca_pml_dr.lock);
|
||||
opal_list_remove_item(&mca_pml_dr.send_active, (opal_list_item_t*)sendreq);
|
||||
@ -932,7 +921,7 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
|
||||
hdr->hdr_vlen = vfrag->vf_len;
|
||||
hdr->hdr_frag_idx = vfrag->vf_idx;
|
||||
hdr->hdr_frag_csum = (do_csum ?
|
||||
sendreq->req_send.req_convertor.checksum : OPAL_CSUM_ZERO);
|
||||
sendreq->req_send.req_base.req_convertor.checksum : OPAL_CSUM_ZERO);
|
||||
hdr->hdr_frag_offset = sendreq->req_send_offset;
|
||||
hdr->hdr_src_ptr.pval = vfrag;
|
||||
hdr->hdr_dst_ptr = sendreq->req_vfrag0.vf_recv;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -79,7 +79,7 @@ OBJ_CLASS_DECLARATION(mca_pml_dr_send_request_t);
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE; \
|
||||
} else { \
|
||||
rc = OMPI_SUCCESS; \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_dr.send_requests, item, rc); \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_base_send_requests, item, rc); \
|
||||
sendreq = (mca_pml_dr_send_request_t*)item; \
|
||||
sendreq->req_send.req_base.req_proc = proc; \
|
||||
opal_list_append(&mca_pml_dr.send_active, \
|
||||
@ -130,8 +130,8 @@ do {
|
||||
(sendreq)->req_send.req_base.req_count, \
|
||||
(sendreq)->req_send.req_base.req_addr, \
|
||||
(do_csum ? CONVERTOR_WITH_CHECKSUM: 0), \
|
||||
&(sendreq)->req_send.req_convertor ); \
|
||||
ompi_convertor_get_packed_size(&(sendreq)->req_send.req_convertor, \
|
||||
&(sendreq)->req_send.req_base.req_convertor ); \
|
||||
ompi_convertor_get_packed_size(&(sendreq)->req_send.req_base.req_convertor, \
|
||||
&((sendreq)->req_send.req_bytes_packed) ); \
|
||||
/* } else { */ \
|
||||
/* (sendreq)->req_send.req_bytes_packed = 0; */ \
|
||||
@ -254,7 +254,8 @@ do {
|
||||
(0 != sendreq->req_send.req_bytes_packed) ) { \
|
||||
/* rewind convertor */ \
|
||||
size_t offset = 0; \
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_convertor, &offset); \
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_base.req_convertor, \
|
||||
&offset); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
@ -267,7 +268,7 @@ do {
|
||||
do { \
|
||||
/* Let the base handle the reference counts */ \
|
||||
MCA_PML_BASE_SEND_REQUEST_FINI((&(sendreq)->req_send)); \
|
||||
OMPI_FREE_LIST_RETURN( &mca_pml_dr.send_requests, \
|
||||
OMPI_FREE_LIST_RETURN( &mca_pml_base_send_requests, \
|
||||
(ompi_free_list_item_t*)sendreq ); \
|
||||
} while(0)
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2006-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -39,10 +39,6 @@ struct mca_pml_example_t {
|
||||
opal_list_t example_procs;
|
||||
opal_mutex_t example_lock;
|
||||
|
||||
/* free list of requests */
|
||||
ompi_free_list_t example_send_requests;
|
||||
ompi_free_list_t example_recv_requests;
|
||||
|
||||
/* list of pending send requests */
|
||||
opal_list_t example_send_pending;
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -64,8 +64,6 @@ struct mca_pml_ob1_t {
|
||||
opal_mutex_t lock;
|
||||
|
||||
/* free lists */
|
||||
ompi_free_list_t send_requests;
|
||||
ompi_free_list_t recv_requests;
|
||||
ompi_free_list_t rdma_frags;
|
||||
ompi_free_list_t recv_frags;
|
||||
ompi_free_list_t pending_pckts;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -23,8 +23,6 @@
|
||||
#include "mpi.h"
|
||||
#include "ompi/runtime/params.h"
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
#include "ompi/mca/btl/btl.h"
|
||||
#include "ompi/mca/btl/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "ompi/mca/pml/base/pml_base_bsend.h"
|
||||
#include "pml_ob1.h"
|
||||
@ -145,30 +143,7 @@ int mca_pml_ob1_component_open(void)
|
||||
}
|
||||
|
||||
OBJ_CONSTRUCT(&mca_pml_ob1.lock, opal_mutex_t);
|
||||
|
||||
/* requests */
|
||||
OBJ_CONSTRUCT(&mca_pml_ob1.send_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(
|
||||
&mca_pml_ob1.send_requests,
|
||||
sizeof(mca_pml_ob1_send_request_t) +
|
||||
(mca_pml_ob1.max_rdma_per_request - 1) * sizeof(mca_pml_ob1_com_btl_t),
|
||||
OBJ_CLASS(mca_pml_ob1_send_request_t),
|
||||
mca_pml_ob1.free_list_num,
|
||||
mca_pml_ob1.free_list_max,
|
||||
mca_pml_ob1.free_list_inc,
|
||||
NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&mca_pml_ob1.recv_requests, ompi_free_list_t);
|
||||
ompi_free_list_init(
|
||||
&mca_pml_ob1.recv_requests,
|
||||
sizeof(mca_pml_ob1_recv_request_t) +
|
||||
(mca_pml_ob1.max_rdma_per_request - 1) * sizeof(mca_pml_ob1_com_btl_t),
|
||||
OBJ_CLASS(mca_pml_ob1_recv_request_t),
|
||||
mca_pml_ob1.free_list_num,
|
||||
mca_pml_ob1.free_list_max,
|
||||
mca_pml_ob1.free_list_inc,
|
||||
NULL);
|
||||
|
||||
|
||||
/* fragments */
|
||||
OBJ_CONSTRUCT(&mca_pml_ob1.rdma_frags, ompi_free_list_t);
|
||||
ompi_free_list_init(
|
||||
@ -247,10 +222,11 @@ int mca_pml_ob1_component_close(void)
|
||||
OBJ_DESTRUCT(&mca_pml_ob1.pending_pckts);
|
||||
OBJ_DESTRUCT(&mca_pml_ob1.recv_frags);
|
||||
OBJ_DESTRUCT(&mca_pml_ob1.rdma_frags);
|
||||
OBJ_DESTRUCT(&mca_pml_ob1.recv_requests);
|
||||
OBJ_DESTRUCT(&mca_pml_ob1.send_requests);
|
||||
OBJ_DESTRUCT(&mca_pml_ob1.lock);
|
||||
|
||||
/* destroy the global free lists */
|
||||
OBJ_DESTRUCT(&mca_pml_base_send_requests);
|
||||
OBJ_DESTRUCT(&mca_pml_base_recv_requests);
|
||||
if(OMPI_SUCCESS != (rc = mca_pml_ob1.allocator->alc_finalize(mca_pml_ob1.allocator))) {
|
||||
return rc;
|
||||
}
|
||||
@ -298,6 +274,7 @@ mca_pml_base_module_t* mca_pml_ob1_component_init(int* priority,
|
||||
enable_mpi_threads)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* As our own progress function does nothing except calling the BML
|
||||
* progress, let's modify the progress function pointer in our structure
|
||||
* to avoid useless functions calls. The event library will instead call
|
||||
@ -305,10 +282,32 @@ mca_pml_base_module_t* mca_pml_ob1_component_init(int* priority,
|
||||
*/
|
||||
mca_pml_ob1.super.pml_progress = mca_bml.bml_progress;
|
||||
|
||||
/**
|
||||
* If we get here this is the PML who get selected for the run. We
|
||||
* should get ownership for the send and receive requests list, and
|
||||
* initialize them with the size of our own requests.
|
||||
*/
|
||||
OBJ_CONSTRUCT(&mca_pml_base_send_requests, ompi_free_list_t);
|
||||
ompi_free_list_init( &mca_pml_base_send_requests,
|
||||
sizeof(mca_pml_ob1_send_request_t),
|
||||
OBJ_CLASS(mca_pml_ob1_send_request_t),
|
||||
mca_pml_ob1.free_list_num,
|
||||
mca_pml_ob1.free_list_max,
|
||||
mca_pml_ob1.free_list_inc,
|
||||
NULL );
|
||||
|
||||
OBJ_CONSTRUCT(&mca_pml_base_recv_requests, ompi_free_list_t);
|
||||
ompi_free_list_init( &mca_pml_base_recv_requests,
|
||||
sizeof(mca_pml_ob1_recv_request_t),
|
||||
OBJ_CLASS(mca_pml_ob1_recv_request_t),
|
||||
mca_pml_ob1.free_list_num,
|
||||
mca_pml_ob1.free_list_max,
|
||||
mca_pml_ob1.free_list_inc,
|
||||
NULL );
|
||||
|
||||
return &mca_pml_ob1.super;
|
||||
}
|
||||
|
||||
|
||||
void *mca_pml_ob1_seg_alloc( struct mca_mpool_base_module_t* mpool,
|
||||
size_t* size,
|
||||
mca_mpool_base_registration_t** registration) {
|
||||
|
@ -135,7 +135,7 @@ void mca_pml_ob1_recv_frag_callback(
|
||||
if(sendreq->req_bytes_delivered == hdr->hdr_ack.hdr_send_offset)
|
||||
sendreq->req_throttle_sends = true;
|
||||
|
||||
mca_pml_ob1_send_requst_copy_in_out(sendreq,
|
||||
mca_pml_ob1_send_request_copy_in_out(sendreq,
|
||||
hdr->hdr_ack.hdr_send_offset,
|
||||
sendreq->req_send.req_bytes_packed -
|
||||
hdr->hdr_ack.hdr_send_offset);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -246,11 +246,11 @@ static int mca_pml_ob1_recv_request_ack(
|
||||
* registered.
|
||||
*/
|
||||
|
||||
if(ompi_convertor_need_buffers(&recvreq->req_recv.req_convertor) == 0 &&
|
||||
if(ompi_convertor_need_buffers(&recvreq->req_recv.req_base.req_convertor) == 0 &&
|
||||
hdr->hdr_match.hdr_common.hdr_flags & MCA_PML_OB1_HDR_FLAGS_CONTIG &&
|
||||
rdma_num != 0) {
|
||||
unsigned char *base;
|
||||
ompi_convertor_get_current_pointer( &recvreq->req_recv.req_convertor, (void**)&(base) );
|
||||
ompi_convertor_get_current_pointer( &recvreq->req_recv.req_base.req_convertor, (void**)&(base) );
|
||||
|
||||
recvreq->req_rdma_cnt = mca_pml_ob1_rdma_btls( bml_endpoint,
|
||||
base,
|
||||
@ -273,7 +273,7 @@ static int mca_pml_ob1_recv_request_ack(
|
||||
|
||||
/* use converter to figure out the rdma offset for this
|
||||
* request */
|
||||
ompi_convertor_set_position(&recvreq->req_recv.req_convertor,
|
||||
ompi_convertor_set_position(&recvreq->req_recv.req_base.req_convertor,
|
||||
&recvreq->req_send_offset);
|
||||
|
||||
recvreq->req_rdma_cnt =
|
||||
@ -339,8 +339,7 @@ static void mca_pml_ob1_rget_completion(
|
||||
/*
|
||||
*
|
||||
*/
|
||||
int mca_pml_ob1_recv_request_get_frag(
|
||||
mca_pml_ob1_rdma_frag_t* frag)
|
||||
int mca_pml_ob1_recv_request_get_frag( mca_pml_ob1_rdma_frag_t* frag )
|
||||
{
|
||||
mca_pml_ob1_recv_request_t* recvreq = (mca_pml_ob1_recv_request_t*)frag->rdma_req;
|
||||
mca_bml_base_btl_t* bml_btl = frag->rdma_bml;
|
||||
@ -349,15 +348,14 @@ int mca_pml_ob1_recv_request_get_frag(
|
||||
int rc;
|
||||
|
||||
/* prepare descriptor */
|
||||
mca_bml_base_prepare_dst(
|
||||
bml_btl,
|
||||
NULL,
|
||||
&recvreq->req_recv.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
0,
|
||||
&frag->rdma_length,
|
||||
&descriptor);
|
||||
if(NULL == descriptor) {
|
||||
mca_bml_base_prepare_dst( bml_btl,
|
||||
NULL,
|
||||
&recvreq->req_recv.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
0,
|
||||
&frag->rdma_length,
|
||||
&descriptor );
|
||||
if( OPAL_UNLIKELY(NULL == descriptor) ) {
|
||||
frag->rdma_length = save_size;
|
||||
OPAL_THREAD_LOCK(&mca_pml_ob1.lock);
|
||||
opal_list_append(&mca_pml_ob1.rdma_pending, (opal_list_item_t*)frag);
|
||||
@ -406,13 +404,13 @@ static void mca_pml_ob1_recv_request_rget(
|
||||
* fall back to copy in/out protocol. It is a pity because buffer on the
|
||||
* sender side is already registered. We need to ne smarter here, perhaps
|
||||
* do couple of RDMA reads */
|
||||
if(ompi_convertor_need_buffers(&recvreq->req_recv.req_convertor) == true) {
|
||||
if(ompi_convertor_need_buffers(&recvreq->req_recv.req_base.req_convertor) == true) {
|
||||
mca_pml_ob1_recv_request_ack(recvreq, &hdr->hdr_rndv, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
MCA_PML_OB1_RDMA_FRAG_ALLOC(frag,rc);
|
||||
if(NULL == frag) {
|
||||
if( OPAL_UNLIKELY(NULL == frag) ) {
|
||||
/* GLB - FIX */
|
||||
ORTE_ERROR_LOG(rc);
|
||||
orte_errmgr.abort();
|
||||
@ -651,7 +649,7 @@ int mca_pml_ob1_recv_request_schedule_exclusive(
|
||||
prev_bytes_remaining = bytes_remaining;
|
||||
}
|
||||
|
||||
ompi_convertor_set_position(&recvreq->req_recv.req_convertor,
|
||||
ompi_convertor_set_position(&recvreq->req_recv.req_base.req_convertor,
|
||||
&recvreq->req_rdma_offset);
|
||||
|
||||
do {
|
||||
@ -673,9 +671,9 @@ int mca_pml_ob1_recv_request_schedule_exclusive(
|
||||
|
||||
/* prepare a descriptor for RDMA */
|
||||
mca_bml_base_prepare_dst(bml_btl, reg,
|
||||
&recvreq->req_recv.req_convertor,
|
||||
&recvreq->req_recv.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER, 0, &size, &dst);
|
||||
if(dst == NULL) {
|
||||
if( OPAL_UNLIKELY(dst == NULL) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -69,7 +69,7 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_recv_request_t);
|
||||
do { \
|
||||
ompi_free_list_item_t* item; \
|
||||
rc = OMPI_SUCCESS; \
|
||||
OMPI_FREE_LIST_GET(&mca_pml_ob1.recv_requests, item, rc); \
|
||||
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item, rc); \
|
||||
recvreq = (mca_pml_ob1_recv_request_t*)item; \
|
||||
} while(0)
|
||||
|
||||
@ -164,12 +164,12 @@ do {
|
||||
/*
|
||||
* Free the PML receive request
|
||||
*/
|
||||
#define MCA_PML_OB1_RECV_REQUEST_RETURN(recvreq) \
|
||||
{ \
|
||||
MCA_PML_BASE_RECV_REQUEST_FINI(&(recvreq)->req_recv); \
|
||||
OMPI_FREE_LIST_RETURN( &mca_pml_ob1.recv_requests, \
|
||||
(ompi_free_list_item_t*)(recvreq)); \
|
||||
}
|
||||
#define MCA_PML_OB1_RECV_REQUEST_RETURN(recvreq) \
|
||||
{ \
|
||||
MCA_PML_BASE_RECV_REQUEST_FINI(&(recvreq)->req_recv); \
|
||||
OMPI_FREE_LIST_RETURN( &mca_pml_base_recv_requests, \
|
||||
(ompi_free_list_item_t*)(recvreq)); \
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to match the request against the unexpected fragment list
|
||||
@ -226,8 +226,8 @@ do {
|
||||
(request)->req_recv.req_base.req_count, \
|
||||
(request)->req_recv.req_base.req_addr, \
|
||||
0, \
|
||||
&(request)->req_recv.req_convertor ); \
|
||||
ompi_convertor_get_unpacked_size( &(request)->req_recv.req_convertor, \
|
||||
&(request)->req_recv.req_base.req_convertor ); \
|
||||
ompi_convertor_get_unpacked_size( &(request)->req_recv.req_base.req_convertor, \
|
||||
&(request)->req_bytes_delivered ); \
|
||||
} \
|
||||
mca_pml_ob1_recv_request_match_specific(request); \
|
||||
@ -255,8 +255,8 @@ do {
|
||||
(request)->req_recv.req_base.req_count, \
|
||||
(request)->req_recv.req_base.req_addr, \
|
||||
0, \
|
||||
&(request)->req_recv.req_convertor ); \
|
||||
ompi_convertor_get_unpacked_size( &(request)->req_recv.req_convertor, \
|
||||
&(request)->req_recv.req_base.req_convertor ); \
|
||||
ompi_convertor_get_unpacked_size( &(request)->req_recv.req_base.req_convertor, \
|
||||
&(request)->req_bytes_delivered ); \
|
||||
} \
|
||||
PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_XFER_BEGIN, \
|
||||
@ -298,9 +298,9 @@ do {
|
||||
PERUSE_TRACE_COMM_OMPI_EVENT (PERUSE_COMM_REQ_XFER_CONTINUE, \
|
||||
&(recvreq->req_recv.req_base), max_data, \
|
||||
PERUSE_RECV); \
|
||||
ompi_convertor_set_position( &(request->req_recv.req_convertor), \
|
||||
ompi_convertor_set_position( &(request->req_recv.req_base.req_convertor), \
|
||||
&data_offset ); \
|
||||
ompi_convertor_unpack( &(request)->req_recv.req_convertor, \
|
||||
ompi_convertor_unpack( &(request)->req_recv.req_base.req_convertor, \
|
||||
iov, \
|
||||
&iov_count, \
|
||||
&max_data ); \
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -403,11 +403,10 @@ int mca_pml_ob1_send_request_start_buffered(
|
||||
iov.iov_len = size;
|
||||
iov_count = 1;
|
||||
max_data = size;
|
||||
if((rc = ompi_convertor_pack(
|
||||
&sendreq->req_send.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
if((rc = ompi_convertor_pack( &sendreq->req_send.req_base.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
mca_bml_base_free(bml_btl, descriptor);
|
||||
return rc;
|
||||
}
|
||||
@ -454,7 +453,7 @@ int mca_pml_ob1_send_request_start_buffered(
|
||||
iov.iov_base = (IOVBASE_TYPE*)(((unsigned char*)sendreq->req_send.req_addr) + max_data);
|
||||
iov.iov_len = max_data = sendreq->req_send.req_bytes_packed - max_data;
|
||||
|
||||
if((rc = ompi_convertor_pack( &sendreq->req_send.req_convertor,
|
||||
if((rc = ompi_convertor_pack( &sendreq->req_send.req_base.req_convertor,
|
||||
&iov,
|
||||
&iov_count,
|
||||
&max_data)) < 0) {
|
||||
@ -463,7 +462,7 @@ int mca_pml_ob1_send_request_start_buffered(
|
||||
}
|
||||
|
||||
/* re-init convertor for packed data */
|
||||
ompi_convertor_prepare_for_send( &sendreq->req_send.req_convertor,
|
||||
ompi_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor,
|
||||
MPI_BYTE,
|
||||
sendreq->req_send.req_bytes_packed,
|
||||
sendreq->req_send.req_addr );
|
||||
@ -522,7 +521,7 @@ int mca_pml_ob1_send_request_start_copy( mca_pml_ob1_send_request_t* sendreq,
|
||||
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)segment->seg_addr.pval + sizeof(mca_pml_ob1_match_hdr_t));
|
||||
iov.iov_len = size;
|
||||
iov_count = 1;
|
||||
(void)ompi_convertor_pack( &sendreq->req_send.req_convertor,
|
||||
(void)ompi_convertor_pack( &sendreq->req_send.req_base.req_convertor,
|
||||
&iov, &iov_count, &max_data );
|
||||
descriptor->des_cbfunc = mca_pml_ob1_match_completion_free;
|
||||
}
|
||||
@ -590,7 +589,7 @@ int mca_pml_ob1_send_request_start_prepare( mca_pml_ob1_send_request_t* sendreq,
|
||||
/* prepare descriptor */
|
||||
mca_bml_base_prepare_src( bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_convertor,
|
||||
&sendreq->req_send.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_ob1_match_hdr_t),
|
||||
&size,
|
||||
@ -667,19 +666,18 @@ int mca_pml_ob1_send_request_start_rdma(
|
||||
bml_btl = sendreq->req_rdma[0].bml_btl;
|
||||
if(sendreq->req_rdma_cnt == 1 &&
|
||||
bml_btl->btl_flags & MCA_BTL_FLAGS_GET) {
|
||||
size_t old_position = sendreq->req_send.req_convertor.bConverted;
|
||||
size_t old_position = sendreq->req_send.req_base.req_convertor.bConverted;
|
||||
|
||||
/* prepare source descriptor/segment(s) */
|
||||
mca_bml_base_prepare_src(
|
||||
bml_btl,
|
||||
reg,
|
||||
&sendreq->req_send.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
0,
|
||||
&size,
|
||||
&src);
|
||||
if(NULL == src) {
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_convertor,
|
||||
mca_bml_base_prepare_src( bml_btl,
|
||||
reg,
|
||||
&sendreq->req_send.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
0,
|
||||
&size,
|
||||
&src );
|
||||
if( OPAL_UNLIKELY(NULL == src) ) {
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_base.req_convertor,
|
||||
&old_position);
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
@ -690,7 +688,7 @@ int mca_pml_ob1_send_request_start_rdma(
|
||||
mca_bml_base_alloc(bml_btl, &des, MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_ob1_rget_hdr_t) + (sizeof(mca_btl_base_segment_t)*(src->des_src_cnt-1)));
|
||||
if(NULL == des) {
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_convertor,
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_base.req_convertor,
|
||||
&old_position);
|
||||
mca_bml_base_free(bml_btl, src);
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
@ -818,24 +816,21 @@ int mca_pml_ob1_send_request_start_rndv(
|
||||
|
||||
/* prepare descriptor */
|
||||
if(size == 0) {
|
||||
mca_bml_base_alloc(
|
||||
bml_btl,
|
||||
&des,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_ob1_rendezvous_hdr_t)
|
||||
);
|
||||
mca_bml_base_alloc( bml_btl,
|
||||
&des,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_ob1_rendezvous_hdr_t) );
|
||||
} else {
|
||||
mca_bml_base_prepare_src(
|
||||
bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_ob1_rendezvous_hdr_t),
|
||||
&size,
|
||||
&des);
|
||||
mca_bml_base_prepare_src( bml_btl,
|
||||
NULL,
|
||||
&sendreq->req_send.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_ob1_rendezvous_hdr_t),
|
||||
&size,
|
||||
&des );
|
||||
}
|
||||
|
||||
if(NULL == des) {
|
||||
if( NULL == des ) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
segment = des->des_src;
|
||||
@ -878,7 +873,7 @@ int mca_pml_ob1_send_request_start_rndv(
|
||||
return rc;
|
||||
}
|
||||
|
||||
void mca_pml_ob1_send_requst_copy_in_out(mca_pml_ob1_send_request_t *sendreq,
|
||||
void mca_pml_ob1_send_request_copy_in_out(mca_pml_ob1_send_request_t *sendreq,
|
||||
uint64_t send_offset, uint64_t send_length)
|
||||
{
|
||||
mca_pml_ob1_send_range_t *sr;
|
||||
@ -995,15 +990,15 @@ int mca_pml_ob1_send_request_schedule_exclusive(
|
||||
|
||||
/* pack into a descriptor */
|
||||
offset = (size_t)range->range_send_offset;
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_convertor,
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_base.req_convertor,
|
||||
&offset);
|
||||
range->range_send_offset = (uint64_t)offset;
|
||||
|
||||
mca_bml_base_prepare_src(bml_btl, NULL,
|
||||
&sendreq->req_send.req_convertor,
|
||||
&sendreq->req_send.req_base.req_convertor,
|
||||
MCA_BTL_NO_ORDER,
|
||||
sizeof(mca_pml_ob1_frag_hdr_t), &size, &des);
|
||||
if(des == NULL) {
|
||||
if( OPAL_UNLIKELY(des == NULL) ) {
|
||||
continue;
|
||||
}
|
||||
des->des_cbfunc = mca_pml_ob1_frag_completion;
|
||||
@ -1143,7 +1138,7 @@ int mca_pml_ob1_send_request_put_frag( mca_pml_ob1_rdma_frag_t* frag )
|
||||
MCA_BTL_NO_ORDER, 1);
|
||||
|
||||
/* send fragment by copy in/out */
|
||||
mca_pml_ob1_send_requst_copy_in_out(sendreq,
|
||||
mca_pml_ob1_send_request_copy_in_out(sendreq,
|
||||
frag->rdma_hdr.hdr_rdma.hdr_rdma_offset, frag->rdma_length);
|
||||
mca_pml_ob1_send_request_schedule(sendreq);
|
||||
}
|
||||
@ -1233,8 +1228,9 @@ void mca_pml_ob1_send_request_put( mca_pml_ob1_send_request_t* sendreq,
|
||||
* create clone of the convertor for each RDMA fragment
|
||||
*/
|
||||
size = hdr->hdr_rdma_offset;
|
||||
ompi_convertor_clone_with_position(&sendreq->req_send.req_convertor,
|
||||
ompi_convertor_clone_with_position(&sendreq->req_send.req_base.req_convertor,
|
||||
&frag->convertor, 0, &size);
|
||||
|
||||
mca_pml_ob1_send_request_put_frag(frag);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -75,47 +75,44 @@ struct mca_pml_ob1_send_range_t {
|
||||
typedef struct mca_pml_ob1_send_range_t mca_pml_ob1_send_range_t;
|
||||
OBJ_CLASS_DECLARATION(mca_pml_ob1_send_range_t);
|
||||
|
||||
#define MCA_PML_OB1_SEND_REQUEST_ALLOC( \
|
||||
comm, \
|
||||
dst, \
|
||||
sendreq, \
|
||||
rc) \
|
||||
{ \
|
||||
ompi_proc_t *proc = ompi_comm_peer_lookup( comm, dst ); \
|
||||
ompi_free_list_item_t* item; \
|
||||
\
|
||||
if(NULL == proc) { \
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE; \
|
||||
} else { \
|
||||
rc = OMPI_SUCCESS; \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_ob1.send_requests, item, rc); \
|
||||
sendreq = (mca_pml_ob1_send_request_t*)item; \
|
||||
sendreq->req_send.req_base.req_proc = proc; \
|
||||
} \
|
||||
}
|
||||
#define MCA_PML_OB1_SEND_REQUEST_ALLOC( comm, \
|
||||
dst, \
|
||||
sendreq, \
|
||||
rc) \
|
||||
{ \
|
||||
ompi_proc_t *proc = ompi_comm_peer_lookup( comm, dst ); \
|
||||
ompi_free_list_item_t* item; \
|
||||
\
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE; \
|
||||
if( OPAL_LIKELY(NULL != proc) ) { \
|
||||
rc = OMPI_SUCCESS; \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_base_send_requests, item, rc); \
|
||||
sendreq = (mca_pml_ob1_send_request_t*)item; \
|
||||
sendreq->req_send.req_base.req_proc = proc; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define MCA_PML_OB1_SEND_REQUEST_INIT( \
|
||||
sendreq, \
|
||||
buf, \
|
||||
count, \
|
||||
datatype, \
|
||||
dst, \
|
||||
tag, \
|
||||
comm, \
|
||||
sendmode, \
|
||||
persistent) \
|
||||
{ \
|
||||
MCA_PML_BASE_SEND_REQUEST_INIT(&sendreq->req_send, \
|
||||
buf, \
|
||||
count, \
|
||||
datatype, \
|
||||
dst, \
|
||||
tag, \
|
||||
comm, \
|
||||
sendmode, \
|
||||
persistent); \
|
||||
}
|
||||
#define MCA_PML_OB1_SEND_REQUEST_INIT( sendreq, \
|
||||
buf, \
|
||||
count, \
|
||||
datatype, \
|
||||
dst, \
|
||||
tag, \
|
||||
comm, \
|
||||
sendmode, \
|
||||
persistent) \
|
||||
{ \
|
||||
MCA_PML_BASE_SEND_REQUEST_INIT(&sendreq->req_send, \
|
||||
buf, \
|
||||
count, \
|
||||
datatype, \
|
||||
dst, \
|
||||
tag, \
|
||||
comm, \
|
||||
sendmode, \
|
||||
persistent); \
|
||||
}
|
||||
|
||||
|
||||
static inline void mca_pml_ob1_free_rdma_resources(mca_pml_ob1_send_request_t* sendreq)
|
||||
@ -226,12 +223,12 @@ static inline void mca_pml_ob1_send_request_schedule(
|
||||
* Release resources associated with a request
|
||||
*/
|
||||
|
||||
#define MCA_PML_OB1_SEND_REQUEST_RETURN(sendreq) \
|
||||
{ \
|
||||
/* Let the base handle the reference counts */ \
|
||||
MCA_PML_BASE_SEND_REQUEST_FINI((&(sendreq)->req_send)); \
|
||||
OMPI_FREE_LIST_RETURN( \
|
||||
&mca_pml_ob1.send_requests, (ompi_free_list_item_t*)sendreq); \
|
||||
#define MCA_PML_OB1_SEND_REQUEST_RETURN(sendreq) \
|
||||
{ \
|
||||
/* Let the base handle the reference counts */ \
|
||||
MCA_PML_BASE_SEND_REQUEST_FINI((&(sendreq)->req_send)); \
|
||||
OMPI_FREE_LIST_RETURN( &mca_pml_base_send_requests, \
|
||||
(ompi_free_list_item_t*)sendreq); \
|
||||
}
|
||||
|
||||
/**
|
||||
@ -296,9 +293,9 @@ static inline int mca_pml_ob1_send_request_start_btl(
|
||||
if(sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) {
|
||||
rc = mca_pml_ob1_send_request_start_buffered(sendreq, bml_btl, size);
|
||||
} else if
|
||||
(ompi_convertor_need_buffers(&sendreq->req_send.req_convertor) == false) {
|
||||
(ompi_convertor_need_buffers(&sendreq->req_send.req_base.req_convertor) == false) {
|
||||
unsigned char *base;
|
||||
ompi_convertor_get_current_pointer( &sendreq->req_send.req_convertor, (void**)&base );
|
||||
ompi_convertor_get_current_pointer( &sendreq->req_send.req_base.req_convertor, (void**)&base );
|
||||
|
||||
if( 0 != (sendreq->req_rdma_cnt = (uint32_t)mca_pml_ob1_rdma_btls(
|
||||
sendreq->req_endpoint,
|
||||
@ -404,10 +401,10 @@ int mca_pml_ob1_send_request_put_frag(mca_pml_ob1_rdma_frag_t* frag);
|
||||
* should be considered for sending packets */
|
||||
void mca_pml_ob1_send_request_process_pending(mca_bml_base_btl_t *bml_btl);
|
||||
|
||||
void mca_pml_ob1_send_requst_copy_in_out(mca_pml_ob1_send_request_t *sendreq,
|
||||
void mca_pml_ob1_send_request_copy_in_out(mca_pml_ob1_send_request_t *sendreq,
|
||||
uint64_t send_offset, uint64_t send_length);
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* !defined(OMPI_PML_OB1_SEND_REQUEST_H) */
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
@ -117,7 +117,7 @@ int mca_pml_ob1_start(size_t count, ompi_request_t** requests)
|
||||
* Reset the convertor in case we're dealing with the original
|
||||
* request, which when completed do not reset the convertor.
|
||||
*/
|
||||
ompi_convertor_set_position( &sendreq->req_send.req_convertor,
|
||||
ompi_convertor_set_position( &sendreq->req_send.req_base.req_convertor,
|
||||
&offset );
|
||||
}
|
||||
MCA_PML_OB1_SEND_REQUEST_START(sendreq, rc);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user