Skip to content

Commit 29fd7bd

Browse files
committed
Restore mca_btl_self_send() to return 1.
- Force osc/rdma to take the non btl-atomic path for self. Signed-off-by: Austen Lauria <[email protected]>
1 parent 691037a commit 29fd7bd

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

ompi/mca/osc/rdma/osc_rdma_component.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,10 @@ static int allocate_state_single (ompi_osc_rdma_module_t *module, void **base, s
529529
my_peer->state_handle = module->state_handle;
530530
my_peer->state_btl_index = my_peer->data_btl_index;
531531
my_peer->state_endpoint = my_peer->data_endpoint;
532+
mca_btl_base_module_t *btl = ompi_osc_rdma_selected_btl (module, my_peer->data_btl_index);
533+
if(0 == strcmp(btl->btl_component->btl_version.mca_component_name, "self")) {
534+
my_peer->flags |= OMPI_OSC_RDMA_PEER_LOCAL_STATE;
535+
}
532536
}
533537

534538
if (MPI_WIN_FLAVOR_DYNAMIC != module->flavor) {
@@ -789,6 +793,10 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
789793
peer->state = (osc_rdma_counter_t) ((uintptr_t) state_region->base + state_base + module->state_size * i);
790794
peer->state_endpoint = local_leader->data_endpoint; // data_endpoint initialized in ompi_osc_rdma_new_peer();
791795
peer->state_btl_index = local_leader->data_btl_index;
796+
mca_btl_base_module_t *btl = ompi_osc_rdma_selected_btl (module, peer->data_btl_index);
797+
if(0 == strcmp(btl->btl_component->btl_version.mca_component_name, "self")) {
798+
peer->flags |= OMPI_OSC_RDMA_PEER_LOCAL_STATE;
799+
}
792800
}
793801

794802
if (my_rank == peer_rank) {

ompi/mca/osc/rdma/osc_rdma_lock.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ static inline int ompi_osc_rdma_btl_fop (ompi_osc_rdma_module_t *module, uint8_t
8686

8787
if (OPAL_SUCCESS != ret) {
8888
if (OPAL_LIKELY(1 == ret)) {
89-
*result = ((int64_t *) pending_op->op_buffer)[0];
9089
ret = OMPI_SUCCESS;
91-
ompi_osc_rdma_atomic_complete (selected_btl, endpoint, pending_op->op_buffer,
92-
pending_op->op_frag->handle, (void *) pending_op, NULL, OPAL_SUCCESS);
90+
if(false == pending_op->op_complete) {
91+
*result = ((int64_t *) pending_op->op_buffer)[0];
92+
ompi_osc_rdma_atomic_complete (selected_btl, endpoint, pending_op->op_buffer,
93+
pending_op->op_frag->handle, (void *) pending_op, NULL, OPAL_SUCCESS);
94+
}
9395
} else {
9496
/* need to release here because ompi_osc_rdma_atomic_complete was not called */
9597
OBJ_RELEASE(pending_op);
@@ -161,8 +163,10 @@ static inline int ompi_osc_rdma_btl_op (ompi_osc_rdma_module_t *module, uint8_t
161163
/* need to release here because ompi_osc_rdma_atomic_complete was not called */
162164
OBJ_RELEASE(pending_op);
163165
if (OPAL_LIKELY(1 == ret)) {
164-
if (cbfunc) {
165-
cbfunc (cbdata, cbcontext, OMPI_SUCCESS);
166+
if(false == pending_op->op_complete) {
167+
if (cbfunc) {
168+
cbfunc (cbdata, cbcontext, OMPI_SUCCESS);
169+
}
166170
}
167171
ret = OMPI_SUCCESS;
168172
}

opal/mca/btl/base/btl_base_am_rdma.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static int mca_btl_base_am_rdma_respond(mca_btl_base_module_t *btl,
614614
send_descriptor->des_cbfunc = NULL;
615615

616616
int ret = btl->btl_send(btl, endpoint, send_descriptor, mca_btl_base_rdma_resp_tag());
617-
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
617+
if (OPAL_UNLIKELY(ret < 0)) {
618618
*descriptor = send_descriptor;
619619
}
620620
return ret;
@@ -635,7 +635,7 @@ mca_btl_base_am_rmda_rdma_complete(mca_btl_base_module_t *btl,
635635
operation->is_completed = true;
636636
int ret = mca_btl_base_am_rdma_respond(operation->btl, operation->endpoint,
637637
&operation->descriptor, NULL, &operation->hdr);
638-
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
638+
if (OPAL_UNLIKELY(ret < 0)) {
639639
BTL_VERBOSE(
640640
("could not send a response. queueing the response for later. endpoint=%p, ret=%d",
641641
endpoint, ret));
@@ -781,7 +781,7 @@ static int mca_btl_base_am_rdma_progress(void)
781781
int ret = descriptor->btl->btl_send(descriptor->btl, descriptor->endpoint,
782782
descriptor->descriptor,
783783
mca_btl_base_rdma_tag(context->type));
784-
if (OPAL_SUCCESS == ret) {
784+
if (ret <= 1) {
785785
opal_list_remove_item(&default_module.queued_initiator_descriptors,
786786
&descriptor->super);
787787
}
@@ -932,7 +932,7 @@ static void mca_btl_base_am_process_rdma(mca_btl_base_module_t *btl,
932932
abort();
933933
}
934934

935-
if (OPAL_SUCCESS != ret) {
935+
if (ret < 0) {
936936
mca_btl_base_rdma_queue_operation(btl, desc->endpoint, descriptor, 0, hdr, operation);
937937
}
938938
}
@@ -995,7 +995,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
995995

996996
mca_btl_base_descriptor_t *descriptor = NULL;
997997
int ret = mca_btl_base_am_rdma_respond(btl, desc->endpoint, &descriptor, &atomic_response, hdr);
998-
if (OPAL_SUCCESS != ret) {
998+
if (ret < 0) {
999999
mca_btl_base_rdma_queue_operation(btl, desc->endpoint, descriptor, atomic_response, hdr,
10001000
NULL);
10011001
}

opal/mca/btl/self/btl_self.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static int mca_btl_self_send(struct mca_btl_base_module_t *btl,
218218
if (btl_ownership) {
219219
mca_btl_self_free(btl, des);
220220
}
221-
return OPAL_SUCCESS;
221+
return 1;
222222
}
223223

224224
static int mca_btl_self_sendi(struct mca_btl_base_module_t *btl,

0 commit comments

Comments
 (0)