Skip to content

Commit 951a37d

Browse files
tkordenbrockawlauria
authored andcommitted
Portals4 MTL/COLL/OSC:
The OMPI communicator has been modified to have an extended context ID that is no longer compatible with the uint32_t type previously used. The equivalent ID is available using ompi_comm_get_local_cid(). - change MTL pending request contextid to uint32_t (matches local cid type) - replace direct access to c_contextid with ompi_comm_get_local_cid() Signed-off-by: Todd Kordenbrock <[email protected]> (cherry picked from commit 1b197ca)
1 parent a16cb59 commit 951a37d

File tree

6 files changed

+30
-23
lines changed

6 files changed

+30
-23
lines changed

ompi/mca/coll/portals4/coll_portals4_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
13-
* Copyright (c) 2013-2015 Sandia National Laboratories. All rights reserved.
13+
* Copyright (c) 2013-2022 Sandia National Laboratories. All rights reserved.
1414
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* Copyright (c) 2015 Bull SAS. All rights reserved.
@@ -135,7 +135,7 @@ ptl_datatype_t ompi_coll_portals4_atomic_datatype [OMPI_DATATYPE_MPI_MAX_PREDEFI
135135
if (!comm->c_coll->coll_ ## __api || !comm->c_coll->coll_ ## __api ## _module) { \
136136
opal_output_verbose(1, ompi_coll_base_framework.framework_output, \
137137
"(%d/%s): no underlying " # __api"; disqualifying myself", \
138-
__comm->c_contextid, __comm->c_name); \
138+
ompi_comm_get_local_cid(__comm), __comm->c_name); \
139139
return OMPI_ERROR; \
140140
} \
141141
OBJ_RETAIN(__module->previous_ ## __api ## _module); \

ompi/mca/mtl/portals4/mtl_portals4_flowctl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
2+
* Copyright (c) 2012-2022 Sandia National Laboratories. All rights reserved.
33
* $COPYRIGHT$
44
*
55
* Additional copyrights may follow
@@ -27,7 +27,7 @@ struct ompi_mtl_portals4_pending_request_t {
2727
mca_pml_base_send_mode_t mode;
2828
void *start;
2929
size_t length;
30-
int contextid;
30+
uint32_t contextid;
3131
int tag;
3232
int my_rank;
3333
int fc_notified;

ompi/mca/mtl/portals4/mtl_portals4_probe.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
12+
* Copyright (c) 2010-2022 Sandia National Laboratories. All rights reserved.
1313
* $COPYRIGHT$
1414
*
1515
* Additional copyrights may follow
@@ -82,7 +82,8 @@ ompi_mtl_portals4_iprobe(struct mca_mtl_base_module_t* mtl,
8282
remote_proc = *((ptl_process_t*) ompi_mtl_portals4_get_endpoint (mtl, ompi_proc));
8383
}
8484

85-
MTL_PORTALS4_SET_RECV_BITS(match_bits, ignore_bits, comm->c_contextid,
85+
MTL_PORTALS4_SET_RECV_BITS(match_bits, ignore_bits,
86+
ompi_comm_get_local_cid(comm),
8687
src, tag);
8788

8889
me.start = NULL;
@@ -146,7 +147,7 @@ ompi_mtl_portals4_improbe(struct mca_mtl_base_module_t *mtl,
146147

147148
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
148149
"%s:%d: improbe %d %d %d",
149-
__FILE__, __LINE__, comm->c_contextid, src, tag);
150+
__FILE__, __LINE__, ompi_comm_get_local_cid(comm), src, tag);
150151

151152
if (MPI_ANY_SOURCE == src) {
152153
if (ompi_mtl_portals4.use_logical) {
@@ -162,7 +163,8 @@ ompi_mtl_portals4_improbe(struct mca_mtl_base_module_t *mtl,
162163
remote_proc = *((ptl_process_t*) ompi_mtl_portals4_get_endpoint (mtl, ompi_proc));
163164
}
164165

165-
MTL_PORTALS4_SET_RECV_BITS(match_bits, ignore_bits, comm->c_contextid,
166+
MTL_PORTALS4_SET_RECV_BITS(match_bits, ignore_bits,
167+
ompi_comm_get_local_cid(comm),
166168
src, tag);
167169

168170
me.start = NULL;

ompi/mca/mtl/portals4/mtl_portals4_recv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
12+
* Copyright (c) 2010-2022 Sandia National Laboratories. All rights reserved.
1313
* $COPYRIGHT$
1414
*
1515
* Additional copyrights may follow
@@ -457,7 +457,8 @@ ompi_mtl_portals4_irecv(struct mca_mtl_base_module_t* mtl,
457457
remote_proc = *((ptl_process_t*) ompi_mtl_portals4_get_endpoint (mtl, ompi_proc));
458458
}
459459

460-
MTL_PORTALS4_SET_RECV_BITS(match_bits, ignore_bits, comm->c_contextid,
460+
MTL_PORTALS4_SET_RECV_BITS(match_bits, ignore_bits,
461+
ompi_comm_get_local_cid(comm),
461462
src, tag);
462463

463464
ret = ompi_mtl_datatype_recv_buf(convertor, &start, &length, &free_after);

ompi/mca/mtl/portals4/mtl_portals4_send.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
13+
* Copyright (c) 2010-2022 Sandia National Laboratories. All rights reserved.
1414
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* $COPYRIGHT$
@@ -114,7 +114,7 @@ ompi_mtl_portals4_callback(ptl_event_t *ev,
114114
ptl_request->opcount, ev->type));
115115

116116
/* First put achieved successfully (In the Priority List), so it may be necessary to decrement the number of pending get
117-
* If the protocol is eager, just decrement pending_get
117+
* If the protocol is eager, just decrement pending_get
118118
* Else (the protocol is rndv), decrement pending_get only if length % max_msg_size <= eager_limit
119119
* (This is the case where the eager part allows to save one get)
120120
*/
@@ -229,7 +229,7 @@ ompi_mtl_portals4_isend_callback(ptl_event_t *ev,
229229

230230
static inline int
231231
ompi_mtl_portals4_short_isend(mca_pml_base_send_mode_t mode,
232-
void *start, int length, int contextid, int tag,
232+
void *start, int length, uint32_t contextid, int tag,
233233
int localrank,
234234
ptl_process_t ptl_proc,
235235
ompi_mtl_portals4_isend_request_t *ptl_request)
@@ -239,7 +239,9 @@ ompi_mtl_portals4_short_isend(mca_pml_base_send_mode_t mode,
239239
ptl_me_t me;
240240
ptl_hdr_data_t hdr_data;
241241

242-
MTL_PORTALS4_SET_SEND_BITS(match_bits, contextid, localrank, tag,
242+
MTL_PORTALS4_SET_SEND_BITS(match_bits,
243+
contextid,
244+
localrank, tag,
243245
MTL_PORTALS4_SHORT_MSG);
244246

245247
MTL_PORTALS4_SET_HDR_DATA(hdr_data, ptl_request->opcount, length,
@@ -316,7 +318,7 @@ ompi_mtl_portals4_short_isend(mca_pml_base_send_mode_t mode,
316318
}
317319

318320
static inline int
319-
ompi_mtl_portals4_long_isend(void *start, size_t length, int contextid, int tag,
321+
ompi_mtl_portals4_long_isend(void *start, size_t length, uint32_t contextid, int tag,
320322
int localrank,
321323
ptl_process_t ptl_proc,
322324
ompi_mtl_portals4_isend_request_t *ptl_request)
@@ -327,7 +329,9 @@ ompi_mtl_portals4_long_isend(void *start, size_t length, int contextid, int tag,
327329
ptl_hdr_data_t hdr_data;
328330
ptl_size_t put_length;
329331

330-
MTL_PORTALS4_SET_SEND_BITS(match_bits, contextid, localrank, tag,
332+
MTL_PORTALS4_SET_SEND_BITS(match_bits,
333+
contextid,
334+
localrank, tag,
331335
MTL_PORTALS4_LONG_MSG);
332336

333337
MTL_PORTALS4_SET_HDR_DATA(hdr_data, ptl_request->opcount, length, 0);
@@ -513,7 +517,7 @@ ompi_mtl_portals4_send_start(struct mca_mtl_base_module_t* mtl,
513517
pending->mode = mode;
514518
pending->start = start;
515519
pending->length = length;
516-
pending->contextid = comm->c_contextid;
520+
pending->contextid = ompi_comm_get_local_cid(comm);
517521
pending->tag = tag;
518522
pending->my_rank = comm->c_my_rank;
519523
pending->fc_notified = 0;
@@ -546,15 +550,15 @@ ompi_mtl_portals4_send_start(struct mca_mtl_base_module_t* mtl,
546550
ret = ompi_mtl_portals4_short_isend(mode,
547551
start,
548552
length,
549-
comm->c_contextid,
553+
ompi_comm_get_local_cid(comm),
550554
tag,
551555
comm->c_my_rank,
552556
ptl_proc,
553557
ptl_request);
554558
} else {
555559
ret = ompi_mtl_portals4_long_isend(start,
556560
length,
557-
comm->c_contextid,
561+
ompi_comm_get_local_cid(comm),
558562
tag,
559563
comm->c_my_rank,
560564
ptl_proc,

ompi/mca/osc/portals4/osc_portals4_component.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2011-2017 Sandia National Laboratories. All rights reserved.
3+
* Copyright (c) 2011-2022 Sandia National Laboratories. All rights reserved.
44
* Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights
55
* reserved.
66
* Copyright (c) 2015-2017 Research Organization for Information Science
@@ -523,7 +523,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
523523
me.options = PTL_ME_OP_PUT | PTL_ME_OP_GET | PTL_ME_NO_TRUNCATE | PTL_ME_EVENT_SUCCESS_DISABLE;
524524
me.match_id.phys.nid = PTL_NID_ANY;
525525
me.match_id.phys.pid = PTL_PID_ANY;
526-
me.match_bits = module->comm->c_contextid;
526+
me.match_bits = ompi_comm_get_local_cid(module->comm);
527527
me.ignore_bits = 0;
528528

529529
ret = PtlMEAppend(module->ni_h,
@@ -546,7 +546,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
546546
me.options = PTL_ME_OP_PUT | PTL_ME_OP_GET | PTL_ME_NO_TRUNCATE | PTL_ME_EVENT_SUCCESS_DISABLE;
547547
me.match_id.phys.nid = PTL_NID_ANY;
548548
me.match_id.phys.pid = PTL_PID_ANY;
549-
me.match_bits = module->comm->c_contextid | OSC_PORTALS4_MB_CONTROL;
549+
me.match_bits = ompi_comm_get_local_cid(module->comm) | OSC_PORTALS4_MB_CONTROL;
550550
me.ignore_bits = 0;
551551

552552
ret = PtlMEAppend(module->ni_h,
@@ -563,7 +563,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
563563
}
564564

565565
module->opcount = 0;
566-
module->match_bits = module->comm->c_contextid;
566+
module->match_bits = ompi_comm_get_local_cid(module->comm);
567567
module->atomic_max = (check_config_value_equal("accumulate_ordering", info, "none")) ?
568568
mca_osc_portals4_component.matching_atomic_max :
569569
MIN(mca_osc_portals4_component.matching_atomic_max,

0 commit comments

Comments
 (0)