Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 43c7f8f

Browse files
committed
osc/pt2pt: do not use frag send to send lock request
This commit cleans up some code in the passive target path. The code used the buffered frag control send path but it is more appropriate to use the unbuffered one. This avoids checking structures that are should not be in use in this path. Signed-off-by: Nathan Hjelm <[email protected]> (cherry picked from commit open-mpi/ompi@cb1cb5f) Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 3901cbf commit 43c7f8f

File tree

4 files changed

+6
-51
lines changed

4 files changed

+6
-51
lines changed

ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,12 +1558,6 @@ static inline int process_frag (ompi_osc_pt2pt_module_t *module,
15581558
ret = process_acc_long (module, frag->source, &header->acc);
15591559
break;
15601560

1561-
case OMPI_OSC_PT2PT_HDR_TYPE_LOCK_REQ:
1562-
ret = ompi_osc_pt2pt_process_lock(module, frag->source, &header->lock);
1563-
if (OPAL_LIKELY(OMPI_SUCCESS == ret)) {
1564-
ret = sizeof (header->lock);
1565-
}
1566-
break;
15671561
case OMPI_OSC_PT2PT_HDR_TYPE_UNLOCK_REQ:
15681562
ret = process_unlock(module, frag->source, &header->unlock);
15691563
break;
@@ -1667,6 +1661,9 @@ int ompi_osc_pt2pt_process_receive (ompi_osc_pt2pt_receive_t *recv)
16671661
case OMPI_OSC_PT2PT_HDR_TYPE_POST:
16681662
osc_pt2pt_incoming_post (module, source);
16691663
break;
1664+
case OMPI_OSC_PT2PT_HDR_TYPE_LOCK_REQ:
1665+
ompi_osc_pt2pt_process_lock(module, source, (ompi_osc_pt2pt_header_lock_t *) base_header);
1666+
break;
16701667
case OMPI_OSC_PT2PT_HDR_TYPE_LOCK_ACK:
16711668
ompi_osc_pt2pt_process_lock_ack(module, (ompi_osc_pt2pt_header_lock_ack_t *) base_header);
16721669
break;

ompi/mca/osc/pt2pt/osc_pt2pt_frag.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -153,38 +153,6 @@ int ompi_osc_pt2pt_frag_flush_target (ompi_osc_pt2pt_module_t *module, int targe
153153
return ret;
154154
}
155155

156-
int ompi_osc_pt2pt_frag_flush_target_locked (ompi_osc_pt2pt_module_t *module, int target)
157-
{
158-
ompi_osc_pt2pt_peer_t *peer = ompi_osc_pt2pt_peer_lookup (module, target);
159-
ompi_osc_pt2pt_frag_t *frag;
160-
int ret = OMPI_SUCCESS;
161-
162-
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
163-
"osc pt2pt: frag flush to target target %d. queue fragments: %lu",
164-
target, (unsigned long) opal_list_get_size (&peer->queued_frags)));
165-
166-
/* walk through the pending list and send */
167-
while (NULL != (frag = ((ompi_osc_pt2pt_frag_t *) opal_list_remove_first (&peer->queued_frags)))) {
168-
ret = frag_send(module, frag);
169-
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
170-
break;
171-
}
172-
}
173-
174-
/* XXX -- TODO -- better error handling */
175-
if (OMPI_SUCCESS != ret) {
176-
return ret;
177-
}
178-
179-
/* flush the active frag */
180-
ret = ompi_osc_pt2pt_flush_active_frag (module, peer);
181-
182-
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
183-
"osc pt2pt: frag flush target %d finished", target));
184-
185-
return ret;
186-
}
187-
188156
int ompi_osc_pt2pt_frag_flush_all (ompi_osc_pt2pt_module_t *module)
189157
{
190158
int ret = OMPI_SUCCESS;

ompi/mca/osc/pt2pt/osc_pt2pt_frag.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ OBJ_CLASS_DECLARATION(ompi_osc_pt2pt_frag_t);
4343

4444
int ompi_osc_pt2pt_frag_start(ompi_osc_pt2pt_module_t *module, ompi_osc_pt2pt_frag_t *buffer);
4545
int ompi_osc_pt2pt_frag_flush_target(ompi_osc_pt2pt_module_t *module, int target);
46-
int ompi_osc_pt2pt_frag_flush_target_locked(ompi_osc_pt2pt_module_t *module, int target);
4746
int ompi_osc_pt2pt_frag_flush_all(ompi_osc_pt2pt_module_t *module);
4847

4948
static inline int ompi_osc_pt2pt_frag_finish (ompi_osc_pt2pt_module_t *module,

ompi/mca/osc/pt2pt/osc_pt2pt_passive_target.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,13 @@ int ompi_osc_pt2pt_lock_remote (ompi_osc_pt2pt_module_t *module, int target, omp
143143
lock_req.lock_ptr = (uint64_t) (uintptr_t) lock;
144144
OSC_PT2PT_HTON(&lock_req, module, target);
145145

146-
do {
147-
ret = ompi_osc_pt2pt_control_send (module, target, &lock_req, sizeof (lock_req));
148-
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
149-
break;
150-
}
151-
152-
/* make sure the request gets sent, so we can start eager sending... */
153-
ret = ompi_osc_pt2pt_frag_flush_target_locked (module, target);
154-
} while (0);
155-
146+
ret = ompi_osc_pt2pt_control_send_unbuffered (module, target, &lock_req, sizeof (lock_req));
156147
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
157148
OPAL_THREAD_ADD32(&lock->sync_expected, -1);
149+
} else {
150+
ompi_osc_pt2pt_peer_set_locked (peer, true);
158151
}
159152

160-
ompi_osc_pt2pt_peer_set_locked (peer, true);
161-
162153
OPAL_THREAD_UNLOCK(&peer->lock);
163154

164155
return ret;

0 commit comments

Comments
 (0)