From e8aea2ebfcd8ce3e5f96b8f5d8c62ca4c64cfb34 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Fri, 30 Dec 2016 16:19:42 -0800 Subject: [PATCH] Minor cleanups Signed-off-by: Ralph Castain --- opal/mca/pmix/pmix2x/configure.m4 | 2 +- opal/mca/pmix/pmix2x/pmix2x_client.c | 1 - orte/test/mpi/binding.c | 13 ++++++++----- orte/test/mpi/hello.c | 12 +++++++----- orte/test/system/opal_hwloc.c | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/opal/mca/pmix/pmix2x/configure.m4 b/opal/mca/pmix/pmix2x/configure.m4 index 6e5a5a1767..9d12fb8192 100644 --- a/opal/mca/pmix/pmix2x/configure.m4 +++ b/opal/mca/pmix/pmix2x/configure.m4 @@ -49,7 +49,7 @@ AC_DEFUN([MCA_opal_pmix_pmix2x_CONFIG],[ opal_pmix_pmix2x_sm_flag=--disable-dstore fi - opal_pmix_pmix2x_args="--with-pmix-symbol-rename=OPAL_MCA_PMIX3X_ $opal_pmix_pmix2x_sm_flag --without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\" --enable-embedded-hwloc --with-hwloc-header=\\\"$opal_hwloc_base_include\\\"" + opal_pmix_pmix2x_args="--with-pmix-symbol-rename=OPAL_MCA_PMIX3X_ $opal_pmix_pmix2x_sm_flag --without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\"" AS_IF([test "$enable_debug" = "yes"], [opal_pmix_pmix2x_args="--enable-debug $opal_pmix_pmix2x_args" CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"], diff --git a/opal/mca/pmix/pmix2x/pmix2x_client.c b/opal/mca/pmix/pmix2x/pmix2x_client.c index fe0de9d59c..c2728a68e4 100644 --- a/opal/mca/pmix/pmix2x/pmix2x_client.c +++ b/opal/mca/pmix/pmix2x/pmix2x_client.c @@ -192,7 +192,6 @@ int pmix2x_store_local(const opal_process_name_t *proc, opal_value_t *val) } } if (NULL == job) { - OPAL_ERROR_LOG(OPAL_ERR_NOT_FOUND); return OPAL_ERR_NOT_FOUND; } (void)strncpy(p.nspace, job->nspace, PMIX_MAX_NSLEN); diff --git a/orte/test/mpi/binding.c b/orte/test/mpi/binding.c index 622ea9a65e..a8a641f1a1 100644 --- a/orte/test/mpi/binding.c +++ b/orte/test/mpi/binding.c @@ -10,7 +10,7 @@ #include #include #include -#include "opal/mca/hwloc/hwloc.h" +#include "opal/mca/hwloc/base/base.h" #include "mpi.h" #include "orte/util/proc_info.h" @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) { int rank, size, rc; hwloc_cpuset_t cpus; - char *bindings; + char *bindings = NULL; cpu_set_t *mask; int nrcpus, c; size_t csize; @@ -30,9 +30,12 @@ int main(int argc, char* argv[]) MPI_Comm_size(MPI_COMM_WORLD, &size); gethostname(hostname, 1024); - cpus = hwloc_bitmap_alloc(); - rc = hwloc_get_cpubind(opal_hwloc_topology, cpus, HWLOC_CPUBIND_PROCESS); - hwloc_bitmap_list_asprintf(&bindings, cpus); + + if (OPAL_SUCCESS == opal_hwloc_base_get_topology()) { + cpus = hwloc_bitmap_alloc(); + rc = hwloc_get_cpubind(opal_hwloc_topology, cpus, HWLOC_CPUBIND_PROCESS); + hwloc_bitmap_list_asprintf(&bindings, cpus); + } printf("[%s;%d] Hello, World, I am %d of %d [%d local peers]: get_cpubind: %d bitmap %s\n", hostname, (int)getpid(), rank, size, orte_process_info.num_local_peers, rc, diff --git a/orte/test/mpi/hello.c b/orte/test/mpi/hello.c index e8dbb2ac2c..6f1e430fb7 100644 --- a/orte/test/mpi/hello.c +++ b/orte/test/mpi/hello.c @@ -6,7 +6,7 @@ */ #include -#include "opal/mca/hwloc/hwloc.h" +#include "opal/mca/hwloc/base/base.h" #include "mpi.h" #include "orte/util/proc_info.h" @@ -15,15 +15,17 @@ int main(int argc, char* argv[]) { int rank, size, rc; hwloc_cpuset_t cpus; - char *bindings; + char *bindings = NULL; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); - cpus = hwloc_bitmap_alloc(); - rc = hwloc_get_cpubind(opal_hwloc_topology, cpus, HWLOC_CPUBIND_PROCESS); - hwloc_bitmap_list_asprintf(&bindings, cpus); + if (OPAL_SUCCESS == opal_hwloc_base_get_topology()) { + cpus = hwloc_bitmap_alloc(); + rc = hwloc_get_cpubind(opal_hwloc_topology, cpus, HWLOC_CPUBIND_PROCESS); + hwloc_bitmap_list_asprintf(&bindings, cpus); + } printf("Hello, World, I am %d of %d [%d local peers]: get_cpubind: %d bitmap %s\n", rank, size, orte_process_info.num_local_peers, rc, diff --git a/orte/test/system/opal_hwloc.c b/orte/test/system/opal_hwloc.c index da8180998a..f07cbf2bf3 100644 --- a/orte/test/system/opal_hwloc.c +++ b/orte/test/system/opal_hwloc.c @@ -22,7 +22,7 @@ static void fill_cache_line_size(void) /* Look for the smallest L2 cache size */ size = 4096; while (1) { - obj = opal_hwloc_base_get_obj_by_type(opal_hwloc_topology, + obj = opal_hwloc_base_get_obj_by_type(my_topology, HWLOC_OBJ_CACHE, 2, i, OPAL_HWLOC_LOGICAL); if (NULL == obj) {