1818#include "ompi/communicator/communicator.h"
1919#include "ompi/mca/pml/pml.h"
2020
21- static int ompi_comm_revoke_local (ompi_communicator_t * comm ,
21+ static int ompi_comm_revoke_msg_cb (ompi_communicator_t * comm ,
2222 ompi_comm_rbcast_message_t * msg );
2323
2424static int comm_revoke_cb_type = -1 ;
@@ -27,7 +27,7 @@ int ompi_comm_revoke_init(void)
2727{
2828 int ret ;
2929
30- ret = ompi_comm_rbcast_register_cb_type (ompi_comm_revoke_local );
30+ ret = ompi_comm_rbcast_register_cb_type (ompi_comm_revoke_msg_cb );
3131 if ( 0 <= ret ) {
3232 comm_revoke_cb_type = ret ;
3333 return OMPI_SUCCESS ;
@@ -66,20 +66,22 @@ int ompi_comm_revoke_internal(ompi_communicator_t* comm)
6666 return ret ;
6767}
6868
69-
70- /* internal code to revoke the communicator structure. Can be called from the
71- * API or from receiving a revoke message * /
72- static int ompi_comm_revoke_local (ompi_communicator_t * comm , ompi_comm_rbcast_message_t * msg )
69+ /*
70+ * Internal code to locally revoke a comm and update all necessary state
71+ */
72+ bool ompi_comm_revoke_local (ompi_communicator_t * comm , bool coll_only )
7373{
74- if ( comm -> comm_revoked ) {
74+ if ( comm -> comm_revoked || ( coll_only && comm -> coll_revoked ) ) {
7575 OPAL_OUTPUT_VERBOSE ((9 , ompi_ftmpi_output_handle ,
76- "%s %s: comm %s:%d is already revoked, nothing to do" ,
77- OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), __func__ , ompi_comm_print_cid (comm ), comm -> c_epoch ));
76+ "%s %s: comm %s:%d is already %srevoked, nothing to do" ,
77+ OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), __func__ , ompi_comm_print_cid (comm ), comm -> c_epoch ,
78+ coll_only ? "coll " : "" ));
7879 return false;
7980 }
8081 OPAL_OUTPUT_VERBOSE ((9 , ompi_ftmpi_output_handle ,
81- "%s %s: comm %s:%d is marked revoked locally" ,
82- OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), __func__ , ompi_comm_print_cid (comm ), comm -> c_epoch ));
82+ "%s %s: comm %s:%d is marked %srevoked locally" ,
83+ OMPI_NAME_PRINT (OMPI_PROC_MY_NAME ), __func__ , ompi_comm_print_cid (comm ), comm -> c_epoch ,
84+ coll_only ? "coll " : "" ));
8385 /*
8486 * Locally revoke the communicator
8587 *
@@ -90,11 +92,17 @@ static int ompi_comm_revoke_local(ompi_communicator_t* comm, ompi_comm_rbcast_me
9092 */
9193 comm -> any_source_enabled = false;
9294 /* purge the communicator unexpected fragments and matching logic */
93- MCA_PML_CALL (revoke_comm (comm , false ));
95+ MCA_PML_CALL (revoke_comm (comm , coll_only ));
9496 /* revoke any subcomms created by coll */
9597 comm -> c_coll -> coll_revoke_local (comm );
9698 /* Signal the point-to-point stack to recheck requests */
9799 wait_sync_global_wakeup (MPI_ERR_REVOKED );
98100 return true;
99101}
100102
103+ /* internal code to revoke the communicator structure. Can be called from the
104+ * API or from receiving a revoke message */
105+ static int ompi_comm_revoke_msg_cb (ompi_communicator_t * comm , ompi_comm_rbcast_message_t * msg )
106+ {
107+ return ompi_comm_revoke_local (comm , false);
108+ }
0 commit comments