Skip to content

Commit d47dd92

Browse files
committed
osc/pt2pt: Reworked "Fix put hang" commit
- From Mark - This replaces the previous commit, making it more focused: - "osc/pt2pt: Fix put hang when used with win_lock_all"
1 parent 067d946 commit d47dd92

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

ompi/mca/osc/pt2pt/osc_pt2pt_comm.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,14 @@ static inline int ompi_osc_pt2pt_put_w_req (const void *origin_addr, int origin_
336336

337337
if (is_long_msg) {
338338
/* wait for eager sends to be active before starting a long put */
339-
ompi_osc_pt2pt_sync_wait_expected (pt2pt_sync);
339+
if (pt2pt_sync->type == OMPI_OSC_PT2PT_SYNC_TYPE_LOCK) { laksjdflskadjfl
340+
ompi_osc_pt2pt_peer_t *peer = ompi_osc_pt2pt_peer_lookup (module, target);
341+
while (!(peer->flags | OMPI_OSC_PT2PT_PEER_FLAG_EAGER)) {
342+
opal_condition_wait(&pt2pt_sync->cond, &pt2pt_sync->lock);
343+
}
344+
} else {
345+
ompi_osc_pt2pt_sync_wait_expected (pt2pt_sync);
346+
}
340347
}
341348

342349
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
@@ -495,7 +502,14 @@ ompi_osc_pt2pt_accumulate_w_req (const void *origin_addr, int origin_count,
495502

496503
if (is_long_msg) {
497504
/* wait for synchronization before posting a long message */
498-
ompi_osc_pt2pt_sync_wait_expected (pt2pt_sync);
505+
if (pt2pt_sync->type == OMPI_OSC_PT2PT_SYNC_TYPE_LOCK) {
506+
ompi_osc_pt2pt_peer_t *peer = ompi_osc_pt2pt_peer_lookup (module, target);
507+
while (!(peer->flags | OMPI_OSC_PT2PT_PEER_FLAG_EAGER)) {
508+
opal_condition_wait(&pt2pt_sync->cond, &pt2pt_sync->lock);
509+
}
510+
} else {
511+
ompi_osc_pt2pt_sync_wait_expected (pt2pt_sync);
512+
}
499513
}
500514

501515
header = (ompi_osc_pt2pt_header_acc_t*) ptr;

ompi/mca/osc/pt2pt/osc_pt2pt_sync.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,9 @@ static inline void ompi_osc_pt2pt_sync_expected (ompi_osc_pt2pt_sync_t *sync)
164164
int32_t new_value = OPAL_THREAD_ADD32 (&sync->sync_expected, -1);
165165
if (0 == new_value) {
166166
OPAL_THREAD_LOCK(&sync->lock);
167-
#if 0
168167
if (!(sync->type == OMPI_OSC_PT2PT_SYNC_TYPE_LOCK && sync->num_peers > 1)) {
169168
sync->eager_send_active = true;
170169
}
171-
#else
172-
if ((sync->type == OMPI_OSC_PT2PT_SYNC_TYPE_LOCK && sync->num_peers > 1)) {
173-
opal_output_verbose(1, ompi_osc_base_framework.framework_output,
174-
"WARNING: Setting 'eager_send_active' even though sync->type = %d and sync->num_peers = %d",
175-
sync->type, sync->num_peers);
176-
}
177-
sync->eager_send_active = true;
178-
#endif
179170
opal_condition_broadcast (&sync->cond);
180171
OPAL_THREAD_UNLOCK(&sync->lock);
181172
}

0 commit comments

Comments
 (0)