Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ompi/dpm/dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
opal_list_append(&job_info, &info->super);
}

#if OPAL_HAVE_HWLOC
/* check for 'bind_to' - job-level key */
ompi_info_get(array_of_info[i], "bind_to", sizeof(slot_list) - 1, slot_list, &flag);
if ( flag ) {
Expand All @@ -866,7 +865,6 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
opal_value_load(info, slot_list, OPAL_STRING);
opal_list_append(&job_info, &info->super);
}
#endif

/* check for 'preload_binary' - job-level key */
ompi_info_get_bool(array_of_info[i], "ompi_preload_binary", &local_spawn, &flag);
Expand Down
15 changes: 1 addition & 14 deletions ompi/mca/coll/sm/coll_sm_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -245,9 +246,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
mca_coll_sm_comm_t *data = NULL;
size_t control_size, frag_size;
mca_coll_sm_component_t *c = &mca_coll_sm_component;
#if OPAL_HAVE_HWLOC
opal_hwloc_base_memory_segment_t *maffinity;
#endif
int parent, min_child, num_children;
unsigned char *base = NULL;
const int num_barrier_buffers = 2;
Expand All @@ -258,7 +257,6 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
}
sm_module->enabled = true;

#if OPAL_HAVE_HWLOC
/* Get some space to setup memory affinity (just easier to try to
alloc here to handle the error case) */
maffinity = (opal_hwloc_base_memory_segment_t*)
Expand All @@ -270,7 +268,6 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
comm->c_contextid, comm->c_name);
return OMPI_ERR_OUT_OF_RESOURCE;
}
#endif

/* Allocate data to hang off the communicator. The memory we
alloc will be laid out as follows:
Expand All @@ -292,9 +289,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
(sizeof(mca_coll_sm_tree_node_t) +
(sizeof(mca_coll_sm_tree_node_t*) * c->sm_tree_degree))));
if (NULL == data) {
#if OPAL_HAVE_HWLOC
free(maffinity);
#endif
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:enable (%d/%s): malloc failed (2)",
comm->c_contextid, comm->c_name);
Expand Down Expand Up @@ -359,9 +354,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
/* Attach to this communicator's shmem data segment */
if (OMPI_SUCCESS != (ret = bootstrap_comm(comm, sm_module))) {
free(data);
#if OPAL_HAVE_HWLOC
free(maffinity);
#endif
sm_module->sm_comm_data = NULL;
return ret;
}
Expand Down Expand Up @@ -407,11 +400,9 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
that they're marked as unused. */
j = 0;
if (0 == rank) {
#if OPAL_HAVE_HWLOC
maffinity[j].mbs_start_addr = base;
maffinity[j].mbs_len = c->sm_control_size *
c->sm_comm_num_in_use_flags;
#endif
/* Set the op counts to 1 (actually any nonzero value will do)
so that the first time children/leaf processes come
through, they don't see a value of 0 and think that the
Expand All @@ -436,7 +427,6 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
(((char*) data->mcb_data_index[i].mcbmi_control) +
control_size);

#if OPAL_HAVE_HWLOC
/* Memory affinity: control */

maffinity[j].mbs_len = c->sm_control_size;
Expand All @@ -452,15 +442,12 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
((char*) data->mcb_data_index[i].mcbmi_data) +
(rank * c->sm_control_size);
++j;
#endif
}

#if OPAL_HAVE_HWLOC
/* Setup memory affinity so that the pages that belong to this
process are local to this process */
opal_hwloc_base_memory_set(maffinity, j);
free(maffinity);
#endif

/* Zero out the control structures that belong to this process */
memset(data->mcb_barrier_control_me, 0,
Expand Down
67 changes: 14 additions & 53 deletions ompi/mpiext/affinity/c/mpiext_affinity_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -41,43 +42,6 @@ static const char FUNC_NAME[] = "OMPI_Affinity";
static const char ompi_nobind_str[] = "Open MPI did not bind this process";
static const char not_bound_str[] = "Not bound (i.e., bound to all processors)";

/**************************************************************************
* Utility routine
**************************************************************************/

static void no_hwloc_support(char ompi_bound[OMPI_AFFINITY_STRING_MAX],
char current_binding[OMPI_AFFINITY_STRING_MAX],
char exists[OMPI_AFFINITY_STRING_MAX])
{
strncpy(ompi_bound, "Not supported", OMPI_AFFINITY_STRING_MAX);
strncpy(current_binding, "Not supported", OMPI_AFFINITY_STRING_MAX);
strncpy(exists, "Not supported", OMPI_AFFINITY_STRING_MAX);
}

/**************************************************************************
* If we have no hwloc support compiled in, do almost nothing.
**************************************************************************/

#if !OPAL_HAVE_HWLOC
/*
* If hwloc support was not compiled in, then just return "Not
* supported".
*/
int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type,
char ompi_bound[OMPI_AFFINITY_STRING_MAX],
char current_binding[OMPI_AFFINITY_STRING_MAX],
char exists[OMPI_AFFINITY_STRING_MAX])
{
no_hwloc_support(ompi_bound, current_binding, exists);
return MPI_SUCCESS;
}
#endif // !OPAL_HAVE_HWLOC

/**************************************************************************
* If we have hwloc support compiled in, do the actual work.
**************************************************************************/

#if OPAL_HAVE_HWLOC

static int get_rsrc_ompi_bound(char str[OMPI_AFFINITY_STRING_MAX]);
static int get_rsrc_current_binding(char str[OMPI_AFFINITY_STRING_MAX]);
Expand All @@ -99,29 +63,27 @@ int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type,

/* If we have no hwloc support, return nothing */
if (NULL == opal_hwloc_topology) {
no_hwloc_support(ompi_bound, current_binding, exists);

return MPI_SUCCESS;
}

/* Otherwise, return useful information */
switch (fmt_type) {
case OMPI_AFFINITY_RSRC_STRING_FMT:
if (OMPI_SUCCESS != (ret = get_rsrc_ompi_bound(ompi_bound)) ||
OMPI_SUCCESS != (ret = get_rsrc_current_binding(current_binding)) ||
OMPI_SUCCESS != (ret = get_rsrc_exists(exists))) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret, FUNC_NAME);
}
break;
if (OMPI_SUCCESS != (ret = get_rsrc_ompi_bound(ompi_bound)) ||
OMPI_SUCCESS != (ret = get_rsrc_current_binding(current_binding)) ||
OMPI_SUCCESS != (ret = get_rsrc_exists(exists))) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret, FUNC_NAME);
}
break;
case OMPI_AFFINITY_LAYOUT_FMT:
if (OMPI_SUCCESS != (ret = get_layout_ompi_bound(ompi_bound)) ||
OMPI_SUCCESS != (ret = get_layout_current_binding(current_binding)) ||
OMPI_SUCCESS != (ret = get_layout_exists(exists))) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret, FUNC_NAME);
}
break;
if (OMPI_SUCCESS != (ret = get_layout_ompi_bound(ompi_bound)) ||
OMPI_SUCCESS != (ret = get_layout_current_binding(current_binding)) ||
OMPI_SUCCESS != (ret = get_layout_exists(exists))) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret, FUNC_NAME);
}
break;
default:
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
}

return MPI_SUCCESS;
Expand Down Expand Up @@ -457,4 +419,3 @@ static int get_layout_exists(char str[OMPI_AFFINITY_STRING_MAX])

return OMPI_SUCCESS;
}
#endif /* OPAL_HAVE_HWLOC */
2 changes: 0 additions & 2 deletions ompi/runtime/ompi_mpi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
/* check for timing request - get stop time and report elapsed time if so */
OPAL_TIMING_MNEXT((&tm,"time from completion of rte_init to modex"));

#if OPAL_HAVE_HWLOC
/* if hwloc is available but didn't get setup for some
* reason, do so now
*/
Expand All @@ -504,7 +503,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
goto error;
}
}
#endif

/* Register the default errhandler callback - RTE will ignore if it
* doesn't support this capability
Expand Down
3 changes: 2 additions & 1 deletion ompi/tools/ompi_info/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -266,7 +267,7 @@ void ompi_info_do_config(bool want_all)
have_mpi_io = OMPI_PROVIDE_MPI_FILE_INTERFACE ? "yes" : "no";
wtime_support = OPAL_TIMER_USEC_NATIVE ? "native" : "gettimeofday";
symbol_visibility = OPAL_C_HAVE_VISIBILITY ? "yes" : "no";
topology_support = OPAL_HAVE_HWLOC ? "yes" : "no";
topology_support = "yes";

/* setup strings that require allocation */
if (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_MPIFH_BINDINGS) {
Expand Down
4 changes: 1 addition & 3 deletions opal/mca/btl/openib/btl_openib.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright (c) 2006-2007 Voltaire All rights reserved.
* Copyright (c) 2008-2012 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009 IBM Corporation. All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
Expand Down Expand Up @@ -84,9 +84,7 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef OPAL_HAVE_HWLOC
#include "opal/mca/hwloc/hwloc.h"
#endif

#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
Expand Down
8 changes: 0 additions & 8 deletions opal/mca/btl/openib/btl_openib_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,6 @@ static uint64_t read_module_param(char *file, uint64_t value, uint64_t max)
/* calculate memory registation limits */
static uint64_t calculate_total_mem (void)
{
#if OPAL_HAVE_HWLOC
hwloc_obj_t machine;

machine = hwloc_get_next_obj_by_type (opal_hwloc_topology, HWLOC_OBJ_MACHINE, NULL);
Expand All @@ -1494,9 +1493,6 @@ static uint64_t calculate_total_mem (void)
}

return machine->memory.total_memory;
#else
return 0;
#endif
}


Expand Down Expand Up @@ -2306,7 +2302,6 @@ static float get_ib_dev_distance(struct ibv_device *dev)
return distance;
}

#if OPAL_HAVE_HWLOC
float a, b;
int i;
hwloc_cpuset_t my_cpuset = NULL, ibv_cpuset = NULL;
Expand Down Expand Up @@ -2445,7 +2440,6 @@ static float get_ib_dev_distance(struct ibv_device *dev)
if (NULL != my_cpuset) {
hwloc_bitmap_free(my_cpuset);
}
#endif

return distance;
}
Expand All @@ -2465,13 +2459,11 @@ sort_devs_by_distance(struct ibv_device **ib_devs, int count)
"Checking distance from this process to device=%s", ibv_get_device_name(ib_devs[i]));
/* If we're not bound, just assume that the device is close. */
devs[i].distance = 0;
#if OPAL_HAVE_HWLOC
if (opal_process_info.cpuset) {
/* If this process is bound to one or more PUs, we can get
an accurate distance. */
devs[i].distance = get_ib_dev_distance(ib_devs[i]);
}
#endif
opal_output_verbose(5, opal_btl_base_framework.framework_output,
"Process is %s: distance to device is %f",
(opal_process_info.cpuset ? "bound" : "not bound"), devs[i].distance);
Expand Down
4 changes: 1 addition & 3 deletions opal/mca/btl/sm/btl_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* All rights reserved.
* Copyright (c) 2010-2012 IBM Corporation. All rights reserved.
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -226,7 +226,6 @@ sm_btl_first_time_init(mca_btl_sm_t *sm_btl,
mca_btl_sm_component.mem_node = my_mem_node = 0;
mca_btl_sm_component.num_mem_nodes = num_mem_nodes = 1;

#if OPAL_HAVE_HWLOC
/* If we have hwloc support, then get accurate information */
if (NULL != opal_hwloc_topology) {
i = opal_hwloc_base_get_nbobjs_by_type(opal_hwloc_topology,
Expand Down Expand Up @@ -276,7 +275,6 @@ sm_btl_first_time_init(mca_btl_sm_t *sm_btl,
}
}
}
#endif

if (NULL == (res = calloc(1, sizeof(*res)))) {
return OPAL_ERR_OUT_OF_RESOURCE;
Expand Down
3 changes: 1 addition & 2 deletions opal/mca/btl/smcuda/btl_smcuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -234,7 +235,6 @@ smcuda_btl_first_time_init(mca_btl_smcuda_t *smcuda_btl,
mca_btl_smcuda_component.mem_node = my_mem_node = 0;
mca_btl_smcuda_component.num_mem_nodes = num_mem_nodes = 1;

#if OPAL_HAVE_HWLOC
/* If we have hwloc support, then get accurate information */
if (NULL != opal_hwloc_topology) {
i = opal_hwloc_base_get_nbobjs_by_type(opal_hwloc_topology,
Expand Down Expand Up @@ -284,7 +284,6 @@ smcuda_btl_first_time_init(mca_btl_smcuda_t *smcuda_btl,
}
}
}
#endif

if (NULL == (res = calloc(1, sizeof(*res)))) {
return OPAL_ERR_OUT_OF_RESOURCE;
Expand Down
6 changes: 2 additions & 4 deletions opal/mca/btl/usnic/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Copyright (c) 2006 Sandia National Laboratories. All rights
# reserved.
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -48,6 +49,7 @@ sources = \
btl_usnic_frag.h \
btl_usnic_graph.h \
btl_usnic_graph.c \
btl_usnic_hwloc.c \
btl_usnic_hwloc.h \
btl_usnic_map.c \
btl_usnic_mca.c \
Expand All @@ -65,10 +67,6 @@ sources = \
btl_usnic_test.h \
$(test_sources)

if OPAL_HAVE_HWLOC
sources += btl_usnic_hwloc.c
endif

# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
Expand Down
2 changes: 1 addition & 1 deletion opal/mca/btl/usnic/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ have to make 3 changes in the resulting code in master:
*** Note 2: CARE MUST BE TAKEN WHEN COPYING THE OTHER DIRECTION! It
is *not* as simple as simple s/opal/ompi/gi in configure.m4 and
Makefile.am. It certainly can be done, but there's a few strings
that need to stay "opal" or "OPAL" (e.g., OPAL_HAVE_HWLOC).
that need to stay "opal" or "OPAL" (e.g., OPAL_HAVE_FOO).
Hence, the string replace will likely need to be done via manual
inspection.

Expand Down
Loading