From 99ebaacb542ddcdf87b9b30f048d88eb06f597d8 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 15 Jul 2005 15:23:19 +0000 Subject: [PATCH] Use new OMPI_PROC_FLAG_LOCAL to determine if all procs in the communicator are on the same node or not. This commit was SVN r6523. --- ompi/mca/coll/sm/coll_sm_module.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ompi/mca/coll/sm/coll_sm_module.c b/ompi/mca/coll/sm/coll_sm_module.c index 90adf561de..d0079d75f5 100644 --- a/ompi/mca/coll/sm/coll_sm_module.c +++ b/ompi/mca/coll/sm/coll_sm_module.c @@ -60,7 +60,8 @@ int mca_coll_sm_param_priority = -1; /* * Initial query function that is invoked during MPI_INIT, allowing - * this module to indicate what level of thread support it provides. + * this component to disqualify itself if it doesn't support the + * required level of thread support. */ int mca_coll_sm_init_query(bool enable_progress_threads, bool enable_mpi_threads) @@ -80,6 +81,8 @@ const mca_coll_base_module_1_0_0_t * mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority, struct mca_coll_base_comm_t **data) { + int i; + /* If we're intercomm, or if there's only one process in the communicator, we don't want to run */ @@ -98,6 +101,13 @@ mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority, /* We only want to run if all the processes in the communicator are on the same node */ + for (i = 0; i < ompi_comm_size(comm); ++i) { + if (0 == (comm->c_local_group->grp_proc_pointers[i]->proc_flags & + OMPI_PROC_FLAG_LOCAL)) { + return NULL; + } + } + /* Can we get an mpool allocation? */ /* JMS ... */