-
Notifications
You must be signed in to change notification settings - Fork 902
comm/cid: fix for edge case with intercomm creation #12465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comm/cid: fix for edge case with intercomm creation #12465
Conversation
9399be3
to
c31f714
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ompi_mpi_comm_null as a sentinel should work better than using the parent communicator. If you remove the ompi_comm_dump_communicators
function this should be ready to go.
ompi/communicator/comm_cid.c
Outdated
@@ -1589,3 +1589,16 @@ static int ompi_comm_ft_allreduce_intra_pmix_nb(int *inbuf, int *outbuf, int cou | |||
|
|||
#endif /* OPAL_ENABLE_FT_MPI */ | |||
|
|||
void ompi_comm_dump_communicators(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have specialized mechanisms to dump information, especially communicators. This function does not follow any of OMPI coding standards, such as not using printf and friends but relying on OPAL_OUTPUT_VERBOSE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np i'll remove from the pr
Conceptually this is not correct because ompi_mpi_comm_null can legitimately be added to the ompi_mpi_communicators list. In the current code it will work because the only time we extract it from the list we use good point. i'll see if there's a not-to-painful way to address this. |
okay so if &ompi_mpi_comm_null is added to the list - which we actually do by default to support sessions - how is this relevant to the logic in the ob1 pml? The whole issue revolves around ob1 pml getting a comm back from doing an lookup on the incoming hdr's ctx and then thinking - oh I have a valid comm to use! we don't want that. |
I understand the problem, we need a sentinel to put in the We could solve this by defining OMPI_COMM_SENTINEL to 0x00001, and using this instead of |
I see. I think the sentinel idea should work. I'll update the PR with that approach |
0725601
to
85993fe
Compare
I was going over this this morning and I realized this code had and has a big flaw. The original code would have break the the resilience support because we go over the complete list of communicators to identify those that contains the failed processes to update their status and set in motion the PROC_FAILED and the automatic REVOKE. That code is not set to encounter the same communicator twice, which means that any errors that would have triggered while a communicator creation was underway would have lead to badness. The current code has now a different flaw. We use the |
I will look into a fix for this next week. |
85993fe
to
7dcdbd2
Compare
Run AWS CI again. |
ompi/communicator/communicator.h
Outdated
@@ -140,6 +140,12 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_communicator_t); | |||
#define OMPI_COMM_BLOCK_WORLD 16 | |||
#define OMPI_COMM_BLOCK_OTHERS 8 | |||
|
|||
/** | |||
* Placeholder to use in array of ompi communicators during CID allocation | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit extra line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ompi/communicator/comm_init.c
Outdated
if ( NULL != comm ) { | ||
/* Communicator has not been freed before finalize */ | ||
OBJ_RELEASE(comm); | ||
comm=(ompi_communicator_t *)opal_pointer_array_get_item(&ompi_mpi_communicators, i); | ||
comm= ompi_comm_lookup(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit space around =
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
A barrier was removed from the cid allocation algorithm for intercommunicators that leads to random hangs when doing MPI_Intercomm_create or moral equivalent. See issue open-mpi#12367 the cid allocation algorithm and comm from cid lookup was modified to use OMPI_COMM_SENTINEL as the placeholder in the list of pointers to ompi commucators. Signed-off-by: Howard Pritchard <[email protected]>
7dcdbd2
to
15a3d26
Compare
PR open-mpi#12465 gave Intel OneAPI a headache and threw an error trying to compile the code. This patch fixes that. Signed-off-by: Howard Pritchard <[email protected]>
I believe that the fixes from here solved some of the issues related to dynamic process management, in particular accept/connect. |
PR open-mpi#12465 gave Intel OneAPI a headache and threw an error trying to compile the code. This patch fixes that. Signed-off-by: Howard Pritchard <[email protected]> (cherry picked from commit 574778d)
A barrier was removed from the cid allocation algorithm for intercommunicators that leads to random hangs when doing MPI_Intercomm_create or moral equivalent.
See issue #12367
the cid allocation algorithm and comm from cid lookup was modified to use a pointer to ompi_mpi_comm_null as the placeholder in the list of pointers to ompi commucators.
A convenience debug function was added to comm_cid.c to dump out this table of communicators.