From fa2d51e40e0f3dca273e2162a2b4894857f1cfd2 Mon Sep 17 00:00:00 2001 From: Artem Polyakov Date: Sat, 19 May 2018 04:18:02 +0700 Subject: [PATCH] debug binding --- ompi/runtime/ompi_mpi_init.c | 1 + orte/mca/ess/base/ess_base_fns.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index 109ad9328cf..ad6fec40087 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -513,6 +513,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) OMPI_TIMING_NEXT("rte_init"); OMPI_TIMING_IMPORT_OPAL("orte_ess_base_app_setup"); OMPI_TIMING_IMPORT_OPAL("rte_init"); + OMPI_TIMING_IMPORT_OPAL("orte_ess_base_proc_binding"); ompi_rte_initialized = true; diff --git a/orte/mca/ess/base/ess_base_fns.c b/orte/mca/ess/base/ess_base_fns.c index 9b57519e801..6675017bd1b 100644 --- a/orte/mca/ess/base/ess_base_fns.c +++ b/orte/mca/ess/base/ess_base_fns.c @@ -39,6 +39,7 @@ #include "orte/util/name_fns.h" #include "orte/util/proc_info.h" #include "orte/util/show_help.h" +#include "opal/util/timings.h" #include "orte/runtime/orte_globals.h" #include "orte/mca/ess/base/base.h" @@ -55,6 +56,8 @@ int orte_ess_base_proc_binding(void) char *error=NULL; hwloc_cpuset_t mycpus; + OPAL_TIMING_ENV_INIT(proc_binding); + /* Determine if we were pre-bound or not - this also indicates * that we were launched via mpirun, bound or not */ if (NULL != getenv(OPAL_MCA_PREFIX"orte_bound_at_launch")) { @@ -98,12 +101,16 @@ int orte_ess_base_proc_binding(void) /* the topology system will pickup the binding pattern */ } + OPAL_TIMING_ENV_NEXT(proc_binding, "check if bound"); + /* load the topology as we will likely need it */ if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) { /* there is nothing we can do, so just return */ return ORTE_SUCCESS; } + OPAL_TIMING_ENV_NEXT(proc_binding, "get_topology()"); + /* see if we were bound when launched */ if (!orte_proc_is_bound) { OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output, @@ -285,6 +292,8 @@ int orte_ess_base_proc_binding(void) ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); } + OPAL_TIMING_ENV_NEXT(proc_binding, "bind"); + MOVEON: /* get the cpus we are bound to */ mycpus = hwloc_bitmap_alloc(); @@ -324,6 +333,9 @@ int orte_ess_base_proc_binding(void) OPAL_MODEX_SEND_VALUE(ret, OPAL_PMIX_GLOBAL, OPAL_PMIX_CPUSET, orte_process_info.cpuset, OPAL_STRING); } + + OPAL_TIMING_ENV_NEXT(proc_binding, "done"); + return ORTE_SUCCESS; error: