Skip to content

Commit 4bab0cd

Browse files
authored
Merge pull request #12588 from hppritcha/plug_race_condition_in_ob1
OMPI/COMM: be more conservative about when a comm is ready
2 parents 0f17273 + 651ef79 commit 4bab0cd

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

ompi/communicator/communicator.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Copyright (c) 2015 Research Organization for Information Science
2323
* and Technology (RIST). All rights reserved.
2424
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
25-
* Copyright (c) 2018-2022 Triad National Security, LLC. All rights
25+
* Copyright (c) 2018-2024 Triad National Security, LLC. All rights
2626
* reserved.
2727
* Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
2828
* $COPYRIGHT$
@@ -568,6 +568,13 @@ static inline ompi_communicator_t *ompi_comm_lookup (const uint32_t c_index)
568568
comm = NULL;
569569
}
570570

571+
/*
572+
* return NULL if comm doesn't yet have an associated PML
573+
*/
574+
if ((NULL != comm) && !OMPI_COMM_IS_PML_ADDED(comm)) {
575+
comm = NULL;
576+
}
577+
571578
return comm;
572579
}
573580

@@ -584,6 +591,13 @@ static inline ompi_communicator_t *ompi_comm_lookup_cid (const ompi_comm_extende
584591
{
585592
ompi_communicator_t *comm = NULL;
586593
(void) opal_hash_table_get_value_ptr (&ompi_comm_hash, &cid, sizeof (cid), (void **) &comm);
594+
/*
595+
* return NULL if the comm does not yet have an asociated PML
596+
*/
597+
if ((NULL != comm) && !OMPI_COMM_IS_PML_ADDED(comm)) {
598+
comm = NULL;
599+
}
600+
587601
return comm;
588602
}
589603

0 commit comments

Comments
 (0)