Mostly fixes for tabs, spaces and indentations.
Also, some other changes to bring the csum PML up to date with changes that happened in ob1 over the last two years. This includes a few bug fixes and some minor refactoring. This commit was SVN r23757.
Этот коммит содержится в:
родитель
9a47ca1995
Коммит
65e8277add
@ -202,7 +202,7 @@ int mca_pml_csum_add_comm(ompi_communicator_t* comm)
|
||||
OBJ_RELEASE(pml_comm);
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
|
||||
mca_pml_csum_comm_init_size(pml_comm, comm->c_remote_group->grp_proc_count);
|
||||
comm->c_pml_comm = pml_comm;
|
||||
|
||||
@ -281,7 +281,7 @@ int mca_pml_csum_del_comm(ompi_communicator_t* comm)
|
||||
{
|
||||
mca_pml_csum_comm_t* pml_comm = comm->c_pml_comm;
|
||||
int i;
|
||||
|
||||
|
||||
for( i = 0; i < comm->c_remote_group->grp_proc_count; i++ ) {
|
||||
OBJ_RELEASE(pml_comm->procs[i].ompi_proc);
|
||||
}
|
||||
@ -497,14 +497,14 @@ static void mca_pml_csum_fin_completion( mca_btl_base_module_t* btl,
|
||||
*/
|
||||
int mca_pml_csum_send_fin( ompi_proc_t* proc,
|
||||
mca_bml_base_btl_t* bml_btl,
|
||||
void *hdr_des,
|
||||
ompi_ptr_t hdr_des,
|
||||
uint8_t order,
|
||||
uint32_t status )
|
||||
{
|
||||
mca_btl_base_descriptor_t* fin;
|
||||
mca_pml_csum_fin_hdr_t* hdr;
|
||||
int rc;
|
||||
|
||||
|
||||
mca_bml_base_alloc(bml_btl, &fin, order, sizeof(mca_pml_csum_fin_hdr_t),
|
||||
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
|
||||
|
||||
@ -520,8 +520,9 @@ int mca_pml_csum_send_fin( ompi_proc_t* proc,
|
||||
hdr->hdr_common.hdr_flags = 0;
|
||||
hdr->hdr_common.hdr_type = MCA_PML_CSUM_HDR_TYPE_FIN;
|
||||
hdr->hdr_common.hdr_csum = 0;
|
||||
hdr->hdr_des.pval = hdr_des;
|
||||
hdr->hdr_des = hdr_des;
|
||||
hdr->hdr_fail = status;
|
||||
|
||||
hdr->hdr_common.hdr_csum = opal_csum16(hdr, sizeof(mca_pml_csum_fin_hdr_t));
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((1, mca_pml_base_output,
|
||||
@ -568,7 +569,7 @@ void mca_pml_csum_process_pending_packets(mca_bml_base_btl_t* bml_btl)
|
||||
if(NULL == send_dst) {
|
||||
OPAL_THREAD_LOCK(&mca_pml_csum.lock);
|
||||
opal_list_append(&mca_pml_csum.pckt_pending,
|
||||
(opal_list_item_t*)pckt);
|
||||
(opal_list_item_t*)pckt);
|
||||
OPAL_THREAD_UNLOCK(&mca_pml_csum.lock);
|
||||
continue;
|
||||
}
|
||||
@ -591,7 +592,7 @@ void mca_pml_csum_process_pending_packets(mca_bml_base_btl_t* bml_btl)
|
||||
break;
|
||||
case MCA_PML_CSUM_HDR_TYPE_FIN:
|
||||
rc = mca_pml_csum_send_fin(pckt->proc, send_dst,
|
||||
pckt->hdr.hdr_fin.hdr_des.pval,
|
||||
pckt->hdr.hdr_fin.hdr_des,
|
||||
pckt->order,
|
||||
pckt->hdr.hdr_fin.hdr_fail);
|
||||
if( OPAL_UNLIKELY(OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc)) ) {
|
||||
@ -634,7 +635,7 @@ void mca_pml_csum_process_pending_rdma(void)
|
||||
|
||||
void mca_pml_csum_error_handler(
|
||||
struct mca_btl_base_module_t* btl, int32_t flags,
|
||||
ompi_proc_t* errproc, char* btlinfo) {
|
||||
ompi_proc_t* errproc, char* btlinfo ) {
|
||||
orte_errmgr.abort(-1, NULL);
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
* Copyright (c) 2009 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2009 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -83,6 +84,7 @@ struct mca_pml_csum_t {
|
||||
typedef struct mca_pml_csum_t mca_pml_csum_t;
|
||||
|
||||
extern mca_pml_csum_t mca_pml_csum;
|
||||
extern int mca_pml_csum_output;
|
||||
|
||||
/*
|
||||
* PML interface functions.
|
||||
@ -212,7 +214,7 @@ do { \
|
||||
\
|
||||
MCA_PML_CSUM_PCKT_PENDING_ALLOC(_pckt,_rc); \
|
||||
_pckt->hdr.hdr_common.hdr_type = MCA_PML_CSUM_HDR_TYPE_FIN; \
|
||||
_pckt->hdr.hdr_fin.hdr_des.pval = (D); \
|
||||
_pckt->hdr.hdr_fin.hdr_des = (D); \
|
||||
_pckt->hdr.hdr_fin.hdr_fail = (S); \
|
||||
_pckt->proc = (P); \
|
||||
_pckt->bml_btl = (B); \
|
||||
@ -225,7 +227,7 @@ do { \
|
||||
|
||||
|
||||
int mca_pml_csum_send_fin(ompi_proc_t* proc, mca_bml_base_btl_t* bml_btl,
|
||||
void *hdr_des, uint8_t order, uint32_t status);
|
||||
ompi_ptr_t hdr_des, uint8_t order, uint32_t status);
|
||||
|
||||
/* This function tries to resend FIN/ACK packets from pckt_pending queue.
|
||||
* Packets are added to the queue when sending of FIN or ACK is failed due to
|
||||
|
@ -14,6 +14,7 @@
|
||||
* Copyright (c) 2009 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -51,6 +52,7 @@ static mca_pml_base_module_t*
|
||||
mca_pml_csum_component_init( int* priority, bool enable_progress_threads,
|
||||
bool enable_mpi_threads );
|
||||
static int mca_pml_csum_component_fini(void);
|
||||
int mca_pml_csum_output = 0;
|
||||
|
||||
mca_pml_base_component_2_0_0_t mca_pml_csum_component = {
|
||||
|
||||
@ -96,8 +98,13 @@ static inline int mca_pml_csum_param_register_int(
|
||||
|
||||
static int mca_pml_csum_component_open(void)
|
||||
{
|
||||
int value;
|
||||
mca_allocator_base_component_t* allocator_component;
|
||||
|
||||
value = mca_pml_csum_param_register_int("verbose", 0);
|
||||
mca_pml_csum_output = opal_output_open(NULL);
|
||||
opal_output_set_verbosity(mca_pml_csum_output, value);
|
||||
|
||||
mca_pml_csum.free_list_num =
|
||||
mca_pml_csum_param_register_int("free_list_num", 4);
|
||||
mca_pml_csum.free_list_max =
|
||||
@ -163,7 +170,8 @@ mca_pml_csum_component_init( int* priority,
|
||||
bool enable_progress_threads,
|
||||
bool enable_mpi_threads )
|
||||
{
|
||||
opal_output_verbose( 10, 0, "in csum, my priority is 0\n");
|
||||
opal_output_verbose( 10, mca_pml_csum_output,
|
||||
"in csum, my priority is 0\n");
|
||||
|
||||
/* select us only if we are specified */
|
||||
if((*priority) > 0) {
|
||||
@ -171,18 +179,18 @@ mca_pml_csum_component_init( int* priority,
|
||||
return NULL;
|
||||
}
|
||||
*priority = 0;
|
||||
|
||||
|
||||
if(OMPI_SUCCESS != mca_bml_base_init( enable_progress_threads,
|
||||
enable_mpi_threads)) {
|
||||
enable_mpi_threads)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Set this here (vs in component_open()) because
|
||||
ompi_mpi_leave_pinned* may have been set after MCA params were
|
||||
read (e.g., by the openib btl) */
|
||||
ompi_mpi_leave_pinned* may have been set after MCA params were
|
||||
read (e.g., by the openib btl) */
|
||||
mca_pml_csum.leave_pinned = (1 == ompi_mpi_leave_pinned);
|
||||
mca_pml_csum.leave_pinned_pipeline = (int) ompi_mpi_leave_pinned_pipeline;
|
||||
|
||||
|
||||
return &mca_pml_csum.super;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -29,4 +30,5 @@ BEGIN_C_DECLS
|
||||
OMPI_MODULE_DECLSPEC extern mca_pml_base_component_2_0_0_t mca_pml_csum_component;
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -58,10 +59,10 @@ size_t mca_pml_csum_rdma_btls(
|
||||
mca_bml_base_btl_t* bml_btl =
|
||||
mca_bml_base_btl_array_get_index(&bml_endpoint->btl_rdma,
|
||||
(bml_endpoint->btl_rdma_index + n) % num_btls);
|
||||
mca_mpool_base_registration_t* reg = NULL;
|
||||
mca_mpool_base_registration_t* reg = &pml_csum_dummy_reg;
|
||||
mca_mpool_base_module_t *btl_mpool = bml_btl->btl->btl_mpool;
|
||||
|
||||
if(NULL != btl_mpool) {
|
||||
if( NULL != btl_mpool ) {
|
||||
if(!mca_pml_csum.leave_pinned) {
|
||||
/* look through existing registrations */
|
||||
btl_mpool->mpool_find(btl_mpool, base, size, ®);
|
||||
@ -71,18 +72,13 @@ size_t mca_pml_csum_rdma_btls(
|
||||
}
|
||||
|
||||
if(NULL == reg)
|
||||
bml_btl = NULL; /* skip it */
|
||||
} else {
|
||||
/* if registration is not required use dummy registration */
|
||||
reg = &pml_csum_dummy_reg;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(bml_btl != NULL) {
|
||||
rdma_btls[num_btls_used].bml_btl = bml_btl;
|
||||
rdma_btls[num_btls_used].btl_reg = reg;
|
||||
weight_total += bml_btl->btl_weight;
|
||||
num_btls_used++;
|
||||
}
|
||||
rdma_btls[num_btls_used].bml_btl = bml_btl;
|
||||
rdma_btls[num_btls_used].btl_reg = reg;
|
||||
weight_total += bml_btl->btl_weight;
|
||||
num_btls_used++;
|
||||
}
|
||||
|
||||
/* if we don't use leave_pinned and all BTLs that already have this memory
|
||||
@ -92,7 +88,7 @@ size_t mca_pml_csum_rdma_btls(
|
||||
return 0;
|
||||
|
||||
mca_pml_csum_calc_weighted_length(rdma_btls, num_btls_used, size,
|
||||
weight_total);
|
||||
weight_total);
|
||||
|
||||
bml_endpoint->btl_rdma_index = (bml_endpoint->btl_rdma_index + 1) % num_btls;
|
||||
return num_btls_used;
|
||||
|
@ -15,6 +15,7 @@
|
||||
* Copyright (c) 2009 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -91,8 +92,8 @@ static void dump_csum_error_data(mca_btl_base_segment_t* segments, size_t num_se
|
||||
|
||||
/**
|
||||
* Append a unexpected descriptor to a queue. This function will allocate and
|
||||
* initialize the fragment (if necessary) and the will added to the specified
|
||||
* queue. The frag will be updated to the allocated fragment if necessary.
|
||||
* initialize the fragment (if necessary) and then will add it to the specified
|
||||
* queue. The allocated fragment is not returned to the caller.
|
||||
*/
|
||||
static void
|
||||
append_frag_to_list(opal_list_t *queue, mca_btl_base_module_t *btl,
|
||||
@ -124,23 +125,24 @@ static int mca_pml_csum_recv_frag_match( mca_btl_base_module_t *btl,
|
||||
size_t num_segments,
|
||||
int type);
|
||||
|
||||
static mca_pml_csum_recv_request_t *match_one(mca_btl_base_module_t *btl,
|
||||
mca_pml_csum_match_hdr_t *hdr, mca_btl_base_segment_t* segments,
|
||||
size_t num_segments, ompi_communicator_t *comm_ptr,
|
||||
mca_pml_csum_comm_proc_t *proc,
|
||||
mca_pml_csum_recv_frag_t* frag);
|
||||
static mca_pml_csum_recv_request_t*
|
||||
match_one(mca_btl_base_module_t *btl,
|
||||
mca_pml_csum_match_hdr_t *hdr, mca_btl_base_segment_t* segments,
|
||||
size_t num_segments, ompi_communicator_t *comm_ptr,
|
||||
mca_pml_csum_comm_proc_t *proc,
|
||||
mca_pml_csum_recv_frag_t* frag);
|
||||
|
||||
void mca_pml_csum_recv_frag_callback_match(mca_btl_base_module_t* btl,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_descriptor_t* des,
|
||||
void* cbdata ) {
|
||||
void* cbdata )
|
||||
{
|
||||
mca_btl_base_segment_t* segments = des->des_dst;
|
||||
mca_pml_csum_match_hdr_t* hdr = (mca_pml_csum_match_hdr_t*)segments->seg_addr.pval;
|
||||
ompi_communicator_t *comm_ptr;
|
||||
mca_pml_csum_recv_request_t *match = NULL;
|
||||
mca_pml_csum_comm_t *comm;
|
||||
mca_pml_csum_comm_proc_t *proc;
|
||||
mca_pml_csum_recv_frag_t* frag = NULL;
|
||||
size_t num_segments = des->des_dst_cnt;
|
||||
size_t bytes_received = 0;
|
||||
uint16_t csum_received, csum=0;
|
||||
@ -148,7 +150,7 @@ void mca_pml_csum_recv_frag_callback_match(mca_btl_base_module_t* btl,
|
||||
|
||||
if( OPAL_UNLIKELY(segments->seg_len < OMPI_PML_CSUM_MATCH_HDR_LEN) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
csum_hdr_ntoh(((mca_pml_csum_hdr_t*) hdr), MCA_PML_CSUM_HDR_TYPE_MATCH);
|
||||
|
||||
csum_received = hdr->hdr_common.hdr_csum;
|
||||
@ -187,7 +189,7 @@ void mca_pml_csum_recv_frag_callback_match(mca_btl_base_module_t* btl,
|
||||
* moved to the right communicator.
|
||||
*/
|
||||
append_frag_to_list( &mca_pml_csum.non_existing_communicator_pending,
|
||||
btl, hdr, segments, num_segments, frag );
|
||||
btl, hdr, segments, num_segments, NULL );
|
||||
return;
|
||||
}
|
||||
comm = (mca_pml_csum_comm_t *)comm_ptr->c_pml_comm;
|
||||
@ -233,7 +235,7 @@ void mca_pml_csum_recv_frag_callback_match(mca_btl_base_module_t* btl,
|
||||
PERUSE_TRACE_MSG_EVENT(PERUSE_COMM_SEARCH_POSTED_Q_BEGIN, comm_ptr,
|
||||
hdr->hdr_src, hdr->hdr_tag, PERUSE_RECV);
|
||||
|
||||
match = match_one(btl, hdr, segments, num_segments, comm_ptr, proc, frag);
|
||||
match = match_one(btl, hdr, segments, num_segments, comm_ptr, proc, NULL);
|
||||
|
||||
/* The match is over. We generate the SEARCH_POSTED_Q_END here,
|
||||
* before going into the mca_pml_csum_check_cantmatch_for_match so
|
||||
@ -245,13 +247,13 @@ void mca_pml_csum_recv_frag_callback_match(mca_btl_base_module_t* btl,
|
||||
|
||||
/* release matching lock before processing fragment */
|
||||
OPAL_THREAD_UNLOCK(&comm->matching_lock);
|
||||
|
||||
|
||||
if(OPAL_LIKELY(match)) {
|
||||
bytes_received = segments->seg_len - OMPI_PML_CSUM_MATCH_HDR_LEN;
|
||||
match->req_recv.req_bytes_packed = bytes_received;
|
||||
|
||||
MCA_PML_CSUM_RECV_REQUEST_MATCHED(match, hdr);
|
||||
if(bytes_received > 0) {
|
||||
if(match->req_bytes_expected > 0) {
|
||||
struct iovec iov[2];
|
||||
uint32_t iov_count = 1;
|
||||
|
||||
@ -324,11 +326,8 @@ void mca_pml_csum_recv_frag_callback_match(mca_btl_base_module_t* btl,
|
||||
void mca_pml_csum_recv_frag_callback_rndv(mca_btl_base_module_t* btl,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_descriptor_t* des,
|
||||
void* cbdata ) {
|
||||
|
||||
|
||||
|
||||
|
||||
void* cbdata )
|
||||
{
|
||||
mca_btl_base_segment_t* segments = des->des_dst;
|
||||
mca_pml_csum_hdr_t* hdr = (mca_pml_csum_hdr_t*)segments->seg_addr.pval;
|
||||
uint16_t csum_received, csum;
|
||||
@ -364,13 +363,14 @@ void mca_pml_csum_recv_frag_callback_rndv(mca_btl_base_module_t* btl,
|
||||
void mca_pml_csum_recv_frag_callback_rget(mca_btl_base_module_t* btl,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_descriptor_t* des,
|
||||
void* cbdata ) {
|
||||
void* cbdata )
|
||||
{
|
||||
mca_btl_base_segment_t* segments = des->des_dst;
|
||||
mca_pml_csum_hdr_t* hdr = (mca_pml_csum_hdr_t*)segments->seg_addr.pval;
|
||||
|
||||
if( OPAL_UNLIKELY(segments->seg_len < sizeof(mca_pml_csum_common_hdr_t)) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
csum_hdr_ntoh(hdr, MCA_PML_CSUM_HDR_TYPE_RGET);
|
||||
mca_pml_csum_recv_frag_match(btl, &hdr->hdr_match, segments,
|
||||
des->des_dst_cnt, MCA_PML_CSUM_HDR_TYPE_RGET);
|
||||
@ -382,7 +382,8 @@ void mca_pml_csum_recv_frag_callback_rget(mca_btl_base_module_t* btl,
|
||||
void mca_pml_csum_recv_frag_callback_ack(mca_btl_base_module_t* btl,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_descriptor_t* des,
|
||||
void* cbdata ) {
|
||||
void* cbdata )
|
||||
{
|
||||
mca_btl_base_segment_t* segments = des->des_dst;
|
||||
mca_pml_csum_hdr_t* hdr = (mca_pml_csum_hdr_t*)segments->seg_addr.pval;
|
||||
mca_pml_csum_send_request_t* sendreq;
|
||||
@ -426,9 +427,20 @@ void mca_pml_csum_recv_frag_callback_ack(mca_btl_base_module_t* btl,
|
||||
hdr->hdr_ack.hdr_send_offset,
|
||||
sendreq->req_send.req_bytes_packed -
|
||||
hdr->hdr_ack.hdr_send_offset);
|
||||
|
||||
OPAL_THREAD_ADD32(&sendreq->req_state, -1);
|
||||
|
||||
|
||||
if (sendreq->req_state != 0) {
|
||||
/* Typical receipt of an ACK message causes req_state to be
|
||||
* decremented. However, a send request that started as an
|
||||
* RGET request can become a RNDV. For example, when the
|
||||
* receiver determines that its receive buffer is not
|
||||
* contiguous and therefore cannot support the RGET
|
||||
* protocol. A send request that started with the RGET
|
||||
* protocol has req_state == 0 and as such should not be
|
||||
* decremented.
|
||||
*/
|
||||
OPAL_THREAD_ADD32(&sendreq->req_state, -1);
|
||||
}
|
||||
|
||||
if(send_request_pml_complete_check(sendreq) == false)
|
||||
mca_pml_csum_send_request_schedule(sendreq);
|
||||
|
||||
@ -438,16 +450,16 @@ void mca_pml_csum_recv_frag_callback_ack(mca_btl_base_module_t* btl,
|
||||
void mca_pml_csum_recv_frag_callback_frag(mca_btl_base_module_t* btl,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_descriptor_t* des,
|
||||
void* cbdata ) {
|
||||
mca_btl_base_segment_t* segments = des->des_dst;
|
||||
mca_pml_csum_hdr_t* hdr = (mca_pml_csum_hdr_t*)segments->seg_addr.pval;
|
||||
mca_pml_csum_recv_request_t* recvreq;
|
||||
uint16_t csum_received, csum;
|
||||
|
||||
if( OPAL_UNLIKELY(segments->seg_len < sizeof(mca_pml_csum_common_hdr_t)) ) {
|
||||
return;
|
||||
}
|
||||
csum_hdr_ntoh(hdr, MCA_PML_CSUM_HDR_TYPE_FRAG);
|
||||
void* cbdata ) {
|
||||
mca_btl_base_segment_t* segments = des->des_dst;
|
||||
mca_pml_csum_hdr_t* hdr = (mca_pml_csum_hdr_t*)segments->seg_addr.pval;
|
||||
mca_pml_csum_recv_request_t* recvreq;
|
||||
uint16_t csum_received, csum;
|
||||
|
||||
if( OPAL_UNLIKELY(segments->seg_len < sizeof(mca_pml_csum_common_hdr_t)) ) {
|
||||
return;
|
||||
}
|
||||
csum_hdr_ntoh(hdr, MCA_PML_CSUM_HDR_TYPE_FRAG);
|
||||
|
||||
csum_received = hdr->hdr_common.hdr_csum;
|
||||
hdr->hdr_common.hdr_csum = 0;
|
||||
@ -468,16 +480,16 @@ void mca_pml_csum_recv_frag_callback_frag(mca_btl_base_module_t* btl,
|
||||
}
|
||||
|
||||
recvreq = (mca_pml_csum_recv_request_t*)hdr->hdr_frag.hdr_dst_req.pval;
|
||||
mca_pml_csum_recv_request_progress_frag(recvreq,btl,segments,des->des_dst_cnt);
|
||||
|
||||
return;
|
||||
mca_pml_csum_recv_request_progress_frag(recvreq,btl,segments,des->des_dst_cnt);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void mca_pml_csum_recv_frag_callback_put(mca_btl_base_module_t* btl,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_descriptor_t* des,
|
||||
void* cbdata ) {
|
||||
void* cbdata ) {
|
||||
mca_btl_base_segment_t* segments = des->des_dst;
|
||||
mca_pml_csum_hdr_t* hdr = (mca_pml_csum_hdr_t*)segments->seg_addr.pval;
|
||||
mca_pml_csum_send_request_t* sendreq;
|
||||
@ -519,7 +531,7 @@ void mca_pml_csum_recv_frag_callback_put(mca_btl_base_module_t* btl,
|
||||
void mca_pml_csum_recv_frag_callback_fin(mca_btl_base_module_t* btl,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_descriptor_t* des,
|
||||
void* cbdata ) {
|
||||
void* cbdata ) {
|
||||
mca_btl_base_segment_t* segments = des->des_dst;
|
||||
mca_pml_csum_hdr_t* hdr = (mca_pml_csum_hdr_t*)segments->seg_addr.pval;
|
||||
mca_btl_base_descriptor_t* rdma;
|
||||
@ -630,11 +642,12 @@ static mca_pml_csum_recv_request_t *match_incomming(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static mca_pml_csum_recv_request_t *match_one(mca_btl_base_module_t *btl,
|
||||
mca_pml_csum_match_hdr_t *hdr, mca_btl_base_segment_t* segments,
|
||||
size_t num_segments, ompi_communicator_t *comm_ptr,
|
||||
mca_pml_csum_comm_proc_t *proc,
|
||||
mca_pml_csum_recv_frag_t* frag)
|
||||
static mca_pml_csum_recv_request_t*
|
||||
match_one(mca_btl_base_module_t *btl,
|
||||
mca_pml_csum_match_hdr_t *hdr, mca_btl_base_segment_t* segments,
|
||||
size_t num_segments, ompi_communicator_t *comm_ptr,
|
||||
mca_pml_csum_comm_proc_t *proc,
|
||||
mca_pml_csum_recv_frag_t* frag)
|
||||
{
|
||||
mca_pml_csum_recv_request_t *match;
|
||||
mca_pml_csum_comm_t *comm = (mca_pml_csum_comm_t *)comm_ptr->c_pml_comm;
|
||||
@ -643,48 +656,41 @@ static mca_pml_csum_recv_request_t *match_one(mca_btl_base_module_t *btl,
|
||||
match = match_incomming(hdr, comm, proc);
|
||||
|
||||
/* if match found, process data */
|
||||
if(OPAL_UNLIKELY(NULL == match)) {
|
||||
/* if no match found, place on unexpected queue */
|
||||
append_frag_to_list(&proc->unexpected_frags, btl, hdr, segments,
|
||||
num_segments, frag);
|
||||
PERUSE_TRACE_MSG_EVENT(PERUSE_COMM_MSG_INSERT_IN_UNEX_Q, comm_ptr,
|
||||
hdr->hdr_src, hdr->hdr_tag, PERUSE_RECV);
|
||||
return NULL;
|
||||
if(OPAL_LIKELY(NULL != match)) {
|
||||
match->req_recv.req_base.req_proc = proc->ompi_proc;
|
||||
|
||||
if(OPAL_UNLIKELY(MCA_PML_REQUEST_PROBE == match->req_recv.req_base.req_type)) {
|
||||
/* complete the probe */
|
||||
mca_pml_csum_recv_request_matched_probe(match, btl, segments,
|
||||
num_segments);
|
||||
/* attempt to match actual request */
|
||||
continue;
|
||||
}
|
||||
|
||||
PERUSE_TRACE_COMM_EVENT(PERUSE_COMM_MSG_MATCH_POSTED_REQ,
|
||||
&(match->req_recv.req_base), PERUSE_RECV);
|
||||
return match;
|
||||
}
|
||||
|
||||
match->req_recv.req_base.req_proc = proc->ompi_proc;
|
||||
|
||||
if(MCA_PML_REQUEST_PROBE == match->req_recv.req_base.req_type) {
|
||||
/* complete the probe */
|
||||
mca_pml_csum_recv_request_matched_probe(match, btl, segments,
|
||||
num_segments);
|
||||
/* attempt to match actual request */
|
||||
continue;
|
||||
}
|
||||
|
||||
PERUSE_TRACE_COMM_EVENT(PERUSE_COMM_MSG_MATCH_POSTED_REQ,
|
||||
&(match->req_recv.req_base), PERUSE_RECV);
|
||||
break;
|
||||
/* if no match found, place on unexpected queue */
|
||||
append_frag_to_list(&proc->unexpected_frags, btl, hdr, segments,
|
||||
num_segments, frag);
|
||||
PERUSE_TRACE_MSG_EVENT(PERUSE_COMM_MSG_INSERT_IN_UNEX_Q, comm_ptr,
|
||||
hdr->hdr_src, hdr->hdr_tag, PERUSE_RECV);
|
||||
return NULL;
|
||||
} while(true);
|
||||
|
||||
return match;
|
||||
}
|
||||
|
||||
static mca_pml_csum_recv_frag_t *check_cantmatch_for_match(
|
||||
mca_pml_csum_comm_proc_t *proc)
|
||||
static mca_pml_csum_recv_frag_t* check_cantmatch_for_match(mca_pml_csum_comm_proc_t *proc)
|
||||
{
|
||||
/* local parameters */
|
||||
mca_pml_csum_recv_frag_t *frag;
|
||||
|
||||
/* search the list for a fragment from the send with sequence
|
||||
* number next_msg_seq_expected
|
||||
*/
|
||||
for(frag = (mca_pml_csum_recv_frag_t *)
|
||||
opal_list_get_first(&proc->frags_cant_match);
|
||||
frag != (mca_pml_csum_recv_frag_t *)
|
||||
opal_list_get_end(&proc->frags_cant_match);
|
||||
frag = (mca_pml_csum_recv_frag_t *)
|
||||
opal_list_get_next(frag))
|
||||
for(frag = (mca_pml_csum_recv_frag_t*)opal_list_get_first(&proc->frags_cant_match);
|
||||
frag != (mca_pml_csum_recv_frag_t*)opal_list_get_end(&proc->frags_cant_match);
|
||||
frag = (mca_pml_csum_recv_frag_t*)opal_list_get_next(frag))
|
||||
{
|
||||
mca_pml_csum_match_hdr_t* hdr = &frag->hdr.hdr_match;
|
||||
/*
|
||||
@ -755,7 +761,7 @@ static int mca_pml_csum_recv_frag_match( mca_btl_base_module_t *btl,
|
||||
* moved to the right communicator.
|
||||
*/
|
||||
append_frag_to_list( &mca_pml_csum.non_existing_communicator_pending,
|
||||
btl, hdr, segments, num_segments, frag );
|
||||
btl, hdr, segments, num_segments, NULL );
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
comm = (mca_pml_csum_comm_t *)comm_ptr->c_pml_comm;
|
||||
|
@ -14,6 +14,7 @@
|
||||
* Copyright (c) 2009 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -344,11 +345,10 @@ static int mca_pml_csum_recv_request_ack(
|
||||
/* let know to shedule function there is no need to put ACK flag */
|
||||
recvreq->req_ack_sent = true;
|
||||
return mca_pml_csum_recv_request_ack_send(proc, hdr->hdr_src_req.lval,
|
||||
recvreq, recvreq->req_send_offset,
|
||||
recvreq->req_send_offset == bytes_received);
|
||||
recvreq, recvreq->req_send_offset,
|
||||
recvreq->req_send_offset == bytes_received);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return resources used by the RDMA
|
||||
*/
|
||||
@ -371,7 +371,7 @@ static void mca_pml_csum_rget_completion( mca_btl_base_module_t* btl,
|
||||
|
||||
mca_pml_csum_send_fin(recvreq->req_recv.req_base.req_proc,
|
||||
bml_btl,
|
||||
frag->rdma_hdr.hdr_rget.hdr_des.pval,
|
||||
frag->rdma_hdr.hdr_rget.hdr_des,
|
||||
des->order, 0);
|
||||
|
||||
/* is receive request complete */
|
||||
@ -453,9 +453,8 @@ void mca_pml_csum_recv_request_progress_frag( mca_pml_csum_recv_request_t* recvr
|
||||
mca_btl_base_segment_t* segments,
|
||||
size_t num_segments )
|
||||
{
|
||||
size_t bytes_received = 0;
|
||||
size_t bytes_received = 0, data_offset = 0;
|
||||
size_t bytes_delivered __opal_attribute_unused__; /* is being set to zero in MCA_PML_CSUM_RECV_REQUEST_UNPACK */
|
||||
size_t data_offset = 0;
|
||||
mca_pml_csum_hdr_t* hdr = (mca_pml_csum_hdr_t*)segments->seg_addr.pval;
|
||||
uint32_t csum = OPAL_CSUM_ZERO;
|
||||
|
||||
@ -764,7 +763,7 @@ void mca_pml_csum_recv_request_matched_probe( mca_pml_csum_recv_request_t* recvr
|
||||
recvreq->req_recv.req_base.req_ompi.req_status.MPI_TAG = hdr->hdr_match.hdr_tag;
|
||||
recvreq->req_recv.req_base.req_ompi.req_status.MPI_SOURCE = hdr->hdr_match.hdr_src;
|
||||
recvreq->req_bytes_received = bytes_packed;
|
||||
recvreq->req_bytes_delivered = bytes_packed;
|
||||
recvreq->req_bytes_expected = bytes_packed;
|
||||
recv_request_pml_complete(recvreq);
|
||||
}
|
||||
|
||||
@ -1030,9 +1029,9 @@ void mca_pml_csum_recv_req_start(mca_pml_csum_recv_request_t *req)
|
||||
|
||||
/* init/re-init the request */
|
||||
req->req_lock = 0;
|
||||
req->req_pipeline_depth = 0;
|
||||
req->req_bytes_received = 0;
|
||||
req->req_bytes_delivered = 0;
|
||||
req->req_pipeline_depth = 0;
|
||||
req->req_bytes_received = 0;
|
||||
req->req_bytes_expected = 0;
|
||||
/* What about req_rdma_cnt ? */
|
||||
req->req_rdma_idx = 0;
|
||||
req->req_pending = false;
|
||||
@ -1083,7 +1082,7 @@ void mca_pml_csum_recv_req_start(mca_pml_csum_recv_request_t *req)
|
||||
hdr->hdr_match.hdr_src,
|
||||
hdr->hdr_match.hdr_tag,
|
||||
PERUSE_RECV);
|
||||
|
||||
|
||||
PERUSE_TRACE_COMM_EVENT(PERUSE_COMM_SEARCH_UNEX_Q_END,
|
||||
&(req->req_recv.req_base), PERUSE_RECV);
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008 UT-Battelle, LLC. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -38,7 +39,7 @@ struct mca_pml_csum_recv_request_t {
|
||||
int32_t req_lock;
|
||||
size_t req_pipeline_depth;
|
||||
size_t req_bytes_received; /**< amount of data transferred into the user buffer */
|
||||
size_t req_bytes_delivered; /**< local size of the data as suggested by the user */
|
||||
size_t req_bytes_expected; /**< local size of the data as suggested by the user */
|
||||
size_t req_rdma_offset;
|
||||
size_t req_send_offset;
|
||||
uint32_t req_rdma_cnt;
|
||||
@ -165,7 +166,7 @@ recv_request_pml_complete(mca_pml_csum_recv_request_t *recvreq)
|
||||
recvreq->req_recv.req_base.req_pml_complete = true;
|
||||
recvreq->req_recv.req_base.req_ompi.req_status._ucount =
|
||||
recvreq->req_bytes_received;
|
||||
if (recvreq->req_recv.req_bytes_packed > recvreq->req_bytes_delivered) {
|
||||
if (recvreq->req_recv.req_bytes_packed > recvreq->req_bytes_expected) {
|
||||
recvreq->req_recv.req_base.req_ompi.req_status._ucount =
|
||||
recvreq->req_recv.req_bytes_packed;
|
||||
recvreq->req_recv.req_base.req_ompi.req_status.MPI_ERROR =
|
||||
@ -195,7 +196,6 @@ recv_request_pml_complete_check(mca_pml_csum_recv_request_t *recvreq)
|
||||
extern void mca_pml_csum_recv_req_start(mca_pml_csum_recv_request_t *req);
|
||||
#define MCA_PML_CSUM_RECV_REQUEST_START(r) mca_pml_csum_recv_req_start(r)
|
||||
|
||||
|
||||
static inline void prepare_recv_req_converter(mca_pml_csum_recv_request_t *req)
|
||||
{
|
||||
if( req->req_recv.req_base.req_datatype->super.size | req->req_recv.req_base.req_count ) {
|
||||
@ -207,7 +207,7 @@ static inline void prepare_recv_req_converter(mca_pml_csum_recv_request_t *req)
|
||||
0,
|
||||
&req->req_recv.req_base.req_convertor);
|
||||
opal_convertor_get_unpacked_size(&req->req_recv.req_base.req_convertor,
|
||||
&req->req_bytes_delivered);
|
||||
&req->req_bytes_expected);
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,7 +229,7 @@ static inline void recv_req_matched(mca_pml_csum_recv_request_t *req,
|
||||
prepare_recv_req_converter(req);
|
||||
}
|
||||
PERUSE_TRACE_COMM_EVENT(PERUSE_COMM_REQ_XFER_BEGIN,
|
||||
&req->req_recv.req_base, PERUSE_RECV);
|
||||
&req->req_recv.req_base, PERUSE_RECV);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
* Copyright (c) 2009 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2009 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -685,9 +686,8 @@ int mca_pml_csum_send_request_start_rdma( mca_pml_csum_send_request_t* sendreq,
|
||||
mca_pml_csum_hdr_t* hdr;
|
||||
bool need_local_cb = false;
|
||||
int rc;
|
||||
|
||||
bml_btl = sendreq->req_rdma[0].bml_btl;
|
||||
|
||||
bml_btl = sendreq->req_rdma[0].bml_btl;
|
||||
if((sendreq->req_rdma_cnt == 1) && (bml_btl->btl_flags & MCA_BTL_FLAGS_GET)) {
|
||||
mca_mpool_base_registration_t* reg = sendreq->req_rdma[0].btl_reg;
|
||||
mca_btl_base_descriptor_t* src;
|
||||
@ -1110,7 +1110,7 @@ cannot_pack:
|
||||
|
||||
des->des_cbfunc = mca_pml_csum_frag_completion;
|
||||
des->des_cbdata = sendreq;
|
||||
|
||||
|
||||
/* setup header */
|
||||
hdr = (mca_pml_csum_frag_hdr_t*)des->des_src->seg_addr.pval;
|
||||
hdr->hdr_common.hdr_flags = 0;
|
||||
@ -1180,7 +1180,7 @@ static void mca_pml_csum_put_completion( mca_btl_base_module_t* btl,
|
||||
|
||||
mca_pml_csum_send_fin(sendreq->req_send.req_base.req_proc,
|
||||
bml_btl,
|
||||
frag->rdma_hdr.hdr_rdma.hdr_des.pval,
|
||||
frag->rdma_hdr.hdr_rdma.hdr_des,
|
||||
des->order, 0);
|
||||
|
||||
/* check for request completion */
|
||||
@ -1225,7 +1225,7 @@ int mca_pml_csum_send_request_put_frag( mca_pml_csum_rdma_frag_t* frag )
|
||||
|
||||
/* tell receiver to unregister memory */
|
||||
mca_pml_csum_send_fin(sendreq->req_send.req_base.req_proc,
|
||||
bml_btl, frag->rdma_hdr.hdr_rdma.hdr_des.pval,
|
||||
bml_btl, frag->rdma_hdr.hdr_rdma.hdr_des,
|
||||
MCA_BTL_NO_ORDER, 1);
|
||||
|
||||
/* send fragment by copy in/out */
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Copyright (c) 2009 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2009 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -115,10 +115,10 @@ get_request_from_send_pending(mca_pml_csum_send_pending_t *type)
|
||||
return sendreq;
|
||||
}
|
||||
|
||||
#define MCA_PML_CSUM_SEND_REQUEST_ALLOC( comm, \
|
||||
dst, \
|
||||
sendreq, \
|
||||
rc) \
|
||||
#define MCA_PML_CSUM_SEND_REQUEST_ALLOC( comm, \
|
||||
dst, \
|
||||
sendreq, \
|
||||
rc) \
|
||||
{ \
|
||||
ompi_proc_t *proc = ompi_comm_peer_lookup( comm, dst ); \
|
||||
ompi_free_list_item_t* item; \
|
||||
@ -127,32 +127,33 @@ get_request_from_send_pending(mca_pml_csum_send_pending_t *type)
|
||||
if( OPAL_LIKELY(NULL != proc) ) { \
|
||||
rc = OMPI_SUCCESS; \
|
||||
OMPI_FREE_LIST_WAIT(&mca_pml_base_send_requests, item, rc); \
|
||||
sendreq = (mca_pml_csum_send_request_t*)item; \
|
||||
sendreq = (mca_pml_csum_send_request_t*)item; \
|
||||
sendreq->req_send.req_base.req_proc = proc; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define MCA_PML_CSUM_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, \
|
||||
0); \
|
||||
(sendreq)->req_recv.pval = NULL; \
|
||||
|
||||
#define MCA_PML_CSUM_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, \
|
||||
0); /* convertor_flags */ \
|
||||
(sendreq)->req_recv.pval = NULL; \
|
||||
}
|
||||
|
||||
|
||||
@ -228,7 +229,7 @@ send_request_pml_complete(mca_pml_csum_send_request_t *sendreq)
|
||||
|
||||
if(sendreq->req_send.req_bytes_packed > 0) {
|
||||
PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_XFER_END,
|
||||
&(sendreq->req_send.req_base), PERUSE_SEND);
|
||||
&(sendreq->req_send.req_base), PERUSE_SEND);
|
||||
}
|
||||
|
||||
/* return mpool resources */
|
||||
@ -256,7 +257,9 @@ send_request_pml_complete(mca_pml_csum_send_request_t *sendreq)
|
||||
static inline bool
|
||||
send_request_pml_complete_check(mca_pml_csum_send_request_t *sendreq)
|
||||
{
|
||||
#if OPAL_HAVE_THREAD_SUPPORT
|
||||
opal_atomic_rmb();
|
||||
#endif
|
||||
/* if no more events are expected for the request and the whole message is
|
||||
* already sent and send fragment scheduling isn't running in another
|
||||
* thread then complete the request on PML level. From now on, if user
|
||||
@ -349,7 +352,6 @@ mca_pml_csum_send_request_start_btl( mca_pml_csum_send_request_t* sendreq,
|
||||
size_t eager_limit = btl->btl_eager_limit - sizeof(mca_pml_csum_hdr_t);
|
||||
int rc;
|
||||
|
||||
assert(btl->btl_eager_limit >= sizeof(mca_pml_csum_hdr_t));
|
||||
if( OPAL_LIKELY(size <= eager_limit) ) {
|
||||
switch(sendreq->req_send.req_send_mode) {
|
||||
case MCA_PML_BASE_SEND_SYNCHRONOUS:
|
||||
|
@ -864,7 +864,7 @@ void mca_pml_ob1_send_request_copy_in_out( mca_pml_ob1_send_request_t *sendreq,
|
||||
ompi_free_list_item_t *i;
|
||||
mca_bml_base_endpoint_t* bml_endpoint = sendreq->req_endpoint;
|
||||
int num_btls = mca_bml_base_btl_array_get_size(&bml_endpoint->btl_send);
|
||||
int rc = OMPI_SUCCESS, n;
|
||||
int rc, n;
|
||||
double weight_total = 0;
|
||||
|
||||
if( OPAL_UNLIKELY(0 == send_length) )
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user