1
1

Merge pull request #868 from rhc54/topic/hwloc

Remove OPAL_HAVE_HWLOC qualifier and error out if --without-hwloc is given
Этот коммит содержится в:
rhc54 2015-09-04 17:58:07 -07:00
родитель 2ecbbc84e7 d97bc29102
Коммит 665b30376a
74 изменённых файлов: 697 добавлений и 1278 удалений

Просмотреть файл

@ -773,7 +773,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 ) {
@ -782,7 +781,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);

Просмотреть файл

@ -1,18 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_coll_ml_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_ompi_coll_ml_CONFIG], [
AC_CONFIG_FILES([ompi/mca/coll/ml/Makefile])
AS_IF([test "$OPAL_HAVE_HWLOC" = 1],
[$1],
[$2])
])

Просмотреть файл

@ -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
@ -247,9 +248,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;
@ -260,7 +259,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*)
@ -272,7 +270,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:
@ -294,9 +291,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);
@ -361,9 +356,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;
}
@ -409,11 +402,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
@ -438,7 +429,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;
@ -454,15 +444,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,

Просмотреть файл

@ -1,19 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2012 Los Alamos National Security, LLC.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_sbgp_basesmsocket_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_ompi_sbgp_basesmsocket_CONFIG], [
AC_CONFIG_FILES([ompi/mca/sbgp/basesmsocket/Makefile])
AS_IF([test "$OPAL_HAVE_HWLOC" = 1],
[$1],
[$2])
])

Просмотреть файл

@ -5,7 +5,8 @@
# reserved.
# Copyright (c) 2011-2015 INRIA. All rights reserved.
# Copyright (c) 2011-2015 Universite Bordeaux 1
# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -34,13 +35,6 @@ AC_DEFUN([MCA_ompi_topo_treematch_CONFIG], [
ompi_topo_treematch_libdir=
ompi_topo_treematch_happy=0
AC_MSG_CHECKING([for hwloc support])
AS_IF([test $OPAL_HAVE_HWLOC -eq 0],
[AC_MSG_RESULT([no (treematch requires hwloc)])
ompi_topo_treematch_happy=0],
[AC_MSG_RESULT([yes])
ompi_topo_treematch_happy=1])
AS_IF([test $ompi_topo_treematch_happy -eq 1],
[AS_IF([test "x$with_treematch" != xno],
[AC_MSG_CHECKING([TreeMatch headers])

Просмотреть файл

@ -15,9 +15,7 @@
#include "ompi_config.h"
#include "opal/constants.h"
#if defined(OPAL_HAVE_HWLOC)
#include "opal/mca/hwloc/hwloc.h"
#endif /* defined(OPAL_HAVE_HWLOC) */
#include "ompi/mca/topo/treematch/topo_treematch.h"
#include "ompi/mca/topo/treematch/treematch/tm_mapping.h"

Просмотреть файл

@ -8,6 +8,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
@ -40,43 +41,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]);
@ -98,29 +62,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;
@ -456,4 +418,3 @@ static int get_layout_exists(char str[OMPI_AFFINITY_STRING_MAX])
return OMPI_SUCCESS;
}
#endif /* OPAL_HAVE_HWLOC */

Просмотреть файл

@ -474,7 +474,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
*/
@ -484,7 +483,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

Просмотреть файл

@ -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
@ -272,7 +273,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) {

Просмотреть файл

@ -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.
@ -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))

Просмотреть файл

@ -1508,7 +1508,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);
@ -1517,9 +1516,6 @@ static uint64_t calculate_total_mem (void)
}
return machine->memory.total_memory;
#else
return 0;
#endif
}
@ -2329,7 +2325,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;
@ -2456,7 +2451,6 @@ static float get_ib_dev_distance(struct ibv_device *dev)
if (NULL != my_cpuset) {
hwloc_bitmap_free(my_cpuset);
}
#endif
return distance;
}
@ -2474,13 +2468,11 @@ sort_devs_by_distance(struct ibv_device **ib_devs, int count)
devs[i].ib_dev = 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
}
qsort(devs, count, sizeof(struct dev_distance), compare_distance);

Просмотреть файл

@ -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$
@ -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,
@ -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;

Просмотреть файл

@ -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
@ -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,
@ -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;

Просмотреть файл

@ -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
@ -63,11 +64,8 @@ sources = \
btl_usnic_util.h \
btl_usnic_test.c \
btl_usnic_test.h \
$(test_sources)
if OPAL_HAVE_HWLOC
sources += btl_usnic_hwloc.c
endif
$(test_sources) \
btl_usnic_hwloc.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la

Просмотреть файл

@ -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.

Просмотреть файл

@ -38,11 +38,9 @@
/* JMS Really want to be able to get the job size somehow... But for
now, so that we can compile, just set it to a constant :-( */
# define USNIC_MCW_SIZE 2
#if OPAL_HAVE_HWLOC
# define proc_bound() (NULL != opal_process_info.cpuset ? 1 : 0)
#else
# define proc_bound() 0
#endif
# define proc_bound() (NULL != opal_process_info.cpuset ? 1 : 0)
# define USNIC_BTL_DEFAULT_VERSION(name) MCA_BTL_DEFAULT_VERSION(name)
# define USNIC_SEND_LOCAL des_segments

Просмотреть файл

@ -7,11 +7,6 @@
* $HEADER$
*/
/*
* This file is only compiled (via AM_CONDITIONAL) if OPAL_HAVE_HWLOC
* is set.
*/
#include "opal_config.h"
/* Define this before including hwloc.h so that we also get the hwloc

Просмотреть файл

@ -15,8 +15,6 @@
#include "btl_usnic_module.h"
#if OPAL_HAVE_HWLOC
int opal_btl_usnic_hwloc_distance(opal_btl_usnic_module_t *module);
#endif
#endif /* BTL_USNIC_HWLOC_H */

Просмотреть файл

@ -14,6 +14,7 @@
* Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -205,7 +206,7 @@ int opal_btl_usnic_component_register(void)
"grdma", &mca_btl_usnic_component.usnic_mpool_name, 0,
OPAL_INFO_LVL_5));
want_numa_device_assignment = OPAL_HAVE_HWLOC ? 1 : -1;
want_numa_device_assignment = 1;
CHECK(reg_int("want_numa_device_assignment",
"If 1, use only Cisco VIC ports thare are a minimum NUMA distance from the MPI process for short messages. If 0, use all available Cisco VIC ports for short messages. This parameter is meaningless (and ignored) unless MPI proceses are bound to processor cores. Defaults to 1 if NUMA support is included in Open MPI; -1 otherwise.",
want_numa_device_assignment,

Просмотреть файл

@ -15,7 +15,7 @@
* Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -1940,7 +1940,6 @@ static void init_connectivity_checker(opal_btl_usnic_module_t *module)
static void init_hwloc(opal_btl_usnic_module_t *module)
{
#if OPAL_HAVE_HWLOC
/* If this process is bound to a single NUMA locality, calculate
its NUMA distance from this usNIC device */
if (mca_btl_usnic_component.want_numa_device_assignment) {
@ -1949,10 +1948,6 @@ static void init_hwloc(opal_btl_usnic_module_t *module)
opal_output_verbose(5, USNIC_OUT,
"btl:usnic: not sorting devices by NUMA distance (MCA btl_usnic_want_numa_device_assignment)");
}
#else
opal_output_verbose(5, USNIC_OUT,
"btl:usnic: not sorting devices by NUMA distance (topology support not included)");
#endif
}
static void init_procs(opal_btl_usnic_module_t *module)

Просмотреть файл

@ -1,5 +1,6 @@
#
# Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -13,12 +14,8 @@ headers += \
base/base.h
libmca_hwloc_la_SOURCES += \
base/hwloc_base_frame.c
if OPAL_HAVE_HWLOC
libmca_hwloc_la_SOURCES += \
base/hwloc_base_frame.c \
base/hwloc_base_dt.c \
base/hwloc_base_util.c \
base/hwloc_base_maffinity.c
endif

Просмотреть файл

@ -1,6 +1,6 @@
/*
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -57,7 +57,6 @@ opal_hwloc_print_buffers_t *opal_hwloc_get_print_buffer(void);
extern char* opal_hwloc_print_null;
OPAL_DECLSPEC char* opal_hwloc_base_print_locality(opal_hwloc_locality_t locality);
#if OPAL_HAVE_HWLOC
OPAL_DECLSPEC extern char *opal_hwloc_base_slot_list;
OPAL_DECLSPEC extern char *opal_hwloc_base_cpu_set;
OPAL_DECLSPEC extern hwloc_cpuset_t opal_hwloc_base_given_cpus;
@ -276,7 +275,6 @@ OPAL_DECLSPEC hwloc_obj_t opal_hwloc_base_get_pu(hwloc_topology_t topo,
* if responsible for freeing the returned string */
OPAL_DECLSPEC char* opal_hwloc_base_get_topo_signature(hwloc_topology_t topo);
#endif
END_C_DECLS

Просмотреть файл

@ -36,7 +36,6 @@
* Globals
*/
bool opal_hwloc_base_inited = false;
#if OPAL_HAVE_HWLOC
hwloc_topology_t opal_hwloc_topology=NULL;
hwloc_cpuset_t opal_hwloc_my_cpuset=NULL;
hwloc_cpuset_t opal_hwloc_base_given_cpus=NULL;
@ -58,9 +57,7 @@ hwloc_obj_type_t opal_hwloc_levels[] = {
};
bool opal_hwloc_use_hwthreads_as_cpus = false;
char *opal_hwloc_base_topo_file = NULL;
#endif
#if OPAL_HAVE_HWLOC
static mca_base_var_enum_value_t hwloc_base_map[] = {
{OPAL_HWLOC_BASE_MAP_NONE, "none"},
{OPAL_HWLOC_BASE_MAP_LOCAL_ONLY, "local_only"},
@ -73,7 +70,6 @@ static mca_base_var_enum_value_t hwloc_failure_action[] = {
{OPAL_HWLOC_BASE_MBFA_ERROR, "error"},
{0, NULL}
};
#endif
static int opal_hwloc_base_register(mca_base_register_flag_t flags);
static int opal_hwloc_base_open(mca_base_open_flag_t flags);
@ -82,15 +78,12 @@ static int opal_hwloc_base_close(void);
MCA_BASE_FRAMEWORK_DECLARE(opal, hwloc, NULL, opal_hwloc_base_register, opal_hwloc_base_open, opal_hwloc_base_close,
mca_hwloc_base_static_components, 0);
#if OPAL_HAVE_HWLOC
static char *opal_hwloc_base_binding_policy = NULL;
static bool opal_hwloc_base_bind_to_core = false;
static bool opal_hwloc_base_bind_to_socket = false;
#endif
static int opal_hwloc_base_register(mca_base_register_flag_t flags)
{
#if OPAL_HAVE_HWLOC
mca_base_var_enum_t *new_enum;
int ret;
@ -172,142 +165,132 @@ static int opal_hwloc_base_register(mca_base_register_flag_t flags)
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY, &opal_hwloc_base_topo_file);
#endif
/* register parameters */
return OPAL_SUCCESS;
}
static int opal_hwloc_base_open(mca_base_open_flag_t flags)
{
int rc;
opal_data_type_t tmp;
if (opal_hwloc_base_inited) {
return OPAL_SUCCESS;
}
opal_hwloc_base_inited = true;
#if OPAL_HAVE_HWLOC
{
int rc;
opal_data_type_t tmp;
if (OPAL_SUCCESS != (rc = opal_hwloc_base_set_binding_policy(&opal_hwloc_binding_policy,
opal_hwloc_base_binding_policy))) {
return rc;
}
if (OPAL_SUCCESS != (rc = opal_hwloc_base_set_binding_policy(&opal_hwloc_binding_policy,
opal_hwloc_base_binding_policy))) {
return rc;
if (opal_hwloc_base_bind_to_core) {
opal_show_help("help-opal-hwloc-base.txt", "deprecated", true,
"--bind-to-core", "--bind-to core",
"hwloc_base_bind_to_core", "hwloc_base_binding_policy=core");
/* set binding policy to core - error if something else already set */
if (OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy) &&
OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy) != OPAL_BIND_TO_CORE) {
/* error - cannot redefine the default ranking policy */
opal_show_help("help-opal-hwloc-base.txt", "redefining-policy", true,
"core", opal_hwloc_base_print_binding(opal_hwloc_binding_policy));
return OPAL_ERR_BAD_PARAM;
}
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CORE);
}
if (opal_hwloc_base_bind_to_core) {
opal_show_help("help-opal-hwloc-base.txt", "deprecated", true,
"--bind-to-core", "--bind-to core",
"hwloc_base_bind_to_core", "hwloc_base_binding_policy=core");
/* set binding policy to core - error if something else already set */
if (OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy) &&
OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy) != OPAL_BIND_TO_CORE) {
/* error - cannot redefine the default ranking policy */
opal_show_help("help-opal-hwloc-base.txt", "redefining-policy", true,
"core", opal_hwloc_base_print_binding(opal_hwloc_binding_policy));
return OPAL_ERR_BAD_PARAM;
}
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CORE);
if (opal_hwloc_base_bind_to_socket) {
opal_show_help("help-opal-hwloc-base.txt", "deprecated", true,
"--bind-to-socket", "--bind-to socket",
"hwloc_base_bind_to_socket", "hwloc_base_binding_policy=socket");
/* set binding policy to socket - error if something else already set */
if (OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy) &&
OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy) != OPAL_BIND_TO_SOCKET) {
/* error - cannot redefine the default ranking policy */
opal_show_help("help-opal-hwloc-base.txt", "redefining-policy", true,
"socket", opal_hwloc_base_print_binding(opal_hwloc_binding_policy));
return OPAL_ERR_SILENT;
}
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_SOCKET);
}
if (opal_hwloc_base_bind_to_socket) {
opal_show_help("help-opal-hwloc-base.txt", "deprecated", true,
"--bind-to-socket", "--bind-to socket",
"hwloc_base_bind_to_socket", "hwloc_base_binding_policy=socket");
/* set binding policy to socket - error if something else already set */
if (OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy) &&
OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy) != OPAL_BIND_TO_SOCKET) {
/* error - cannot redefine the default ranking policy */
opal_show_help("help-opal-hwloc-base.txt", "redefining-policy", true,
"socket", opal_hwloc_base_print_binding(opal_hwloc_binding_policy));
return OPAL_ERR_SILENT;
}
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_SOCKET);
/* did the user provide a slot list? */
if (NULL != opal_hwloc_base_slot_list) {
/* if we already were given a policy, then this is an error */
if (OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy)) {
opal_show_help("help-opal-hwloc-base.txt", "redefining-policy", true,
"socket", opal_hwloc_base_print_binding(opal_hwloc_binding_policy));
return OPAL_ERR_SILENT;
}
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CPUSET);
}
/* did the user provide a slot list? */
if (NULL != opal_hwloc_base_slot_list) {
/* if we already were given a policy, then this is an error */
if (OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy)) {
opal_show_help("help-opal-hwloc-base.txt", "redefining-policy", true,
"socket", opal_hwloc_base_print_binding(opal_hwloc_binding_policy));
return OPAL_ERR_SILENT;
}
/* cpu allocation specification */
if (NULL != opal_hwloc_base_cpu_set) {
if (!OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy)) {
/* it is okay if a binding policy was already given - just ensure that
* we do bind to the given cpus if provided, otherwise this would be
* ignored if someone didn't also specify a binding policy
*/
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CPUSET);
}
/* cpu allocation specification */
if (NULL != opal_hwloc_base_cpu_set) {
if (!OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy)) {
/* it is okay if a binding policy was already given - just ensure that
* we do bind to the given cpus if provided, otherwise this would be
* ignored if someone didn't also specify a binding policy
*/
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CPUSET);
}
}
/* if we are binding to hwthreads, then we must use hwthreads as cpus */
if (OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy) == OPAL_BIND_TO_HWTHREAD) {
opal_hwloc_use_hwthreads_as_cpus = true;
}
/* to support tools such as ompi_info, add the components
* to a list
*/
if (OPAL_SUCCESS !=
mca_base_framework_components_open(&opal_hwloc_base_framework, flags)) {
return OPAL_ERROR;
}
/* declare the hwloc data types */
tmp = OPAL_HWLOC_TOPO;
if (OPAL_SUCCESS != (rc = opal_dss.register_type(opal_hwloc_pack,
opal_hwloc_unpack,
(opal_dss_copy_fn_t)opal_hwloc_copy,
(opal_dss_compare_fn_t)opal_hwloc_compare,
(opal_dss_print_fn_t)opal_hwloc_print,
OPAL_DSS_STRUCTURED,
"OPAL_HWLOC_TOPO", &tmp))) {
return rc;
}
}
#endif
/* if we are binding to hwthreads, then we must use hwthreads as cpus */
if (OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy) == OPAL_BIND_TO_HWTHREAD) {
opal_hwloc_use_hwthreads_as_cpus = true;
}
/* to support tools such as ompi_info, add the components
* to a list
*/
if (OPAL_SUCCESS !=
mca_base_framework_components_open(&opal_hwloc_base_framework, flags)) {
return OPAL_ERROR;
}
/* declare the hwloc data types */
tmp = OPAL_HWLOC_TOPO;
if (OPAL_SUCCESS != (rc = opal_dss.register_type(opal_hwloc_pack,
opal_hwloc_unpack,
(opal_dss_copy_fn_t)opal_hwloc_copy,
(opal_dss_compare_fn_t)opal_hwloc_compare,
(opal_dss_print_fn_t)opal_hwloc_print,
OPAL_DSS_STRUCTURED,
"OPAL_HWLOC_TOPO", &tmp))) {
return rc;
}
return OPAL_SUCCESS;
}
static int opal_hwloc_base_close(void)
{
int ret;
if (!opal_hwloc_base_inited) {
return OPAL_SUCCESS;
}
#if OPAL_HAVE_HWLOC
{
int ret;
/* no need to close the component as it was statically opened */
/* for support of tools such as ompi_info */
ret = mca_base_framework_components_close (&opal_hwloc_base_framework, NULL);
if (OPAL_SUCCESS != ret) {
return ret;
}
/* free memory */
if (NULL != opal_hwloc_my_cpuset) {
hwloc_bitmap_free(opal_hwloc_my_cpuset);
opal_hwloc_my_cpuset = NULL;
}
/* destroy the topology */
if (NULL != opal_hwloc_topology) {
opal_hwloc_base_free_topology(opal_hwloc_topology);
opal_hwloc_topology = NULL;
}
/* no need to close the component as it was statically opened */
/* for support of tools such as ompi_info */
ret = mca_base_framework_components_close (&opal_hwloc_base_framework, NULL);
if (OPAL_SUCCESS != ret) {
return ret;
}
#endif
/* free memory */
if (NULL != opal_hwloc_my_cpuset) {
hwloc_bitmap_free(opal_hwloc_my_cpuset);
opal_hwloc_my_cpuset = NULL;
}
/* destroy the topology */
if (NULL != opal_hwloc_topology) {
opal_hwloc_base_free_topology(opal_hwloc_topology);
opal_hwloc_topology = NULL;
}
/* All done */
opal_hwloc_base_inited = false;
@ -445,7 +428,6 @@ char* opal_hwloc_base_print_locality(opal_hwloc_locality_t locality)
return ptr->buffers[ptr->cntr];
}
#if OPAL_HAVE_HWLOC
static void obj_data_const(opal_hwloc_obj_data_t *ptr)
{
ptr->available = NULL;
@ -586,4 +568,3 @@ int opal_hwloc_base_set_binding_policy(opal_binding_policy_t *policy, char *spec
*policy = tmp;
return OPAL_SUCCESS;
}
#endif

Просмотреть файл

@ -24,9 +24,7 @@ m4_define(MCA_opal_hwloc_CONFIGURE_MODE, STOP_AT_FIRST)
# available. As such, we may need to artificially force this
# framework to be configured first. Hence, we move the entirety of
# the hwloc framework's m4 to a separate macro and AC REQUIRE it.
# Other components can do this as well. This will guarantee that
# OPAL_HAVE_HWLOC is set to 0 or 1 *before* some component needs to
# check it.
# Other components can do this as well.
AC_DEFUN([MCA_opal_hwloc_CONFIG],[
# Use a crude shell variable to know whether this component is
@ -48,10 +46,10 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
[echo " "
echo "==> Pre-emptively configuring the hwloc framework to satisfy dependencies."])
# See if we want hwloc, and if so, internal vs external
# See if we want internal vs external hwloc
AC_ARG_WITH(hwloc,
AC_HELP_STRING([--with-hwloc(=DIR)],
[Build hwloc support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" (or no DIR value) forces Open MPI to use its internal copy of hwloc. "external" forces Open MPI to use an external installation of hwloc. Supplying a valid directory name also forces Open MPI to use an external installation of hwloc, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries.]))
[Build hwloc support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" (or no DIR value) forces Open MPI to use its internal copy of hwloc. "external" forces Open MPI to use an external installation of hwloc. Supplying a valid directory name also forces Open MPI to use an external installation of hwloc, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-hwloc.]))
# Whether to enable or disable PCI support in embedded hwloc
# support.
@ -70,12 +68,18 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
enable_pci=])
])
# set defaults of not having any support
opal_hwloc_base_enable_xml=0
OPAL_HAVE_HWLOC=0
# check for error
AS_IF([test "$with_hwloc" = "no"],
[AC_MSG_WARN([Open MPI requires HWLOC support. It can be built])
AC_MSG_WARN([with either its own internal copy of HWLOC, or with])
AC_MSG_WARN([an external copy that you supply.])
AC_MSG_ERROR([Cannot continue])])
# Configure all the components - always have to do this, even if
# we configure --without-hwloc. Note that instead of passing in
# set default
opal_hwloc_base_enable_xml=0
# Configure all the components - always have to do this. Note that
# instead of passing in
# the traditional $1 and $2 as the first arguments, we hard-code
# "opal" and "hwloc", because this macro is invoked via AC
# REQUIRE.
@ -88,9 +92,8 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
# component's configure.m4 output.
echo " "
# Unless --with-hwloc[=<foo>] was given, it's ok to have no hwloc
# component.
AS_IF([test "$with_hwloc" = "no" -o "$with_hwloc" = ""], [],
# If we aren't given a specific component, then we must find one
AS_IF([test "$with_hwloc" = ""], [],
[ # STOP_AT_FIRST_PRIORITY will guarantee that we find at most
# one. We need to check here that we found *at least* one.
AS_IF([test "$MCA_opal_hwloc_STATIC_COMPONENTS" = ""],
@ -101,8 +104,6 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
# If we have a winning component, do some more logic
AS_IF([test "$MCA_opal_hwloc_STATIC_COMPONENTS" != ""],
[ # We had a winner -- w00t!
OPAL_HAVE_HWLOC=1
# The winning component will have told us where their header file
# is located
AC_MSG_CHECKING([for winning hwloc component header file])
@ -142,10 +143,6 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
OPAL_VAR_SCOPE_POP
])
AM_CONDITIONAL(OPAL_HAVE_HWLOC, test $OPAL_HAVE_HWLOC -eq 1)
AC_DEFINE_UNQUOTED(OPAL_HAVE_HWLOC, $OPAL_HAVE_HWLOC,
[Whether we have hwloc support or not])
# Similar to above, if this m4 is being invoked "early" via AC
# REQUIRE, print out a nice banner that we have now finished
# pre-emption and are returning to the Normal Order Of Things.

Просмотреть файл

@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
*
@ -128,7 +128,6 @@ typedef struct {
} opal_hwloc_base_memory_segment_t;
/* include implementation to call */
#if OPAL_HAVE_HWLOC
#include MCA_hwloc_IMPLEMENTATION_HEADER
/* define type of processor info requested */
@ -219,8 +218,6 @@ OPAL_DECLSPEC extern bool opal_hwloc_report_bindings;
OPAL_DECLSPEC extern hwloc_obj_type_t opal_hwloc_levels[];
OPAL_DECLSPEC extern bool opal_hwloc_use_hwthreads_as_cpus;
#endif
END_C_DECLS
#endif /* OPAL_HWLOC_H_ */

Просмотреть файл

@ -13,6 +13,7 @@
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2011-2014 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -91,9 +92,7 @@ void* mca_mpool_sm_alloc(
if(mpool_sm->mem_node >= 0) {
mseg.mbs_len = size;
#if OPAL_HAVE_HWLOC
opal_hwloc_base_membind(&mseg, 1, mpool_sm->mem_node);
#endif
}
return mseg.mbs_start_addr;
@ -116,9 +115,7 @@ void* mca_mpool_sm_realloc(
registration);
if(mpool_sm->mem_node >= 0) {
mseg.mbs_len = size;
#if OPAL_HAVE_HWLOC
opal_hwloc_base_membind(&mseg, 1, mpool_sm->mem_node);
#endif
}
return mseg.mbs_start_addr;

Просмотреть файл

@ -658,7 +658,6 @@ static int cray_fence(opal_list_t *procs, int collect_data)
"%s pmix:cray kvs_fence complete",
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME));
#if OPAL_HAVE_HWLOC
/* fetch my cpuset */
OBJ_CONSTRUCT(&vals, opal_list_t);
if (OPAL_SUCCESS == (rc = opal_pmix_base_fetch(&pmix_pname,
@ -669,7 +668,6 @@ static int cray_fence(opal_list_t *procs, int collect_data)
cpuset = NULL;
}
OPAL_LIST_DESTRUCT(&vals);
#endif
/* we only need to set locality for each local rank as "not found"
* equates to "non-local" */
@ -681,7 +679,6 @@ static int cray_fence(opal_list_t *procs, int collect_data)
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),
OPAL_NAME_PRINT(id));
/* fetch cpuset for this vpid */
#if OPAL_HAVE_HWLOC
OBJ_CONSTRUCT(&vals, opal_list_t);
if (OPAL_SUCCESS != (rc = opal_pmix_base_fetch(&id,
OPAL_PMIX_CPUSET, &vals))) {
@ -708,10 +705,6 @@ static int cray_fence(opal_list_t *procs, int collect_data)
}
OPAL_LIST_DESTRUCT(&vals);
}
#else
/* all we know is we share a node */
locality = OPAL_PROC_ON_CLUSTER | OPAL_PROC_ON_CU | OPAL_PROC_ON_NODE;
#endif
OPAL_OUTPUT_VERBOSE((1, opal_pmix_base_framework.framework_output,
"%s pmix:cray proc %s locality %s",
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),
@ -727,11 +720,9 @@ static int cray_fence(opal_list_t *procs, int collect_data)
}
fn_exit:
#if OPAL_HAVE_HWLOC
if (NULL != cpuset) {
free(cpuset);
}
#endif
if (all_lens != NULL) {
free(all_lens);
}

Просмотреть файл

@ -557,7 +557,6 @@ static int s1_fence(opal_list_t *procs, int collect_data)
OPAL_ERROR_LOG(rc);
return rc;
}
#if OPAL_HAVE_HWLOC
if (NULL == kp || NULL == kp->data.string) {
/* if we share a node, but we don't know anything more, then
* mark us as on the node as this is all we know
@ -572,10 +571,6 @@ static int s1_fence(opal_list_t *procs, int collect_data)
if (NULL != kp) {
OBJ_RELEASE(kp);
}
#else
/* all we know is we share a node */
locality = OPAL_PROC_ON_CLUSTER | OPAL_PROC_ON_CU | OPAL_PROC_ON_NODE;
#endif
OPAL_OUTPUT_VERBOSE((1, opal_pmix_base_framework.framework_output,
"%s pmix:s1 proc %s locality %s",
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),

Просмотреть файл

@ -573,7 +573,6 @@ static int s2_fence(opal_list_t *procs, int collect_data)
OPAL_ERROR_LOG(rc);
return rc;
}
#if OPAL_HAVE_HWLOC
if (NULL == kp || NULL == kp->data.string) {
/* if we share a node, but we don't know anything more, then
* mark us as on the node as this is all we know
@ -588,10 +587,6 @@ static int s2_fence(opal_list_t *procs, int collect_data)
if (NULL != kp) {
OBJ_RELEASE(kp);
}
#else
/* all we know is we share a node */
locality = OPAL_PROC_ON_CLUSTER | OPAL_PROC_ON_CU | OPAL_PROC_ON_NODE;
#endif
OPAL_OUTPUT_VERBOSE((1, opal_pmix_base_framework.framework_output,
"%s pmix:s2 proc %s locality %s",
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),

Просмотреть файл

@ -27,9 +27,7 @@ opal_process_info_t opal_process_info = {
.proc_session_dir = NULL,
.num_local_peers = 0, /* there is nobody else but me */
.my_local_rank = 0, /* I'm the only process around here */
#if OPAL_HAVE_HWLOC
.cpuset = NULL,
#endif
};
static opal_proc_t opal_local_proc = {

Просмотреть файл

@ -3,7 +3,7 @@
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2013 Inria. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -109,9 +109,7 @@ typedef struct opal_process_info_t {
char *proc_session_dir; /**< Session directory for the process */
int32_t num_local_peers; /**< number of procs from my job that share my node with me */
int32_t my_local_rank; /**< local rank on this node within my job */
#if OPAL_HAVE_HWLOC
char *cpuset; /**< String-representation of bitmap where we are bound */
#endif
} opal_process_info_t;
OPAL_DECLSPEC extern opal_process_info_t opal_process_info;

Просмотреть файл

@ -46,7 +46,6 @@
int orte_ess_base_proc_binding(void)
{
#if OPAL_HAVE_HWLOC
hwloc_obj_t node, obj;
hwloc_cpuset_t cpus, nodeset;
hwloc_obj_type_t target;
@ -308,8 +307,4 @@ int orte_ess_base_proc_binding(void)
}
return ORTE_ERR_SILENT;
#else
return ORTE_SUCCESS;
#endif
}

Просмотреть файл

@ -115,6 +115,8 @@ int orte_ess_base_orted_setup(char **hosts)
orte_app_context_t *app;
orte_node_t *node;
char *param;
hwloc_obj_t obj;
unsigned i, j;
/* my name is set, xfer it to the OPAL layer */
orte_process_info.super.proc_name = *(opal_process_name_t*)ORTE_PROC_MY_NAME;
@ -135,49 +137,45 @@ int orte_ess_base_orted_setup(char **hosts)
setup_sighandler(SIGUSR1, &sigusr1_handler, signal_callback);
setup_sighandler(SIGUSR2, &sigusr2_handler, signal_callback);
signals_set = true;
#if OPAL_HAVE_HWLOC
{
hwloc_obj_t obj;
unsigned i, j;
/* get the local topology */
if (NULL == opal_hwloc_topology) {
if (OPAL_SUCCESS != (ret = opal_hwloc_base_get_topology())) {
error = "topology discovery";
goto error;
}
}
/* generate the signature */
orte_topo_signature = opal_hwloc_base_get_topo_signature(opal_hwloc_topology);
/* remove the hostname from the topology. Unfortunately, hwloc
* decided to add the source hostname to the "topology", thus
* rendering it unusable as a pure topological description. So
* we remove that information here.
*/
obj = hwloc_get_root_obj(opal_hwloc_topology);
for (i=0; i < obj->infos_count; i++) {
if (NULL == obj->infos[i].name ||
NULL == obj->infos[i].value) {
continue;
}
if (0 == strncmp(obj->infos[i].name, "HostName", strlen("HostName"))) {
free(obj->infos[i].name);
free(obj->infos[i].value);
/* left justify the array */
for (j=i; j < obj->infos_count-1; j++) {
obj->infos[j] = obj->infos[j+1];
}
obj->infos[obj->infos_count-1].name = NULL;
obj->infos[obj->infos_count-1].value = NULL;
obj->infos_count--;
break;
}
}
if (15 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) {
opal_output(0, "%s Topology Info:", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
opal_dss.dump(0, opal_hwloc_topology, OPAL_HWLOC_TOPO);
/* get the local topology */
if (NULL == opal_hwloc_topology) {
if (OPAL_SUCCESS != (ret = opal_hwloc_base_get_topology())) {
error = "topology discovery";
goto error;
}
}
#endif
/* generate the signature */
orte_topo_signature = opal_hwloc_base_get_topo_signature(opal_hwloc_topology);
/* remove the hostname from the topology. Unfortunately, hwloc
* decided to add the source hostname to the "topology", thus
* rendering it unusable as a pure topological description. So
* we remove that information here.
*/
obj = hwloc_get_root_obj(opal_hwloc_topology);
for (i=0; i < obj->infos_count; i++) {
if (NULL == obj->infos[i].name ||
NULL == obj->infos[i].value) {
continue;
}
if (0 == strncmp(obj->infos[i].name, "HostName", strlen("HostName"))) {
free(obj->infos[i].name);
free(obj->infos[i].value);
/* left justify the array */
for (j=i; j < obj->infos_count-1; j++) {
obj->infos[j] = obj->infos[j+1];
}
obj->infos[obj->infos_count-1].name = NULL;
obj->infos[obj->infos_count-1].value = NULL;
obj->infos_count--;
break;
}
}
if (15 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) {
opal_output(0, "%s Topology Info:", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
opal_dss.dump(0, opal_hwloc_topology, OPAL_HWLOC_TOPO);
}
/* open and setup the opal_pstat framework so we can provide
* process stats if requested
*/
@ -482,10 +480,9 @@ int orte_ess_base_orted_setup(char **hosts)
node = OBJ_NEW(orte_node_t);
node->name = strdup(orte_process_info.nodename);
node->index = opal_pointer_array_set_item(orte_node_pool, ORTE_PROC_MY_NAME->vpid, node);
#if OPAL_HAVE_HWLOC
/* point our topology to the one detected locally */
node->topology = opal_hwloc_topology;
#endif
/* create and store a proc object for us */
proc = OBJ_NEW(orte_proc_t);
proc->name.jobid = ORTE_PROC_MY_NAME->jobid;

Просмотреть файл

@ -145,6 +145,10 @@ static int rte_init(void)
orte_proc_t *proc;
orte_app_context_t *app;
char **aliases, *aptr;
char *coprocessors, **sns;
uint32_t h;
int idx;
orte_topology_t *t;
/* run the prolog */
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
@ -194,24 +198,21 @@ static int rte_init(void)
setup_sighandler(SIGCONT, &sigcont_handler, signal_forward_callback);
signals_set = true;
#if OPAL_HAVE_HWLOC
{
/* get the local topology */
if (NULL == opal_hwloc_topology) {
if (OPAL_SUCCESS != (ret = opal_hwloc_base_get_topology())) {
error = "topology discovery";
goto error;
}
}
/* generate the signature */
orte_topo_signature = opal_hwloc_base_get_topo_signature(opal_hwloc_topology);
if (15 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) {
opal_output(0, "%s Topology Info:", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
opal_dss.dump(0, opal_hwloc_topology, OPAL_HWLOC_TOPO);
/* get the local topology */
if (NULL == opal_hwloc_topology) {
if (OPAL_SUCCESS != (ret = opal_hwloc_base_get_topology())) {
error = "topology discovery";
goto error;
}
}
#endif
/* generate the signature */
orte_topo_signature = opal_hwloc_base_get_topo_signature(opal_hwloc_topology);
if (15 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) {
opal_output(0, "%s Topology Info:", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
opal_dss.dump(0, opal_hwloc_topology, OPAL_HWLOC_TOPO);
}
/* if we are using xml for output, put an mpirun start tag */
if (orte_xml_output) {
@ -416,16 +417,13 @@ static int rte_init(void)
node = OBJ_NEW(orte_node_t);
node->name = strdup(orte_process_info.nodename);
node->index = opal_pointer_array_set_item(orte_node_pool, 0, node);
#if OPAL_HAVE_HWLOC
{
orte_topology_t *t;
/* add it to the array of known topologies */
t = OBJ_NEW(orte_topology_t);
t->topo = opal_hwloc_topology;
t->sig = strdup(orte_topo_signature);
opal_pointer_array_add(orte_node_topologies, t);
}
#endif
/* add it to the array of known topologies */
t = OBJ_NEW(orte_topology_t);
t->topo = opal_hwloc_topology;
t->sig = strdup(orte_topo_signature);
opal_pointer_array_add(orte_node_topologies, t);
/* create and store a proc object for us */
proc = OBJ_NEW(orte_proc_t);
proc->name.jobid = ORTE_PROC_MY_NAME->jobid;
@ -524,53 +522,47 @@ static int rte_init(void)
error = "orte_rmaps_base_find_available";
goto error;
}
#if OPAL_HAVE_HWLOC
{
char *coprocessors, **sns;
uint32_t h;
int idx;
/* if a topology file was given, then the rmaps framework open
* will have reset our topology. Ensure we always get the right
* one by setting our node topology afterwards
*/
node->topology = opal_hwloc_topology;
/* if a topology file was given, then the rmaps framework open
* will have reset our topology. Ensure we always get the right
* one by setting our node topology afterwards
*/
node->topology = opal_hwloc_topology;
/* init the hash table, if necessary */
if (NULL == orte_coprocessors) {
orte_coprocessors = OBJ_NEW(opal_hash_table_t);
opal_hash_table_init(orte_coprocessors, orte_process_info.num_procs);
}
/* detect and add any coprocessors */
coprocessors = opal_hwloc_base_find_coprocessors(opal_hwloc_topology);
if (NULL != coprocessors) {
/* separate the serial numbers of the coprocessors
* on this host
*/
sns = opal_argv_split(coprocessors, ',');
for (idx=0; NULL != sns[idx]; idx++) {
/* compute the hash */
OPAL_HASH_STR(sns[idx], h);
/* mark that this coprocessor is hosted by this node */
opal_hash_table_set_value_uint32(orte_coprocessors, h, (void*)&(ORTE_PROC_MY_NAME->vpid));
}
opal_argv_free(sns);
free(coprocessors);
orte_coprocessors_detected = true;
}
/* see if I am on a coprocessor */
coprocessors = opal_hwloc_base_check_on_coprocessor();
if (NULL != coprocessors) {
/* compute the hash */
OPAL_HASH_STR(coprocessors, h);
/* mark that I am on this coprocessor */
opal_hash_table_set_value_uint32(orte_coprocessors, h, (void*)&(ORTE_PROC_MY_NAME->vpid));
orte_set_attribute(&node->attributes, ORTE_NODE_SERIAL_NUMBER, ORTE_ATTR_LOCAL, coprocessors, OPAL_STRING);
free(coprocessors);
orte_coprocessors_detected = true;
}
/* init the hash table, if necessary */
if (NULL == orte_coprocessors) {
orte_coprocessors = OBJ_NEW(opal_hash_table_t);
opal_hash_table_init(orte_coprocessors, orte_process_info.num_procs);
}
#endif
/* detect and add any coprocessors */
coprocessors = opal_hwloc_base_find_coprocessors(opal_hwloc_topology);
if (NULL != coprocessors) {
/* separate the serial numbers of the coprocessors
* on this host
*/
sns = opal_argv_split(coprocessors, ',');
for (idx=0; NULL != sns[idx]; idx++) {
/* compute the hash */
OPAL_HASH_STR(sns[idx], h);
/* mark that this coprocessor is hosted by this node */
opal_hash_table_set_value_uint32(orte_coprocessors, h, (void*)&(ORTE_PROC_MY_NAME->vpid));
}
opal_argv_free(sns);
free(coprocessors);
orte_coprocessors_detected = true;
}
/* see if I am on a coprocessor */
coprocessors = opal_hwloc_base_check_on_coprocessor();
if (NULL != coprocessors) {
/* compute the hash */
OPAL_HASH_STR(coprocessors, h);
/* mark that I am on this coprocessor */
opal_hash_table_set_value_uint32(orte_coprocessors, h, (void*)&(ORTE_PROC_MY_NAME->vpid));
orte_set_attribute(&node->attributes, ORTE_NODE_SERIAL_NUMBER, ORTE_ATTR_LOCAL, coprocessors, OPAL_STRING);
free(coprocessors);
orte_coprocessors_detected = true;
}
/* Open/select the odls */
if (ORTE_SUCCESS != (ret = mca_base_framework_open(&orte_odls_base_framework, 0))) {
ORTE_ERROR_LOG(ret);

Просмотреть файл

@ -189,7 +189,6 @@ static int rte_init(void)
free(string_key);
}
#if OPAL_HAVE_HWLOC
/* retrieve our topology */
OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_TOPO,
ORTE_PROC_MY_NAME, &val, OPAL_STRING);
@ -337,7 +336,7 @@ static int rte_init(void)
if (NULL != mycpuset){
free(mycpuset);
}
#else
/* get our local peers */
if (0 < orte_process_info.num_local_peers) {
/* retrieve the local peers */
@ -385,13 +384,11 @@ static int rte_init(void)
if (OPAL_SUCCESS != ret) {
ORTE_ERROR_LOG(ret);
error = "pmix store local";
opal_argv_free(cpusets);
opal_argv_free(peers);
goto error;
}
OBJ_RELEASE(kv);
}
#endif
opal_argv_free(peers);
/* we don't need to force the routed system to pick the

Просмотреть файл

@ -256,7 +256,6 @@ static int rte_init(void)
free(string_key);
}
#if OPAL_HAVE_HWLOC
/* retrieve our topology */
OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_TOPO,
ORTE_PROC_MY_NAME, &val, OPAL_STRING);
@ -319,7 +318,6 @@ static int rte_init(void)
}
OBJ_RELEASE(kv);
}
#endif
/* use the std app init to complete the procedure */
if (ORTE_SUCCESS != (rc = orte_ess_base_app_setup(true))) {

Просмотреть файл

@ -82,107 +82,102 @@
void orte_plm_base_daemons_reported(int fd, short args, void *cbdata)
{
orte_state_caddy_t *caddy = (orte_state_caddy_t*)cbdata;
hwloc_topology_t t;
orte_job_t *jdata;
orte_node_t *node;
orte_proc_t *dmn1;
int i;
#if OPAL_HAVE_HWLOC
{
hwloc_topology_t t;
orte_job_t *jdata;
orte_node_t *node;
orte_proc_t *dmn1;
int i;
/* if we got back topology info from the first node, then we use
* it as the "standard" for all other nodes unless they sent
* back their own topology */
if (1 < orte_process_info.num_procs) {
/* find daemon.vpid = 1 */
jdata = orte_get_job_data_object(ORTE_PROC_MY_NAME->jobid);
if (NULL == (dmn1 = (orte_proc_t*)opal_pointer_array_get_item(jdata->procs, 1))) {
/* something is wrong */
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
ORTE_FORCED_TERMINATE(ORTE_ERR_NOT_FOUND);
OBJ_RELEASE(caddy);
return;
/* if we got back topology info from the first node, then we use
* it as the "standard" for all other nodes unless they sent
* back their own topology */
if (1 < orte_process_info.num_procs) {
/* find daemon.vpid = 1 */
jdata = orte_get_job_data_object(ORTE_PROC_MY_NAME->jobid);
if (NULL == (dmn1 = (orte_proc_t*)opal_pointer_array_get_item(jdata->procs, 1))) {
/* something is wrong */
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
ORTE_FORCED_TERMINATE(ORTE_ERR_NOT_FOUND);
OBJ_RELEASE(caddy);
return;
}
if (NULL == (node = dmn1->node) ||
NULL == (t = node->topology)) {
/* something is wrong */
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
ORTE_FORCED_TERMINATE(ORTE_ERR_NOT_FOUND);
OBJ_RELEASE(caddy);
return;
}
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s plm:base:setting topo to that from node %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), node->name));
for (i=1; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
if (NULL == (node = dmn1->node) ||
NULL == (t = node->topology)) {
/* something is wrong */
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
ORTE_FORCED_TERMINATE(ORTE_ERR_NOT_FOUND);
OBJ_RELEASE(caddy);
return;
}
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s plm:base:setting topo to that from node %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), node->name));
for (i=1; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
if (NULL == node->topology) {
node->topology = t;
}
}
} else if (orte_do_not_launch) {
node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, 0);
t = node->topology;
for (i=1; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
if (NULL == node->topology) {
node->topology = t;
}
if (NULL == node->topology) {
node->topology = t;
}
}
} else if (orte_do_not_launch) {
node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, 0);
t = node->topology;
for (i=1; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
if (NULL == node->topology) {
node->topology = t;
}
}
}
/* if this is an unmanaged allocation, then set the default
* slots on each node as directed or using default
*/
if (!orte_managed_allocation) {
if (NULL != orte_set_slots &&
0 != strncmp(orte_set_slots, "none", strlen(orte_set_slots))) {
for (i=0; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
if (!ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s plm:base:setting slots for node %s by %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), node->name, orte_set_slots));
if (0 == strncmp(orte_set_slots, "cores", strlen(orte_set_slots))) {
node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_CORE, 0,
OPAL_HWLOC_LOGICAL);
} else if (0 == strncmp(orte_set_slots, "sockets", strlen(orte_set_slots))) {
if (0 == (node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_SOCKET, 0,
OPAL_HWLOC_LOGICAL))) {
/* some systems don't report sockets - in this case,
* use numanodes
*/
node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_NODE, 0,
OPAL_HWLOC_LOGICAL);
}
} else if (0 == strncmp(orte_set_slots, "numas", strlen(orte_set_slots))) {
/* if this is an unmanaged allocation, then set the default
* slots on each node as directed or using default
*/
if (!orte_managed_allocation) {
if (NULL != orte_set_slots &&
0 != strncmp(orte_set_slots, "none", strlen(orte_set_slots))) {
for (i=0; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
if (!ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s plm:base:setting slots for node %s by %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), node->name, orte_set_slots));
if (0 == strncmp(orte_set_slots, "cores", strlen(orte_set_slots))) {
node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_CORE, 0,
OPAL_HWLOC_LOGICAL);
} else if (0 == strncmp(orte_set_slots, "sockets", strlen(orte_set_slots))) {
if (0 == (node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_SOCKET, 0,
OPAL_HWLOC_LOGICAL))) {
/* some systems don't report sockets - in this case,
* use numanodes
*/
node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_NODE, 0,
OPAL_HWLOC_LOGICAL);
} else if (0 == strncmp(orte_set_slots, "hwthreads", strlen(orte_set_slots))) {
node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_PU, 0,
OPAL_HWLOC_LOGICAL);
} else {
/* must be a number */
node->slots = strtol(orte_set_slots, NULL, 10);
}
} else if (0 == strncmp(orte_set_slots, "numas", strlen(orte_set_slots))) {
node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_NODE, 0,
OPAL_HWLOC_LOGICAL);
} else if (0 == strncmp(orte_set_slots, "hwthreads", strlen(orte_set_slots))) {
node->slots = opal_hwloc_base_get_nbobjs_by_type(node->topology,
HWLOC_OBJ_PU, 0,
OPAL_HWLOC_LOGICAL);
} else {
/* must be a number */
node->slots = strtol(orte_set_slots, NULL, 10);
}
}
}
}
}
#endif
if (orte_display_allocation) {
orte_ras_base_display_alloc();
@ -332,6 +327,11 @@ void orte_plm_base_complete_setup(int fd, short args, void *cbdata)
{
orte_job_t *jdata, *jdatorted;
orte_state_caddy_t *caddy = (orte_state_caddy_t*)cbdata;
orte_node_t *node;
uint32_t h;
orte_vpid_t *vptr;
int i, rc;
char *serial_number;
opal_output_verbose(5, orte_plm_base_framework.framework_output,
"%s complete_setup on job %s",
@ -419,52 +419,42 @@ void orte_plm_base_complete_setup(int fd, short args, void *cbdata)
}
#endif
#if OPAL_HAVE_HWLOC
{
orte_node_t *node;
uint32_t h;
orte_vpid_t *vptr;
int i, rc;
char *serial_number;
/* if coprocessors were detected, now is the time to
* identify who is attached to what host - this info
* will be shipped to the daemons in the nidmap. Someday,
* there may be a direct way for daemons on coprocessors
* to detect their hosts - but not today.
*/
if (orte_coprocessors_detected) {
/* cycle thru the nodes looking for coprocessors */
for (i=0; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
/* if we don't have a serial number, then we are not a coprocessor */
serial_number = NULL;
if (!orte_get_attribute(&node->attributes, ORTE_NODE_SERIAL_NUMBER, (void**)&serial_number, OPAL_STRING)) {
continue;
}
if (NULL != serial_number) {
/* if we have a serial number, then we are a coprocessor - so
* compute our hash and lookup our hostid
*/
OPAL_HASH_STR(serial_number, h);
free(serial_number);
if (OPAL_SUCCESS != (rc = opal_hash_table_get_value_uint32(orte_coprocessors, h,
(void**)&vptr))) {
ORTE_ERROR_LOG(rc);
break;
}
orte_set_attribute(&node->attributes, ORTE_NODE_HOSTID, ORTE_ATTR_LOCAL, vptr, ORTE_VPID);
/* if coprocessors were detected, now is the time to
* identify who is attached to what host - this info
* will be shipped to the daemons in the nidmap. Someday,
* there may be a direct way for daemons on coprocessors
* to detect their hosts - but not today.
*/
if (orte_coprocessors_detected) {
/* cycle thru the nodes looking for coprocessors */
for (i=0; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
/* if we don't have a serial number, then we are not a coprocessor */
serial_number = NULL;
if (!orte_get_attribute(&node->attributes, ORTE_NODE_SERIAL_NUMBER, (void**)&serial_number, OPAL_STRING)) {
continue;
}
if (NULL != serial_number) {
/* if we have a serial number, then we are a coprocessor - so
* compute our hash and lookup our hostid
*/
OPAL_HASH_STR(serial_number, h);
free(serial_number);
if (OPAL_SUCCESS != (rc = opal_hash_table_get_value_uint32(orte_coprocessors, h,
(void**)&vptr))) {
ORTE_ERROR_LOG(rc);
break;
}
orte_set_attribute(&node->attributes, ORTE_NODE_HOSTID, ORTE_ATTR_LOCAL, vptr, ORTE_VPID);
}
}
/* done with the coprocessor mapping at this time */
if (NULL != orte_coprocessors) {
OBJ_RELEASE(orte_coprocessors);
}
}
#endif
/* done with the coprocessor mapping at this time */
if (NULL != orte_coprocessors) {
OBJ_RELEASE(orte_coprocessors);
}
/* load any controls into the system */
orte_rtc.assign(jdata);
@ -804,6 +794,13 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
orte_job_t *jdata;
orte_process_name_t dname;
opal_buffer_t *relay;
char *coprocessors, **sns, *sig;
uint32_t h;
hwloc_topology_t topo;
orte_topology_t *t;
int i;
bool found;
uint8_t tflag;
/* get the daemon job, if necessary */
if (NULL == jdatorted) {
@ -953,47 +950,68 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
free(alias);
}
#if OPAL_HAVE_HWLOC
{
char *coprocessors, **sns, *sig;
uint32_t h;
hwloc_topology_t topo;
orte_topology_t *t;
int i;
bool found;
uint8_t tflag;
/* store the local resources for that node */
/* store the local resources for that node */
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &tflag, &idx, OPAL_UINT8))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
if (1 == tflag) {
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &tflag, &idx, OPAL_UINT8))) {
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &sig, &idx, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
if (1 == tflag) {
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &sig, &idx, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &topo, &idx, OPAL_HWLOC_TOPO))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &topo, &idx, OPAL_HWLOC_TOPO))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s RECEIVED TOPOLOGY FROM NODE %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), nodename));
if (10 < opal_output_get_verbosity(orte_plm_base_framework.framework_output)) {
opal_dss.dump(0, topo, OPAL_HWLOC_TOPO);
}
if (1 == dname.vpid || orte_hetero_nodes) {
/* the user has told us that something is different, so just store it */
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s RECEIVED TOPOLOGY FROM NODE %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), nodename));
if (10 < opal_output_get_verbosity(orte_plm_base_framework.framework_output)) {
opal_dss.dump(0, topo, OPAL_HWLOC_TOPO);
"%s ADDING TOPOLOGY PER USER REQUEST TO NODE %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), node->name));
t = OBJ_NEW(orte_topology_t);
/* filter the topology as we'll need it that way later */
opal_hwloc_base_filter_cpus(topo);
t->topo = topo;
t->sig = sig;
opal_pointer_array_add(orte_node_topologies, t);
node->topology = topo;
} else {
/* do we already have this topology from some other node? */
found = false;
for (i=0; i < orte_node_topologies->size; i++) {
if (NULL == (t = (orte_topology_t*)opal_pointer_array_get_item(orte_node_topologies, i))) {
continue;
}
/* just check the signature */
if (0 == strcmp(sig, t->sig)) {
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s TOPOLOGY ALREADY RECORDED",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
found = true;
node->topology = t->topo;
hwloc_topology_destroy(topo);
free(sig);
break;
}
}
if (1 == dname.vpid || orte_hetero_nodes) {
/* the user has told us that something is different, so just store it */
if (!found) {
/* nope - add it */
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s ADDING TOPOLOGY PER USER REQUEST TO NODE %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), node->name));
"%s NEW TOPOLOGY - ADDING",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
t = OBJ_NEW(orte_topology_t);
/* filter the topology as we'll need it that way later */
opal_hwloc_base_filter_cpus(topo);
@ -1001,91 +1019,58 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
t->sig = sig;
opal_pointer_array_add(orte_node_topologies, t);
node->topology = topo;
} else {
/* do we already have this topology from some other node? */
found = false;
for (i=0; i < orte_node_topologies->size; i++) {
if (NULL == (t = (orte_topology_t*)opal_pointer_array_get_item(orte_node_topologies, i))) {
continue;
}
/* just check the signature */
if (0 == strcmp(sig, t->sig)) {
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s TOPOLOGY ALREADY RECORDED",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
found = true;
node->topology = t->topo;
hwloc_topology_destroy(topo);
free(sig);
break;
}
}
if (!found) {
/* nope - add it */
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
"%s NEW TOPOLOGY - ADDING",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
t = OBJ_NEW(orte_topology_t);
/* filter the topology as we'll need it that way later */
opal_hwloc_base_filter_cpus(topo);
t->topo = topo;
t->sig = sig;
opal_pointer_array_add(orte_node_topologies, t);
node->topology = topo;
}
}
}
/* unpack any coprocessors */
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &coprocessors, &idx, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
if (NULL != coprocessors) {
/* init the hash table, if necessary */
if (NULL == orte_coprocessors) {
orte_coprocessors = OBJ_NEW(opal_hash_table_t);
opal_hash_table_init(orte_coprocessors, orte_process_info.num_procs);
}
/* separate the serial numbers of the coprocessors
* on this host
*/
sns = opal_argv_split(coprocessors, ',');
for (idx=0; NULL != sns[idx]; idx++) {
/* compute the hash */
OPAL_HASH_STR(sns[idx], h);
/* mark that this coprocessor is hosted by this node */
opal_hash_table_set_value_uint32(orte_coprocessors, h, (void*)&node->daemon->name.vpid);
}
opal_argv_free(sns);
free(coprocessors);
orte_coprocessors_detected = true;
}
/* see if this daemon is on a coprocessor */
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &coprocessors, &idx, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
if (NULL != coprocessors) {
if (orte_get_attribute(&node->attributes, ORTE_NODE_SERIAL_NUMBER, NULL, OPAL_STRING)) {
/* this is not allowed - a coprocessor cannot be host
* to another coprocessor at this time
*/
ORTE_ERROR_LOG(ORTE_ERR_NOT_SUPPORTED);
orted_failed_launch = true;
free(coprocessors);
goto CLEANUP;
}
orte_set_attribute(&node->attributes, ORTE_NODE_SERIAL_NUMBER, ORTE_ATTR_LOCAL, coprocessors, OPAL_STRING);
free(coprocessors);
orte_coprocessors_detected = true;
}
}
#endif
/* unpack any coprocessors */
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &coprocessors, &idx, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
if (NULL != coprocessors) {
/* init the hash table, if necessary */
if (NULL == orte_coprocessors) {
orte_coprocessors = OBJ_NEW(opal_hash_table_t);
opal_hash_table_init(orte_coprocessors, orte_process_info.num_procs);
}
/* separate the serial numbers of the coprocessors
* on this host
*/
sns = opal_argv_split(coprocessors, ',');
for (idx=0; NULL != sns[idx]; idx++) {
/* compute the hash */
OPAL_HASH_STR(sns[idx], h);
/* mark that this coprocessor is hosted by this node */
opal_hash_table_set_value_uint32(orte_coprocessors, h, (void*)&node->daemon->name.vpid);
}
opal_argv_free(sns);
free(coprocessors);
orte_coprocessors_detected = true;
}
/* see if this daemon is on a coprocessor */
idx=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &coprocessors, &idx, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
orted_failed_launch = true;
goto CLEANUP;
}
if (NULL != coprocessors) {
if (orte_get_attribute(&node->attributes, ORTE_NODE_SERIAL_NUMBER, NULL, OPAL_STRING)) {
/* this is not allowed - a coprocessor cannot be host
* to another coprocessor at this time
*/
ORTE_ERROR_LOG(ORTE_ERR_NOT_SUPPORTED);
orted_failed_launch = true;
free(coprocessors);
goto CLEANUP;
}
orte_set_attribute(&node->attributes, ORTE_NODE_SERIAL_NUMBER, ORTE_ATTR_LOCAL, coprocessors, OPAL_STRING);
free(coprocessors);
orte_coprocessors_detected = true;
}
CLEANUP:
OPAL_OUTPUT_VERBOSE((5, orte_plm_base_framework.framework_output,
@ -1259,7 +1244,7 @@ int orte_plm_base_orted_append_basic_args(int *argc, char ***argv,
if (orted_spin_flag) {
opal_argv_append(argc, argv, "--spin");
}
#if OPAL_HAVE_HWLOC
if (opal_hwloc_report_bindings) {
opal_argv_append(argc, argv, "-"OPAL_MCA_CMD_LINE_ID);
opal_argv_append(argc, argv, "orte_report_bindings");
@ -1275,7 +1260,6 @@ int orte_plm_base_orted_append_basic_args(int *argc, char ***argv,
opal_argv_append(argc, argv, "orte_hetero_nodes");
opal_argv_append(argc, argv, "1");
}
#endif
if (orte_map_reduce) {
opal_argv_append(argc, argv, "--mapreduce");

Просмотреть файл

@ -81,7 +81,6 @@ static int ras_sim_register(void)
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_ras_simulator_component.slots_max);
#if OPAL_HAVE_HWLOC
mca_ras_simulator_component.num_nodes = NULL;
(void) mca_base_component_var_register (component, "num_nodes",
"Comma-separated list of number of nodes to simulate for each topology",
@ -117,16 +116,6 @@ static int ras_sim_register(void)
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_ras_simulator_component.have_membind);
#else
mca_ras_simulator_component.num_nodes = NULL;
(void) mca_base_component_var_register (component, "num_nodes",
"Number of nodes to simulate",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_ras_simulator_component.num_nodes);
#endif
return ORTE_SUCCESS;
}

Просмотреть файл

@ -50,7 +50,6 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
{
int i, n, val, dig, num_nodes;
orte_node_t *node;
#if OPAL_HAVE_HWLOC
orte_topology_t *t;
hwloc_topology_t topo;
hwloc_obj_t obj;
@ -59,7 +58,6 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
char **files=NULL;
char **topos = NULL;
bool use_local_topology = false;
#endif
char **node_cnt=NULL;
char **slot_cnt=NULL;
char **max_slot_cnt=NULL;
@ -84,7 +82,6 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
}
}
#if OPAL_HAVE_HWLOC
if (NULL != mca_ras_simulator_component.topofiles) {
files = opal_argv_split(mca_ras_simulator_component.topofiles, ',');
if (opal_argv_count(files) != opal_argv_count(node_cnt)) {
@ -101,15 +98,6 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
/* use our topology */
use_local_topology = true;
}
#else
/* If we don't have hwloc and hwloc files were specified, then
error out (because we can't deliver that functionality) */
if (NULL == mca_ras_simulator_component.topofiles) {
orte_show_help("help-ras-simulator.txt",
"no hwloc support for topofiles", true);
goto error_silent;
}
#endif
/* setup the prefix to the node names */
snprintf(prefix, 6, "nodeA");
@ -128,7 +116,6 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
prefix[4] += n;
/* check for topology */
#if OPAL_HAVE_HWLOC
if (use_local_topology) {
/* use our topology */
topo = opal_hwloc_topology;
@ -261,14 +248,12 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
t->sig = opal_hwloc_base_get_topo_signature(topo);
opal_pointer_array_add(orte_node_topologies, t);
}
#endif
for (i=0; i < num_nodes; i++) {
node = OBJ_NEW(orte_node_t);
asprintf(&node->name, "%s%0*d", prefix, dig, i);
node->state = ORTE_NODE_STATE_UP;
node->slots_inuse = 0;
#if OPAL_HAVE_HWLOC
if (NULL == max_slot_cnt || NULL == max_slot_cnt[n]) {
node->slots_max = 0;
} else {
@ -282,7 +267,6 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
node->slots = opal_hwloc_base_get_npus(topo, obj);
}
node->topology = topo;
#endif
opal_output_verbose(1, orte_ras_base_framework.framework_output,
"Created Node <%10s> [%3d : %3d]",
node->name, node->slots, node->slots_max);
@ -302,11 +286,9 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
if (NULL != node_cnt) {
opal_argv_free(node_cnt);
}
#if OPAL_HAVE_HWLOC
if (NULL != topos) {
opal_argv_free(topos);
}
#endif
return ORTE_SUCCESS;
error_silent:

Просмотреть файл

@ -12,6 +12,7 @@
# Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2011 Los Alamos National Security, LLC.
# All rights reserved.
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -29,11 +30,8 @@ libmca_rmaps_la_SOURCES += \
base/rmaps_base_map_job.c \
base/rmaps_base_support_fns.c \
base/rmaps_base_ranking.c \
base/rmaps_base_print_fns.c
base/rmaps_base_print_fns.c \
base/rmaps_base_binding.c
dist_ortedata_DATA = base/help-orte-rmaps-base.txt
if OPAL_HAVE_HWLOC
libmca_rmaps_la_SOURCES += \
base/rmaps_base_binding.c
endif

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -114,9 +114,7 @@ ORTE_DECLSPEC int orte_rmaps_base_set_vpid_range(orte_jobid_t jobid,
ORTE_DECLSPEC char* orte_rmaps_base_print_mapping(orte_mapping_policy_t mapping);
ORTE_DECLSPEC char* orte_rmaps_base_print_ranking(orte_ranking_policy_t ranking);
#if OPAL_HAVE_HWLOC
ORTE_DECLSPEC int orte_rmaps_base_prep_topology(hwloc_topology_t topo);
#endif
ORTE_DECLSPEC int orte_rmaps_base_filter_nodes(orte_app_context_t *app,
opal_list_t *nodes,

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -109,11 +109,7 @@ static int orte_rmaps_base_register(mca_base_register_flag_t flags)
/* define default mapping policy */
rmaps_base_mapping_policy = NULL;
var_id = mca_base_var_register("orte", "rmaps", "base", "mapping_policy",
#if OPAL_HAVE_HWLOC
"Mapping Policy [slot | hwthread | core (default:np<=2) | l1cache | l2cache | l3cache | socket (default:np>2) | numa | board | node | seq | dist | ppr], with allowed modifiers :PE=y,SPAN,OVERSUBSCRIBE,NOOVERSUBSCRIBE",
#else
"Mapping Policy [slot (default) | node], with allowed modifiers :SPAN,OVERSUBSCRIBE,NOOVERSUBSCRIBE",
#endif
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
@ -124,11 +120,7 @@ static int orte_rmaps_base_register(mca_base_register_flag_t flags)
/* define default ranking policy */
rmaps_base_ranking_policy = NULL;
(void) mca_base_var_register("orte", "rmaps", "base", "ranking_policy",
#if OPAL_HAVE_HWLOC
"Ranking Policy [slot (default:np<=2) | hwthread | core | l1cache | l2cache | l3cache | socket (default:np>2) | numa | board | node], with modifier :SPAN or :FILL",
#else
"Ranking Policy [slot (default) | node]",
#endif
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
@ -158,7 +150,6 @@ static int orte_rmaps_base_register(mca_base_register_flag_t flags)
/* #cpus/rank to use */
orte_rmaps_base.cpus_per_rank = 1;
#if OPAL_HAVE_HWLOC
var_id = mca_base_var_register("orte", "rmaps", "base", "cpus_per_proc",
"Number of cpus to use for each rank [1-2**15 (default=1)]",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
@ -173,7 +164,6 @@ static int orte_rmaps_base_register(mca_base_register_flag_t flags)
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&rmaps_dist_device);
#endif
rmaps_base_no_schedule_local = false;
(void) mca_base_var_register("orte", "rmaps", "base", "no_schedule_local",
@ -264,7 +254,6 @@ static int orte_rmaps_base_open(mca_base_open_flag_t flags)
orte_rmaps_base.mapping = 0;
orte_rmaps_base.ranking = 0;
#if OPAL_HAVE_HWLOC
/* if a topology file was given, then set our topology
* from it. Even though our actual topology may differ,
* mpirun only needs to see the compute node topology
@ -276,7 +265,6 @@ static int orte_rmaps_base_open(mca_base_open_flag_t flags)
return ORTE_ERR_SILENT;
}
}
#endif
/* check for violations that has to be detected before we parse the mapping option */
if (NULL != orte_rmaps_base.ppr) {
@ -388,7 +376,6 @@ static int orte_rmaps_base_open(mca_base_open_flag_t flags)
}
if (1 < orte_rmaps_base.cpus_per_rank) {
#if OPAL_HAVE_HWLOC
/* if we were asked for multiple cpus/proc, then we have to
* bind to those cpus - any other binding policy is an
* error
@ -434,7 +421,6 @@ static int orte_rmaps_base_open(mca_base_open_flag_t flags)
ORTE_SET_MAPPING_POLICY(orte_rmaps_base.mapping, ORTE_MAPPING_BYNUMA);
ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_GIVEN);
}
#endif
}
if (orte_rmaps_base_pernode) {
@ -514,10 +500,8 @@ static int orte_rmaps_base_open(mca_base_open_flag_t flags)
}
ORTE_UNSET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_SUBSCRIBE_GIVEN);
#if OPAL_HAVE_HWLOC
/* also set the overload allowed flag */
opal_hwloc_binding_policy |= OPAL_BIND_ALLOW_OVERLOAD;
#endif
}
/* should we display a detailed (developer-quality) version of the map after determining it? */
@ -616,9 +600,7 @@ int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
char **device, char *inspec)
{
char *ck;
#if OPAL_HAVE_HWLOC
char *ptr;
#endif
orte_mapping_policy_t tmp;
int rc;
size_t len;
@ -668,7 +650,6 @@ int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
/* if the policy is "dist", then we set the policy to that value
* and save the second argument as the device
*/
#if OPAL_HAVE_HWLOC
if (0 == strncasecmp(spec, "ppr", strlen(spec))) {
/* we have to allow additional modifiers here - e.g., specifying
* #pe's/proc or oversubscribe - so check for modifiers
@ -702,7 +683,6 @@ int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
free(spec);
goto setpolicy;
}
#endif
if (ORTE_SUCCESS != (rc = check_modifiers(ck, &tmp)) &&
ORTE_ERR_TAKE_NEXT_OPTION != rc) {
if (ORTE_ERR_BAD_PARAM == rc) {
@ -719,7 +699,6 @@ int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYNODE);
} else if (0 == strncasecmp(spec, "seq", len)) {
ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_SEQ);
#if OPAL_HAVE_HWLOC
} else if (0 == strncasecmp(spec, "core", len)) {
ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYCORE);
} else if (0 == strncasecmp(spec, "l1cache", len)) {
@ -752,7 +731,6 @@ int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
free(spec);
return ORTE_ERR_SILENT;
}
#endif
} else {
orte_show_help("help-orte-rmaps-base.txt", "unrecognized-policy", true, "mapping", spec);
free(spec);
@ -793,7 +771,6 @@ int orte_rmaps_base_set_ranking_policy(orte_ranking_policy_t *policy,
case ORTE_MAPPING_BYNODE:
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_NODE);
break;
#if OPAL_HAVE_HWLOC
case ORTE_MAPPING_BYCORE:
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_CORE);
break;
@ -818,7 +795,6 @@ int orte_rmaps_base_set_ranking_policy(orte_ranking_policy_t *policy,
case ORTE_MAPPING_BYHWTHREAD:
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_HWTHREAD);
break;
#endif
default:
/* anything not tied to a specific hw obj can rank by slot */
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_SLOT);
@ -853,7 +829,6 @@ int orte_rmaps_base_set_ranking_policy(orte_ranking_policy_t *policy,
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_SLOT);
} else if (0 == strncasecmp(ck[0], "node", len)) {
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_NODE);
#if OPAL_HAVE_HWLOC
} else if (0 == strncasecmp(ck[0], "hwthread", len)) {
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_HWTHREAD);
} else if (0 == strncasecmp(ck[0], "core", len)) {
@ -870,7 +845,6 @@ int orte_rmaps_base_set_ranking_policy(orte_ranking_policy_t *policy,
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_NUMA);
} else if (0 == strncasecmp(ck[0], "board", len)) {
ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_BOARD);
#endif
} else {
orte_show_help("help-orte-rmaps-base.txt", "unrecognized-policy", true, "ranking", rmaps_base_ranking_policy);
opal_argv_free(ck);

Просмотреть файл

@ -113,7 +113,6 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
"mca:rmaps mapping given - using default");
map->mapping = orte_rmaps_base.mapping;
} else {
#if OPAL_HAVE_HWLOC
/* default based on number of procs */
if (nprocs <= 2) {
if (1 < orte_rmaps_base.cpus_per_rank) {
@ -138,10 +137,6 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
"mca:rmaps[%d] mapping not given - using bysocket", __LINE__);
ORTE_SET_MAPPING_POLICY(map->mapping, ORTE_MAPPING_BYSOCKET);
}
#else
/* in the absence of hwloc, default to map-by slot */
ORTE_SET_MAPPING_POLICY(map->mapping, ORTE_MAPPING_BYSLOT);
#endif
/* check for oversubscribe directives */
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
if (orte_managed_allocation) {
@ -190,7 +185,6 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
}
/* set the default mapping policy IFF it wasn't provided */
if (!ORTE_MAPPING_POLICY_IS_SET(jdata->map->mapping)) {
#if OPAL_HAVE_HWLOC
/* default based on number of procs */
if (nprocs <= 2) {
if (1 < orte_rmaps_base.cpus_per_rank) {
@ -215,10 +209,6 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
"mca:rmaps[%d] mapping not set by user - using bysocket", __LINE__);
ORTE_SET_MAPPING_POLICY(jdata->map->mapping, ORTE_MAPPING_BYSOCKET);
}
#else
/* in the absence of hwloc, default to map-by slot */
ORTE_SET_MAPPING_POLICY(jdata->map->mapping, ORTE_MAPPING_BYSLOT);
#endif
}
/* check for oversubscribe directives */
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
@ -246,7 +236,6 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
}
}
#if OPAL_HAVE_HWLOC
/* define the binding policy for this job - if the user specified one
* already (e.g., during the call to comm_spawn), then we don't
* override it */
@ -356,7 +345,6 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
}
}
}
#endif
/* cycle thru the available mappers until one agrees to map
* the job
@ -413,7 +401,6 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
return;
}
#if OPAL_HAVE_HWLOC
/* compute and save bindings */
if (ORTE_SUCCESS != (rc = orte_rmaps_base_compute_bindings(jdata))) {
ORTE_ERROR_LOG(rc);
@ -421,7 +408,6 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
OBJ_RELEASE(caddy);
return;
}
#endif
/* set the offset so shared memory components can potentially
* connect to any spawned jobs
@ -446,6 +432,10 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
orte_node_t *node;
orte_proc_t *proc;
char tmp1[1024];
hwloc_obj_t bd=NULL;;
opal_hwloc_locality_t locality;
orte_proc_t *p0;
char *p0bitmap, *procbitmap;
if (orte_display_diffable_output) {
/* intended solely to test mapping methods, this output
@ -470,74 +460,52 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
if (NULL == (proc = (orte_proc_t*)opal_pointer_array_get_item(node->procs, j))) {
continue;
}
#if OPAL_HAVE_HWLOC
{
hwloc_obj_t bd=NULL;;
memset(tmp1, 0, 1024);
orte_get_attribute(&proc->attributes, ORTE_PROC_HWLOC_BOUND, (void**)&bd, OPAL_PTR);
if (NULL == bd) {
memset(tmp1, 0, 1024);
orte_get_attribute(&proc->attributes, ORTE_PROC_HWLOC_BOUND, (void**)&bd, OPAL_PTR);
if (NULL == bd) {
(void)strncpy(tmp1, "UNBOUND", strlen("UNBOUND"));
} else {
if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2mapstr(tmp1, sizeof(tmp1), node->topology, bd->cpuset)) {
(void)strncpy(tmp1, "UNBOUND", strlen("UNBOUND"));
} else {
if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2mapstr(tmp1, sizeof(tmp1), node->topology, bd->cpuset)) {
(void)strncpy(tmp1, "UNBOUND", strlen("UNBOUND"));
}
}
opal_output(orte_clean_output, "\t\t<process rank=%s app_idx=%ld local_rank=%lu node_rank=%lu binding=%s>",
ORTE_VPID_PRINT(proc->name.vpid), (long)proc->app_idx,
(unsigned long)proc->local_rank,
(unsigned long)proc->node_rank, tmp1);
}
#else
opal_output(orte_clean_output, "\t\t<process rank=%s app_idx=%ld local_rank=%lu node_rank=%lu>",
opal_output(orte_clean_output, "\t\t<process rank=%s app_idx=%ld local_rank=%lu node_rank=%lu binding=%s>",
ORTE_VPID_PRINT(proc->name.vpid), (long)proc->app_idx,
(unsigned long)proc->local_rank,
(unsigned long)proc->node_rank);
#endif
fflush(stderr);
(unsigned long)proc->node_rank, tmp1);
}
opal_output(orte_clean_output, "\t</host>");
fflush(stderr);
}
#if OPAL_HAVE_HWLOC
{
opal_hwloc_locality_t locality;
orte_proc_t *p0;
char *p0bitmap, *procbitmap;
/* test locality - for the first node, print the locality of each proc relative to the first one */
node = (orte_node_t*)opal_pointer_array_get_item(jdata->map->nodes, 0);
p0 = (orte_proc_t*)opal_pointer_array_get_item(node->procs, 0);
p0bitmap = NULL;
orte_get_attribute(&p0->attributes, ORTE_PROC_CPU_BITMAP, (void**)&p0bitmap, OPAL_STRING);
opal_output(orte_clean_output, "\t<locality>");
for (j=1; j < node->procs->size; j++) {
if (NULL == (proc = (orte_proc_t*)opal_pointer_array_get_item(node->procs, j))) {
continue;
}
procbitmap = NULL;
orte_get_attribute(&proc->attributes, ORTE_PROC_CPU_BITMAP, (void**)&procbitmap, OPAL_STRING);
locality = opal_hwloc_base_get_relative_locality(node->topology,
p0bitmap,
procbitmap);
opal_output(orte_clean_output, "\t\t<rank=%s rank=%s locality=%s>",
ORTE_VPID_PRINT(p0->name.vpid),
ORTE_VPID_PRINT(proc->name.vpid),
opal_hwloc_base_print_locality(locality));
}
opal_output(orte_clean_output, "\t</locality>\n</map>");
fflush(stderr);
if (NULL != p0bitmap) {
free(p0bitmap);
}
if (NULL != procbitmap) {
free(procbitmap);
/* test locality - for the first node, print the locality of each proc relative to the first one */
node = (orte_node_t*)opal_pointer_array_get_item(jdata->map->nodes, 0);
p0 = (orte_proc_t*)opal_pointer_array_get_item(node->procs, 0);
p0bitmap = NULL;
orte_get_attribute(&p0->attributes, ORTE_PROC_CPU_BITMAP, (void**)&p0bitmap, OPAL_STRING);
opal_output(orte_clean_output, "\t<locality>");
for (j=1; j < node->procs->size; j++) {
if (NULL == (proc = (orte_proc_t*)opal_pointer_array_get_item(node->procs, j))) {
continue;
}
procbitmap = NULL;
orte_get_attribute(&proc->attributes, ORTE_PROC_CPU_BITMAP, (void**)&procbitmap, OPAL_STRING);
locality = opal_hwloc_base_get_relative_locality(node->topology,
p0bitmap,
procbitmap);
opal_output(orte_clean_output, "\t\t<rank=%s rank=%s locality=%s>",
ORTE_VPID_PRINT(p0->name.vpid),
ORTE_VPID_PRINT(proc->name.vpid),
opal_hwloc_base_print_locality(locality));
}
#else
opal_output(orte_clean_output, "\n</map>");
opal_output(orte_clean_output, "\t</locality>\n</map>");
fflush(stderr);
#endif
if (NULL != p0bitmap) {
free(p0bitmap);
}
if (NULL != procbitmap) {
free(procbitmap);
}
} else {
opal_output(orte_clean_output, " Data for JOB %s offset %s", ORTE_JOBID_PRINT(jdata->jobid), ORTE_VPID_PRINT(jdata->offset));
opal_dss.print(&output, NULL, jdata->map, ORTE_JOB_MAP);

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -48,7 +48,6 @@
#include "orte/mca/rmaps/base/rmaps_private.h"
#include "orte/mca/rmaps/base/base.h"
#if OPAL_HAVE_HWLOC
static int rank_span(orte_job_t *jdata,
orte_app_context_t *app,
opal_list_t *nodes,
@ -421,7 +420,6 @@ static int rank_by(orte_job_t *jdata,
return ORTE_SUCCESS;
}
#endif
int orte_rmaps_base_compute_vpids(orte_job_t *jdata,
orte_app_context_t *app,
@ -443,7 +441,6 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata,
* However, if this was the default ranking policy (as opposed to
* something given by the user), then fall back to rank-by slot
*/
#if OPAL_HAVE_HWLOC
if (ORTE_RANK_BY_NUMA == ORTE_GET_RANKING_POLICY(map->ranking)) {
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
"mca:rmaps: computing ranks by NUMA for job %s",
@ -548,7 +545,6 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata,
}
return rc;
}
#endif
if (ORTE_RANK_BY_NODE == ORTE_GET_RANKING_POLICY(map->ranking) ||
ORTE_RANK_BY_BOARD == ORTE_GET_RANKING_POLICY(map->ranking)) {
@ -611,9 +607,7 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata,
return ORTE_SUCCESS;
}
#if OPAL_HAVE_HWLOC
rankbyslot:
#endif
if (ORTE_RANK_BY_SLOT == ORTE_GET_RANKING_POLICY(map->ranking)) {
/* assign the ranks sequentially */
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,

Просмотреть файл

@ -1,19 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2012 Los Alamos National Security, LLC.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_rmaps_lama_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_orte_rmaps_lama_CONFIG], [
AC_CONFIG_FILES([orte/mca/rmaps/lama/Makefile])
AS_IF([test "$OPAL_HAVE_HWLOC" = 1],
[$1],
[$2])
])

Просмотреть файл

@ -1,19 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2012-2013 Los Alamos National Security, LLC.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_rmaps_mindist_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_orte_rmaps_mindist_CONFIG], [
AC_CONFIG_FILES([orte/mca/rmaps/mindist/Makefile])
AS_IF([test "$OPAL_HAVE_HWLOC" = 1],
[$1],
[$2])
])

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -56,13 +56,11 @@ typedef enum {
OPAL_HWLOC_HWTHREAD_LEVEL
} opal_hwloc_level_t;
#if OPAL_HAVE_HWLOC
static void prune(orte_jobid_t jobid,
orte_app_idx_t app_idx,
orte_node_t *node,
opal_hwloc_level_t *level,
orte_vpid_t *nmapped);
#endif
static int ppr[OPAL_HWLOC_HWTHREAD_LEVEL+1];
@ -75,14 +73,12 @@ static int ppr_mapper(orte_job_t *jdata)
orte_app_context_t *app;
orte_vpid_t total_procs, nprocs_mapped;
opal_hwloc_level_t start=OPAL_HWLOC_NODE_LEVEL;
#if OPAL_HAVE_HWLOC
hwloc_obj_t obj;
hwloc_obj_type_t lowest;
unsigned cache_level=0;
unsigned int nobjs, i;
bool pruning_reqd = false;
opal_hwloc_level_t level;
#endif
opal_list_t node_list;
opal_list_item_t *item;
orte_std_cntr_t num_slots;
@ -149,7 +145,6 @@ static int ppr_mapper(orte_job_t *jdata)
ORTE_SET_MAPPING_POLICY(jdata->map->mapping, ORTE_MAPPING_BYNODE);
start = OPAL_HWLOC_NODE_LEVEL;
n++;
#if OPAL_HAVE_HWLOC
} else if (0 == strncasecmp(ck[1], "hwthread", len) ||
0 == strncasecmp(ck[1], "thread", len)) {
ppr[OPAL_HWLOC_HWTHREAD_LEVEL] = strtol(ck[0], NULL, 10);
@ -202,7 +197,6 @@ static int ppr_mapper(orte_job_t *jdata)
ORTE_SET_MAPPING_POLICY(jdata->map->mapping, ORTE_MAPPING_BYNUMA);
}
n++;
#endif
} else {
/* unknown spec */
orte_show_help("help-orte-rmaps-ppr.txt", "unrecognized-ppr-option", true, ck[1], jdata->map->ppr);
@ -218,23 +212,19 @@ static int ppr_mapper(orte_job_t *jdata)
opal_output(0, "NOTHING GIVEN");
return ORTE_ERR_SILENT;
}
#if OPAL_HAVE_HWLOC
/* if more than one level was specified, then pruning will be reqd */
if (1 < n) {
pruning_reqd = true;
}
#endif
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
"mca:rmaps:ppr: job %s assigned policy %s",
ORTE_JOBID_PRINT(jdata->jobid),
orte_rmaps_base_print_mapping(jdata->map->mapping));
#if OPAL_HAVE_HWLOC
/* convenience */
level = start;
lowest = opal_hwloc_levels[start];
#endif
for (idx=0; idx < (orte_app_idx_t)jdata->apps->size; idx++) {
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, idx))) {
@ -270,7 +260,6 @@ static int ppr_mapper(orte_job_t *jdata)
item != opal_list_get_end(&node_list);
item = opal_list_get_next(item)) {
node = (orte_node_t*)item;
#if OPAL_HAVE_HWLOC
/* bozo check */
if (NULL == node->topology) {
orte_show_help("help-orte-rmaps-ppr.txt", "ppr-topo-missing",
@ -278,7 +267,6 @@ static int ppr_mapper(orte_job_t *jdata)
rc = ORTE_ERR_SILENT;
goto error;
}
#endif
/* add the node to the map, if needed */
if (!ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_MAPPED)) {
if (ORTE_SUCCESS > (rc = opal_pointer_array_add(jdata->map->nodes, (void*)node))) {
@ -293,20 +281,15 @@ static int ppr_mapper(orte_job_t *jdata)
* that many procs on this node
*/
if (OPAL_HWLOC_NODE_LEVEL == start) {
#if OPAL_HAVE_HWLOC
obj = hwloc_get_root_obj(node->topology);
#endif
for (j=0; j < ppr[start] && nprocs_mapped < total_procs; j++) {
if (NULL == (proc = orte_rmaps_base_setup_proc(jdata, node, idx))) {
rc = ORTE_ERR_OUT_OF_RESOURCE;
goto error;
}
nprocs_mapped++;
#if OPAL_HAVE_HWLOC
orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_LOCALE, ORTE_ATTR_LOCAL, obj, OPAL_PTR);
#endif
}
#if OPAL_HAVE_HWLOC
} else {
/* get the number of lowest resources on this node */
nobjs = opal_hwloc_base_get_nbobjs_by_type(node->topology,
@ -338,7 +321,6 @@ static int ppr_mapper(orte_job_t *jdata)
level--;
prune(jdata->jobid, idx, node, &level, &nprocs_mapped);
}
#endif
}
/* set the total slots used */
@ -410,7 +392,6 @@ static int ppr_mapper(orte_job_t *jdata)
return rc;
}
#if OPAL_HAVE_HWLOC
static hwloc_obj_t find_split(hwloc_topology_t topo, hwloc_obj_t obj)
{
unsigned k;
@ -616,4 +597,3 @@ static void prune(orte_jobid_t jobid,
error:
opal_output(0, "INFINITE LOOP");
}
#endif

Просмотреть файл

@ -1,19 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2013 Los Alamos National Security, LLC.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_rmaps_rank_file_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_orte_rmaps_rank_file_CONFIG], [
AC_CONFIG_FILES([orte/mca/rmaps/rank_file/Makefile])
AS_IF([test "$OPAL_HAVE_HWLOC" = 1],
[$1],
[$2])
])

Просмотреть файл

@ -81,9 +81,7 @@ static int orte_rmaps_rf_map(orte_job_t *jdata)
mca_base_component_t *c = &mca_rmaps_rank_file_component.super.base_version;
char *slots;
bool initial_map=true;
#if OPAL_HAVE_HWLOC
opal_hwloc_resource_type_t rtype;
#endif
/* only handle initial launch of rf job */
if (ORTE_FLAG_TEST(jdata, ORTE_JOB_FLAG_RESTART)) {
@ -117,7 +115,6 @@ static int orte_rmaps_rf_map(orte_job_t *jdata)
/* convenience def */
map = jdata->map;
#if OPAL_HAVE_HWLOC
/* default to LOGICAL processors */
if (mca_rmaps_rank_file_component.physical) {
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
@ -128,7 +125,6 @@ static int orte_rmaps_rf_map(orte_job_t *jdata)
"mca:rmaps:rank_file: using LOGICAL processors");
rtype = OPAL_HWLOC_LOGICAL;
}
#endif
/* setup the node list */
OBJ_CONSTRUCT(&node_list, opal_list_t);
@ -205,7 +201,6 @@ static int orte_rmaps_rf_map(orte_job_t *jdata)
orte_show_help("help-rmaps_rank_file.txt", "missing-rank", true, rank, orte_rankfile);
rc = ORTE_ERR_SILENT;
goto error;
#if OPAL_HAVE_HWLOC
} else {
if (0 == strlen(rfmap->slot_list)) {
/* rank was specified but no slot list given - that's an error */
@ -214,7 +209,6 @@ static int orte_rmaps_rf_map(orte_job_t *jdata)
goto error;
}
slots = rfmap->slot_list;
#endif
}
/* find the node where this proc was assigned */
@ -277,7 +271,6 @@ static int orte_rmaps_rf_map(orte_job_t *jdata)
/* set the vpid */
proc->name.vpid = rank;
#if OPAL_HAVE_HWLOC
if (NULL != slots) {
/* setup the bitmap */
hwloc_cpuset_t bitmap;
@ -308,17 +301,6 @@ static int orte_rmaps_rf_map(orte_job_t *jdata)
free(cpu_bitmap);
hwloc_bitmap_free(bitmap);
}
#else
/* if we don't have hwloc, then all the rank_file can contain
* is the node assignment - it cannot contain any directives
* for socket, cores, etc. as we cannot honor them
*/
if (NULL != slots) {
orte_show_help("help-rmaps_rank_file.txt", "no-hwloc", true, rank, slots);
rc = ORTE_ERR_SILENT;
goto error;
}
#endif
/* insert the proc into the proper place */
if (ORTE_SUCCESS != (rc = opal_pointer_array_set_item(jdata->procs,

Просмотреть файл

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2008 Voltaire. All rights reserved
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
@ -106,11 +106,7 @@ static int orte_rmaps_rank_file_register(void)
static int orte_rmaps_rank_file_open(void)
{
/* ensure we flag mapping by user */
#if OPAL_HAVE_HWLOC
if (NULL != opal_hwloc_base_slot_list || NULL != orte_rankfile) {
#else
if (NULL != orte_rankfile) {
#endif
if (ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) {
/* if a non-default mapping is already specified, then we
* have an error

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -55,9 +55,7 @@ struct orte_job_map_t {
char *last_mapper; /* last mapper used */
orte_mapping_policy_t mapping;
orte_ranking_policy_t ranking;
#if OPAL_HAVE_HWLOC
opal_binding_policy_t binding;
#endif
/* mapping options */
char *ppr;
int16_t cpus_per_rank;

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -146,7 +146,6 @@ static int orte_rmaps_rr_map(orte_job_t *jdata)
} else if (ORTE_MAPPING_BYSLOT == ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) {
rc = orte_rmaps_rr_byslot(jdata, app, &node_list, num_slots,
app->num_procs);
#if OPAL_HAVE_HWLOC
} else if (ORTE_MAPPING_BYHWTHREAD == ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) {
rc = orte_rmaps_rr_byobj(jdata, app, &node_list, num_slots,
app->num_procs, HWLOC_OBJ_PU, 0);
@ -231,7 +230,6 @@ static int orte_rmaps_rr_map(orte_job_t *jdata)
rc = orte_rmaps_rr_byslot(jdata, app, &node_list, num_slots,
app->num_procs);
}
#endif
} else {
/* unrecognized mapping directive */
orte_show_help("help-orte-rmaps-base.txt", "unrecognized-policy",

Просмотреть файл

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -46,13 +47,11 @@ ORTE_MODULE_DECLSPEC int orte_rmaps_rr_byslot(orte_job_t *jdata,
orte_std_cntr_t num_slots,
orte_vpid_t nprocs);
#if OPAL_HAVE_HWLOC
ORTE_MODULE_DECLSPEC int orte_rmaps_rr_byobj(orte_job_t *jdata, orte_app_context_t *app,
opal_list_t *node_list,
orte_std_cntr_t num_slots,
orte_vpid_t num_procs,
hwloc_obj_type_t target, unsigned cache_level);
#endif
END_C_DECLS

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -45,9 +45,7 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
orte_node_t *node;
orte_proc_t *proc;
int num_procs_to_assign, extra_procs_to_assign=0, nxtra_nodes=0;
#if OPAL_HAVE_HWLOC
hwloc_obj_t obj=NULL;
#endif
float balance;
bool add_one=false;
@ -72,14 +70,12 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
opal_output_verbose(2, orte_rmaps_base_framework.framework_output,
"mca:rmaps:rr:slot working node %s",
node->name);
#if OPAL_HAVE_HWLOC
/* get the root object as we are not assigning
* locale here except at the node level
*/
if (NULL != node->topology) {
obj = hwloc_get_root_obj(node->topology);
}
#endif
if (node->slots <= node->slots_inuse) {
opal_output_verbose(2, orte_rmaps_base_framework.framework_output,
"mca:rmaps:rr:slot node %s is full - skipping",
@ -110,9 +106,7 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
return ORTE_ERR_OUT_OF_RESOURCE;
}
nprocs_mapped++;
#if OPAL_HAVE_HWLOC
orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_LOCALE, ORTE_ATTR_LOCAL, obj, OPAL_PTR);
#endif
}
}
@ -146,14 +140,13 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
opal_output_verbose(2, orte_rmaps_base_framework.framework_output,
"mca:rmaps:rr:slot working node %s",
node->name);
#if OPAL_HAVE_HWLOC
/* get the root object as we are not assigning
* locale except at the node level
*/
if (NULL != node->topology) {
obj = hwloc_get_root_obj(node->topology);
}
#endif
/* add this node to the map - do it only once */
if (!ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_MAPPED)) {
if (ORTE_SUCCESS > (rc = opal_pointer_array_add(jdata->map->nodes, (void*)node))) {
@ -181,9 +174,7 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
return ORTE_ERR_OUT_OF_RESOURCE;
}
nprocs_mapped++;
#if OPAL_HAVE_HWLOC
orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_LOCALE, ORTE_ATTR_LOCAL, obj, OPAL_PTR);
#endif
}
/* not all nodes are equal, so only set oversubscribed for
* this node if it is in that state
@ -213,9 +204,7 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
orte_proc_t *proc;
int num_procs_to_assign, navg, idx;
int extra_procs_to_assign=0, nxtra_nodes=0;
#if OPAL_HAVE_HWLOC
hwloc_obj_t obj=NULL;
#endif
float balance;
bool add_one=false;
bool oversubscribed=false;
@ -276,14 +265,12 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
nnodes = 0;
OPAL_LIST_FOREACH(node, node_list, orte_node_t) {
#if OPAL_HAVE_HWLOC
/* get the root object as we are not assigning
* locale except at the node level
*/
if (NULL != node->topology) {
obj = hwloc_get_root_obj(node->topology);
}
#endif
/* add this node to the map, but only do so once */
if (!ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_MAPPED)) {
if (ORTE_SUCCESS > (idx = opal_pointer_array_add(jdata->map->nodes, (void*)node))) {
@ -352,9 +339,7 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
return ORTE_ERR_OUT_OF_RESOURCE;
}
nprocs_mapped++;
#if OPAL_HAVE_HWLOC
orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_LOCALE, ORTE_ATTR_LOCAL, obj, OPAL_PTR);
#endif
}
/* not all nodes are equal, so only set oversubscribed for
* this node if it is in that state
@ -375,14 +360,13 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
/* now fillin as required until fully mapped */
while (nprocs_mapped < app->num_procs) {
OPAL_LIST_FOREACH(node, node_list, orte_node_t) {
#if OPAL_HAVE_HWLOC
/* get the root object as we are not assigning
* locale except at the node level
*/
if (NULL != node->topology) {
obj = hwloc_get_root_obj(node->topology);
}
#endif
OPAL_OUTPUT_VERBOSE((20, orte_rmaps_base_framework.framework_output,
"%s ADDING PROC TO NODE %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), node->name));
@ -390,9 +374,7 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
return ORTE_ERR_OUT_OF_RESOURCE;
}
nprocs_mapped++;
#if OPAL_HAVE_HWLOC
orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_LOCALE, ORTE_ATTR_LOCAL, obj, OPAL_PTR);
#endif
/* not all nodes are equal, so only set oversubscribed for
* this node if it is in that state
*/
@ -412,7 +394,6 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
return ORTE_SUCCESS;
}
#if OPAL_HAVE_HWLOC
static int byobj_span(orte_job_t *jdata,
orte_app_context_t *app,
opal_list_t *node_list,
@ -716,5 +697,4 @@ static int byobj_span(orte_job_t *jdata,
return ORTE_SUCCESS;
}
#endif

Просмотреть файл

@ -103,9 +103,7 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
mca_base_component_t *c = &mca_rmaps_seq_component.base_version;
char *hosts, *sep, *eptr;
FILE *fp;
#if OPAL_HAVE_HWLOC
opal_hwloc_resource_type_t rtype;
#endif
OPAL_OUTPUT_VERBOSE((1, orte_rmaps_base_framework.framework_output,
"%s rmaps:seq called on job %s",
@ -197,7 +195,6 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
save = (seq_node_t*)opal_list_get_first(&default_seq_list);
}
#if OPAL_HAVE_HWLOC
/* default to LOGICAL processors */
if (orte_get_attribute(&jdata->attributes, ORTE_JOB_PHYSICAL_CPUIDS, NULL, OPAL_BOOL)) {
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
@ -208,7 +205,6 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
"mca:rmaps:seq: using LOGICAL processors");
rtype = OPAL_HWLOC_LOGICAL;
}
#endif
/* initialize all the nodes as not included in this job map */
for (j=0; j < orte_node_pool->size; j++) {
@ -381,68 +377,64 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
"mca:rmaps:seq: assign proc %s to node %s for app %s",
ORTE_VPID_PRINT(proc->name.vpid), sq->hostname, app->app);
#if OPAL_HAVE_HWLOC
{
/* record the cpuset, if given */
if (NULL != sq->cpuset) {
hwloc_cpuset_t bitmap;
char *cpu_bitmap;
if (NULL == node->topology) {
/* not allowed - for sequential cpusets, we must have
* the topology info
*/
orte_show_help("help-orte-rmaps-base.txt", "rmaps:no-topology", true, node->name);
rc = ORTE_ERR_SILENT;
/* record the cpuset, if given */
if (NULL != sq->cpuset) {
hwloc_cpuset_t bitmap;
char *cpu_bitmap;
if (NULL == node->topology) {
/* not allowed - for sequential cpusets, we must have
* the topology info
*/
orte_show_help("help-orte-rmaps-base.txt", "rmaps:no-topology", true, node->name);
rc = ORTE_ERR_SILENT;
goto error;
}
/* if we are using hwthreads as cpus and binding to hwthreads, then
* we can just copy the cpuset across as it already specifies things
* at that level */
if (opal_hwloc_use_hwthreads_as_cpus &&
OPAL_BIND_TO_HWTHREAD == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) {
cpu_bitmap = strdup(sq->cpuset);
} else {
/* setup the bitmap */
bitmap = hwloc_bitmap_alloc();
/* parse the slot_list to find the socket and core */
if (ORTE_SUCCESS != (rc = opal_hwloc_base_slot_list_parse(sq->cpuset, node->topology, rtype, bitmap))) {
ORTE_ERROR_LOG(rc);
hwloc_bitmap_free(bitmap);
goto error;
}
/* if we are using hwthreads as cpus and binding to hwthreads, then
* we can just copy the cpuset across as it already specifies things
* at that level */
if (opal_hwloc_use_hwthreads_as_cpus &&
OPAL_BIND_TO_HWTHREAD == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) {
cpu_bitmap = strdup(sq->cpuset);
} else {
/* setup the bitmap */
bitmap = hwloc_bitmap_alloc();
/* parse the slot_list to find the socket and core */
if (ORTE_SUCCESS != (rc = opal_hwloc_base_slot_list_parse(sq->cpuset, node->topology, rtype, bitmap))) {
ORTE_ERROR_LOG(rc);
hwloc_bitmap_free(bitmap);
goto error;
}
/* note that we cannot set the proc locale to any specific object
* as the slot list may have assigned it to more than one - so
* leave that field NULL
*/
/* set the proc to the specified map */
hwloc_bitmap_list_asprintf(&cpu_bitmap, bitmap);
hwloc_bitmap_free(bitmap);
}
orte_set_attribute(&proc->attributes, ORTE_PROC_CPU_BITMAP, ORTE_ATTR_GLOBAL, cpu_bitmap, OPAL_STRING);
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
"mca:rmaps:seq: binding proc %s to cpuset %s bitmap %s",
ORTE_VPID_PRINT(proc->name.vpid), sq->cpuset, cpu_bitmap);
/* we are going to bind to cpuset since the user is specifying the cpus */
OPAL_SET_BINDING_POLICY(jdata->map->binding, OPAL_BIND_TO_CPUSET);
/* note that the user specified the mapping */
ORTE_SET_MAPPING_POLICY(jdata->map->mapping, ORTE_MAPPING_BYUSER);
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_GIVEN);
/* cleanup */
free(cpu_bitmap);
} else {
hwloc_obj_t locale;
/* assign the locale - okay for the topo to be null as
* it just means it wasn't returned
/* note that we cannot set the proc locale to any specific object
* as the slot list may have assigned it to more than one - so
* leave that field NULL
*/
if (NULL != node->topology) {
locale = hwloc_get_root_obj(node->topology);
orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_LOCALE,
ORTE_ATTR_LOCAL, locale, OPAL_PTR);
}
/* set the proc to the specified map */
hwloc_bitmap_list_asprintf(&cpu_bitmap, bitmap);
hwloc_bitmap_free(bitmap);
}
orte_set_attribute(&proc->attributes, ORTE_PROC_CPU_BITMAP, ORTE_ATTR_GLOBAL, cpu_bitmap, OPAL_STRING);
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
"mca:rmaps:seq: binding proc %s to cpuset %s bitmap %s",
ORTE_VPID_PRINT(proc->name.vpid), sq->cpuset, cpu_bitmap);
/* we are going to bind to cpuset since the user is specifying the cpus */
OPAL_SET_BINDING_POLICY(jdata->map->binding, OPAL_BIND_TO_CPUSET);
/* note that the user specified the mapping */
ORTE_SET_MAPPING_POLICY(jdata->map->mapping, ORTE_MAPPING_BYUSER);
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_GIVEN);
/* cleanup */
free(cpu_bitmap);
} else {
hwloc_obj_t locale;
/* assign the locale - okay for the topo to be null as
* it just means it wasn't returned
*/
if (NULL != node->topology) {
locale = hwloc_get_root_obj(node->topology);
orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_LOCALE,
ORTE_ATTR_LOCAL, locale, OPAL_PTR);
}
}
#endif
/* add to the jdata proc array */
if (ORTE_SUCCESS != (rc = opal_pointer_array_set_item(jdata->procs, proc->name.vpid, proc))) {

Просмотреть файл

@ -1,18 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2014 Intel, Inc. All rights reserved
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_rtc_hwloc_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_orte_rtc_hwloc_CONFIG], [
AC_CONFIG_FILES([orte/mca/rtc/hwloc/Makefile])
AS_IF([test "$OPAL_HAVE_HWLOC" = 1],
[$1],
[$2])
])

Просмотреть файл

@ -378,34 +378,30 @@ static int setup_fork(orte_job_t *jdata,
opal_setenv("OMPI_MCA_orte_num_nodes", param, true, &app->env);
free(param);
#if OPAL_HAVE_HWLOC
{
/* pass a param telling the child what type and model of cpu we are on,
* if we know it. If hwloc has the value, use what it knows. Otherwise,
* see if we were explicitly given it and use that value.
*/
hwloc_obj_t obj;
char *htmp;
if (NULL != opal_hwloc_topology) {
obj = hwloc_get_root_obj(opal_hwloc_topology);
if (NULL != (htmp = (char*)hwloc_obj_get_info_by_name(obj, "CPUType")) ||
NULL != (htmp = orte_local_cpu_type)) {
opal_setenv("OMPI_MCA_orte_cpu_type", htmp, true, &app->env);
}
if (NULL != (htmp = (char*)hwloc_obj_get_info_by_name(obj, "CPUModel")) ||
NULL != (htmp = orte_local_cpu_model)) {
opal_setenv("OMPI_MCA_orte_cpu_model", htmp, true, &app->env);
}
} else {
if (NULL != orte_local_cpu_type) {
opal_setenv("OMPI_MCA_orte_cpu_type", orte_local_cpu_type, true, &app->env);
}
if (NULL != orte_local_cpu_model) {
opal_setenv("OMPI_MCA_orte_cpu_model", orte_local_cpu_model, true, &app->env);
}
/* pass a param telling the child what type and model of cpu we are on,
* if we know it. If hwloc has the value, use what it knows. Otherwise,
* see if we were explicitly given it and use that value.
*/
hwloc_obj_t obj;
char *htmp;
if (NULL != opal_hwloc_topology) {
obj = hwloc_get_root_obj(opal_hwloc_topology);
if (NULL != (htmp = (char*)hwloc_obj_get_info_by_name(obj, "CPUType")) ||
NULL != (htmp = orte_local_cpu_type)) {
opal_setenv("OMPI_MCA_orte_cpu_type", htmp, true, &app->env);
}
if (NULL != (htmp = (char*)hwloc_obj_get_info_by_name(obj, "CPUModel")) ||
NULL != (htmp = orte_local_cpu_model)) {
opal_setenv("OMPI_MCA_orte_cpu_model", htmp, true, &app->env);
}
} else {
if (NULL != orte_local_cpu_type) {
opal_setenv("OMPI_MCA_orte_cpu_type", orte_local_cpu_type, true, &app->env);
}
if (NULL != orte_local_cpu_model) {
opal_setenv("OMPI_MCA_orte_cpu_model", orte_local_cpu_model, true, &app->env);
}
}
#endif
/* get shmem's best component name so we can provide a hint to the shmem
* framework. the idea here is to have someone figure out what component to

Просмотреть файл

@ -1,7 +1,7 @@
/*
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -198,6 +198,9 @@ static void allocation_complete(int fd, short args, void *cbdata)
orte_state_caddy_t *state = (orte_state_caddy_t*)cbdata;
orte_job_t *jdata = state->jdata;
orte_job_t *daemons;
orte_topology_t *t;
orte_node_t *node;
int i;
jdata->state = ORTE_JOB_STATE_ALLOCATION_COMPLETE;
@ -210,24 +213,17 @@ static void allocation_complete(int fd, short args, void *cbdata)
/* mark that we are not using a VM */
orte_set_attribute(&daemons->attributes, ORTE_JOB_NO_VM, ORTE_ATTR_GLOBAL, NULL, OPAL_BOOL);
#if OPAL_HAVE_HWLOC
{
orte_topology_t *t;
orte_node_t *node;
int i;
/* ensure that all nodes point to our topology - we
* cannot support hetero nodes with this state machine
*/
t = (orte_topology_t*)opal_pointer_array_get_item(orte_node_topologies, 0);
for (i=1; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
node->topology = t->topo;
/* ensure that all nodes point to our topology - we
* cannot support hetero nodes with this state machine
*/
t = (orte_topology_t*)opal_pointer_array_get_item(orte_node_topologies, 0);
for (i=1; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue;
}
node->topology = t->topo;
}
#endif
/* move to the map stage */
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_MAP);

Просмотреть файл

@ -211,7 +211,6 @@ opal_cmd_line_init_t orte_cmd_line_opts[] = {
NULL, OPAL_CMD_LINE_TYPE_STRING,
"Regular expression defining nodes in system" },
#if OPAL_HAVE_HWLOC
{ "orte_hetero_nodes", '\0', NULL, "hetero-nodes", 0,
NULL, OPAL_CMD_LINE_TYPE_BOOL,
"Nodes in cluster may differ in topology, so send the topology back from each node [Default = false]" },
@ -219,7 +218,6 @@ opal_cmd_line_init_t orte_cmd_line_opts[] = {
{ NULL, '\0', NULL, "hnp-topo-sig", 1,
&orted_globals.hnp_topo_sig, OPAL_CMD_LINE_TYPE_STRING,
"Topology signature of HNP" },
#endif
{ NULL, '\0', "mapreduce", "mapreduce", 0,
&orted_globals.mapreduce, OPAL_CMD_LINE_TYPE_BOOL,
@ -241,6 +239,8 @@ int orte_daemon(int argc, char *argv[])
#if OPAL_ENABLE_FT_CR == 1
char *tmp_env_var = NULL;
#endif
char *coprocessors;
uint8_t tflag;
/* initialize the globals */
memset(&orted_globals, 0, sizeof(orted_globals));
@ -374,7 +374,6 @@ int orte_daemon(int argc, char *argv[])
*/
opal_finalize_util();
#if OPAL_HAVE_HWLOC
/* bind ourselves if so directed */
if (NULL != orte_daemon_cores) {
char **cores=NULL, tmp[128];
@ -428,7 +427,6 @@ int orte_daemon(int argc, char *argv[])
opal_argv_free(cores);
}
}
#endif
if ((int)ORTE_VPID_INVALID != orted_globals.fail) {
orted_globals.abort=false;
@ -763,46 +761,39 @@ int orte_daemon(int argc, char *argv[])
opal_argv_free(aliases);
}
#if OPAL_HAVE_HWLOC
{
char *coprocessors;
uint8_t tflag;
/* add the local topology, if different from the HNP's or user directed us to,
* but always if we are the first daemon to ensure we get a compute node */
if (1 == ORTE_PROC_MY_NAME->vpid || orte_hetero_nodes ||
0 != strcmp(orte_topo_signature, orted_globals.hnp_topo_sig)) {
tflag = 1;
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &tflag, 1, OPAL_UINT8))) {
ORTE_ERROR_LOG(ret);
}
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &orte_topo_signature, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(ret);
}
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &opal_hwloc_topology, 1, OPAL_HWLOC_TOPO))) {
ORTE_ERROR_LOG(ret);
}
} else {
tflag = 0;
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &tflag, 1, OPAL_UINT8))) {
ORTE_ERROR_LOG(ret);
}
}
/* detect and add any coprocessors */
coprocessors = opal_hwloc_base_find_coprocessors(opal_hwloc_topology);
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &coprocessors, 1, OPAL_STRING))) {
/* add the local topology, if different from the HNP's or user directed us to,
* but always if we are the first daemon to ensure we get a compute node */
if (1 == ORTE_PROC_MY_NAME->vpid || orte_hetero_nodes ||
0 != strcmp(orte_topo_signature, orted_globals.hnp_topo_sig)) {
tflag = 1;
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &tflag, 1, OPAL_UINT8))) {
ORTE_ERROR_LOG(ret);
}
/* see if I am on a coprocessor */
coprocessors = opal_hwloc_base_check_on_coprocessor();
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &coprocessors, 1, OPAL_STRING))) {
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &orte_topo_signature, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(ret);
}
if (NULL!= coprocessors) {
free(coprocessors);
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &opal_hwloc_topology, 1, OPAL_HWLOC_TOPO))) {
ORTE_ERROR_LOG(ret);
}
} else {
tflag = 0;
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &tflag, 1, OPAL_UINT8))) {
ORTE_ERROR_LOG(ret);
}
}
#endif
/* detect and add any coprocessors */
coprocessors = opal_hwloc_base_find_coprocessors(opal_hwloc_topology);
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &coprocessors, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(ret);
}
/* see if I am on a coprocessor */
coprocessors = opal_hwloc_base_check_on_coprocessor();
if (ORTE_SUCCESS != (ret = opal_dss.pack(buffer, &coprocessors, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(ret);
}
if (NULL!= coprocessors) {
free(coprocessors);
}
/* send to the HNP's callback - will be routed if routes are available */
if (0 > (ret = orte_rml.send_buffer_nb(ORTE_PROC_MY_HNP, buffer,

Просмотреть файл

@ -228,7 +228,6 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
if (ORTE_SUCCESS != rc) {
return rc;
}
#if OPAL_HAVE_HWLOC
} else if (0 == strcmp(info->key, OPAL_PMIX_BINDTO)) {
if (NULL == jdata->map) {
jdata->map = OBJ_NEW(orte_job_map_t);
@ -245,7 +244,6 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
if (ORTE_SUCCESS != rc) {
return rc;
}
#endif
} else if (0 == strcmp(info->key, OPAL_PMIX_NON_PMI)) {
orte_set_attribute(&jdata->attributes, ORTE_JOB_NON_ORTE_JOB,
ORTE_ATTR_GLOBAL, NULL, OPAL_BOOL);

Просмотреть файл

@ -94,7 +94,6 @@ int orte_pmix_server_register_nspace(orte_job_t *jdata)
uid = geteuid();
gid = getegid();
#if OPAL_HAVE_HWLOC
/* local topology - we do this so the procs won't read the
* topology themselves as this could overwhelm the local
* system on large-scale SMPs */
@ -111,7 +110,6 @@ int orte_pmix_server_register_nspace(orte_job_t *jdata)
kv->type = OPAL_STRING;
opal_list_append(info, &kv->super);
}
#endif /* OPAL_HAVE_HWLOC */
/* jobid */
kv = OBJ_NEW(opal_value_t);

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -201,9 +201,7 @@ int orte_dt_copy_map(orte_job_map_t **dest, orte_job_map_t *src, opal_data_type_
/* copy data into it */
(*dest)->mapping = src->mapping;
(*dest)->ranking = src->ranking;
#if OPAL_HAVE_HWLOC
(*dest)->binding = src->binding;
#endif
if (NULL != src->ppr) {
(*dest)->ppr = strdup(src->ppr);
}

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -559,12 +559,10 @@ int orte_dt_pack_map(opal_buffer_t *buffer, const void *src,
ORTE_ERROR_LOG(rc);
return rc;
}
#if OPAL_HAVE_HWLOC
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer, &(maps[i]->binding), 1, OPAL_BINDING_POLICY))) {
ORTE_ERROR_LOG(rc);
return rc;
}
#endif
/* pack any ppr */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer, &(maps[i]->ppr), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
@ -776,7 +774,7 @@ int orte_dt_pack_attr(opal_buffer_t *buffer, const void *src, int32_t num_vals,
if (OPAL_SUCCESS != (ret = opal_dss_pack_buffer(buffer, &ptr[i]->data.name, 1, ORTE_NAME))) {
return ret;
}
break;
break;
default:
opal_output(0, "PACK-ORTE-ATTR: UNSUPPORTED TYPE %d", (int)ptr[i]->type);
return OPAL_ERROR;

Просмотреть файл

@ -390,7 +390,6 @@ int orte_dt_print_node(char **output, char *prefix, orte_node_t *src, opal_data_
tmp = tmp2;
}
#if OPAL_HAVE_HWLOC
if (orte_display_topo_with_map && NULL != src->topology) {
char *pfx3;
asprintf(&tmp2, "%s\n%s\tDetected Resources:\n", tmp, pfx2);
@ -406,7 +405,6 @@ int orte_dt_print_node(char **output, char *prefix, orte_node_t *src, opal_data_
free(tmp2);
tmp = tmp3;
}
#endif
asprintf(&tmp2, "%s\n%s\tNum procs: %ld\tNext node_rank: %ld", tmp, pfx2,
(long)src->num_procs, (long)src->next_node_rank);
@ -444,6 +442,8 @@ int orte_dt_print_node(char **output, char *prefix, orte_node_t *src, opal_data_
int orte_dt_print_proc(char **output, char *prefix, orte_proc_t *src, opal_data_type_t type)
{
char *tmp, *tmp2, *pfx2;
hwloc_obj_t loc=NULL, bd=NULL;
char locale[1024], bind[1024];
/* set default result */
*output = NULL;
@ -469,45 +469,37 @@ int orte_dt_print_proc(char **output, char *prefix, orte_proc_t *src, opal_data_
}
if (!orte_devel_level_output) {
#if OPAL_HAVE_HWLOC
{
hwloc_cpuset_t mycpus;
char tmp1[1024], tmp2[1024];
char *str=NULL, *cpu_bitmap=NULL;
hwloc_cpuset_t mycpus;
char tmp1[1024], tmp2[1024];
char *str=NULL, *cpu_bitmap=NULL;
if (orte_get_attribute(&src->attributes, ORTE_PROC_CPU_BITMAP, (void**)&cpu_bitmap, OPAL_STRING) &&
NULL != src->node->topology) {
mycpus = hwloc_bitmap_alloc();
hwloc_bitmap_list_sscanf(mycpus, cpu_bitmap);
if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2str(tmp1, sizeof(tmp1), src->node->topology, mycpus)) {
str = strdup("UNBOUND");
} else {
opal_hwloc_base_cset2mapstr(tmp2, sizeof(tmp2), src->node->topology, mycpus);
asprintf(&str, "%s:%s", tmp1, tmp2);
}
hwloc_bitmap_free(mycpus);
asprintf(&tmp, "\n%sProcess OMPI jobid: %s App: %ld Process rank: %s Bound: %s", pfx2,
ORTE_JOBID_PRINT(src->name.jobid), (long)src->app_idx,
ORTE_VPID_PRINT(src->name.vpid), (NULL == str) ? "N/A" : str);
if (NULL != str) {
free(str);
}
if (NULL != cpu_bitmap) {
free(cpu_bitmap);
}
if (orte_get_attribute(&src->attributes, ORTE_PROC_CPU_BITMAP, (void**)&cpu_bitmap, OPAL_STRING) &&
NULL != src->node->topology) {
mycpus = hwloc_bitmap_alloc();
hwloc_bitmap_list_sscanf(mycpus, cpu_bitmap);
if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2str(tmp1, sizeof(tmp1), src->node->topology, mycpus)) {
str = strdup("UNBOUND");
} else {
/* just print a very simple output for users */
asprintf(&tmp, "\n%sProcess OMPI jobid: %s App: %ld Process rank: %s Bound: N/A", pfx2,
ORTE_JOBID_PRINT(src->name.jobid), (long)src->app_idx,
ORTE_VPID_PRINT(src->name.vpid));
opal_hwloc_base_cset2mapstr(tmp2, sizeof(tmp2), src->node->topology, mycpus);
asprintf(&str, "%s:%s", tmp1, tmp2);
}
hwloc_bitmap_free(mycpus);
asprintf(&tmp, "\n%sProcess OMPI jobid: %s App: %ld Process rank: %s Bound: %s", pfx2,
ORTE_JOBID_PRINT(src->name.jobid), (long)src->app_idx,
ORTE_VPID_PRINT(src->name.vpid), (NULL == str) ? "N/A" : str);
if (NULL != str) {
free(str);
}
if (NULL != cpu_bitmap) {
free(cpu_bitmap);
}
} else {
/* just print a very simple output for users */
asprintf(&tmp, "\n%sProcess OMPI jobid: %s App: %ld Process rank: %s Bound: N/A", pfx2,
ORTE_JOBID_PRINT(src->name.jobid), (long)src->app_idx,
ORTE_VPID_PRINT(src->name.vpid));
}
#else
/* just print a very simple output for users */
asprintf(&tmp, "\n%sProcess OMPI jobid: %s App: %ld Process rank: %s", pfx2,
ORTE_JOBID_PRINT(src->name.jobid), (long)src->app_idx,
ORTE_VPID_PRINT(src->name.vpid));
#endif
/* set the return */
*output = tmp;
free(pfx2);
@ -521,40 +513,30 @@ int orte_dt_print_proc(char **output, char *prefix, orte_proc_t *src, opal_data_
free(tmp);
tmp = tmp2;
#if OPAL_HAVE_HWLOC
{
hwloc_obj_t loc=NULL, bd=NULL;
char locale[1024], bind[1024];
if (orte_get_attribute(&src->attributes, ORTE_PROC_HWLOC_LOCALE, (void**)&loc, OPAL_PTR)) {
if (NULL != loc) {
if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2mapstr(locale, sizeof(locale), src->node->topology, loc->cpuset)) {
strcpy(locale, "NODE");
}
} else {
strcpy(locale, "UNKNOWN");
if (orte_get_attribute(&src->attributes, ORTE_PROC_HWLOC_LOCALE, (void**)&loc, OPAL_PTR)) {
if (NULL != loc) {
if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2mapstr(locale, sizeof(locale), src->node->topology, loc->cpuset)) {
strcpy(locale, "NODE");
}
} else {
strcpy(locale, "UNKNOWN");
}
if (orte_get_attribute(&src->attributes, ORTE_PROC_HWLOC_BOUND, (void**)&bd, OPAL_PTR)) {
if (NULL != bd) {
if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2mapstr(bind, sizeof(bind), src->node->topology, bd->cpuset)) {
strcpy(bind, "UNBOUND");
}
} else {
} else {
strcpy(locale, "UNKNOWN");
}
if (orte_get_attribute(&src->attributes, ORTE_PROC_HWLOC_BOUND, (void**)&bd, OPAL_PTR)) {
if (NULL != bd) {
if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2mapstr(bind, sizeof(bind), src->node->topology, bd->cpuset)) {
strcpy(bind, "UNBOUND");
}
} else {
strcpy(bind, "UNBOUND");
}
asprintf(&tmp2, "%s\n%s\tState: %s\tApp_context: %ld\n%s\tLocale: %s\n%s\tBinding: %s", tmp, pfx2,
orte_proc_state_to_str(src->state), (long)src->app_idx, pfx2, locale, pfx2, bind);
} else {
strcpy(bind, "UNBOUND");
}
#else
asprintf(&tmp2, "%s\n%s\tState: %s\tApp_context: %ld", tmp, pfx2,
orte_proc_state_to_str(src->state), (long)src->app_idx);
#endif
asprintf(&tmp2, "%s\n%s\tState: %s\tApp_context: %ld\n%s\tLocale: %s\n%s\tBinding: %s", tmp, pfx2,
orte_proc_state_to_str(src->state), (long)src->app_idx, pfx2, locale, pfx2, bind);
free(tmp);
/* set the return */
@ -687,7 +669,6 @@ int orte_dt_print_map(char **output, char *prefix, orte_job_map_t *src, opal_dat
asprintf(&pfx, "%s\t", pfx2);
if (orte_devel_level_output) {
#if OPAL_HAVE_HWLOC
asprintf(&tmp, "\n%sMapper requested: %s Last mapper: %s Mapping policy: %s Ranking policy: %s\n%sBinding policy: %s Cpu set: %s PPR: %s Cpus-per-rank: %d",
pfx2, (NULL == src->req_mapper) ? "NULL" : src->req_mapper,
(NULL == src->last_mapper) ? "NULL" : src->last_mapper,
@ -697,15 +678,6 @@ int orte_dt_print_map(char **output, char *prefix, orte_job_map_t *src, opal_dat
(NULL == opal_hwloc_base_cpu_set) ? "NULL" : opal_hwloc_base_cpu_set,
(NULL == src->ppr) ? "NULL" : src->ppr,
(int)src->cpus_per_rank);
#else
asprintf(&tmp, "\n%sMapper requested: %s Last mapper: %s Mapping policy: %s Ranking policy: %s PPR: %s Cpus-per-rank: %d",
pfx2, (NULL == src->req_mapper) ? "NULL" : src->req_mapper,
(NULL == src->last_mapper) ? "NULL" : src->last_mapper,
orte_rmaps_base_print_mapping(src->mapping),
orte_rmaps_base_print_ranking(src->ranking),
(NULL == src->ppr) ? "NULL" : src->ppr,
(int)src->cpus_per_rank);
#endif
if (ORTE_VPID_INVALID == src->daemon_vpid_start) {
asprintf(&tmp2, "%s\n%sNum new daemons: %ld\tNew daemon starting vpid INVALID\n%sNum nodes: %ld",

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -626,14 +626,12 @@ int orte_dt_unpack_map(opal_buffer_t *buffer, void *dest,
ORTE_ERROR_LOG(rc);
return rc;
}
#if OPAL_HAVE_HWLOC
n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer,
&(maps[i]->binding), &n, OPAL_BINDING_POLICY))) {
ORTE_ERROR_LOG(rc);
return rc;
}
#endif
/* unpack the ppr */
n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer,

Просмотреть файл

@ -755,10 +755,7 @@ static void orte_node_construct(orte_node_t* node)
node->slots = 0;
node->slots_inuse = 0;
node->slots_max = 0;
#if OPAL_HAVE_HWLOC
node->topology = NULL;
#endif
node->flags = 0;
OBJ_CONSTRUCT(&node->attributes, opal_list_t);
@ -845,9 +842,7 @@ static void orte_job_map_construct(orte_job_map_t* map)
map->last_mapper = NULL;
map->mapping = 0;
map->ranking = 0;
#if OPAL_HAVE_HWLOC
map->binding = 0;
#endif
map->ppr = NULL;
map->cpus_per_rank = 1;
map->display_map = false;
@ -911,7 +906,6 @@ OBJ_CLASS_INSTANCE(orte_attribute_t,
opal_list_item_t,
orte_attr_cons, orte_attr_des);
#if OPAL_HAVE_HWLOC
static void tcon(orte_topology_t *t)
{
t->topo = NULL;
@ -929,4 +923,3 @@ static void tdes(orte_topology_t *t)
OBJ_CLASS_INSTANCE(orte_topology_t,
opal_object_t,
tcon, tdes);
#endif

Просмотреть файл

@ -72,13 +72,11 @@ ORTE_DECLSPEC extern bool orte_proc_is_bound; /* instantiated in orte/runtime/o
ORTE_DECLSPEC extern int orte_progress_thread_debug; /* instantiated in orte/runtime/orte_init.c */
#if OPAL_HAVE_HWLOC
/**
* Global indicating where this process was bound to at launch (will
* be NULL if !orte_proc_is_bound)
*/
OPAL_DECLSPEC extern hwloc_cpuset_t orte_proc_applied_binding; /* instantiated in orte/runtime/orte_init.c */
#endif
/* Shortcut for some commonly used names */
@ -292,10 +290,8 @@ typedef struct {
specified limit. For example, if we have two processors, we
may want to allow up to four processes but no more. */
orte_std_cntr_t slots_max;
#if OPAL_HAVE_HWLOC
/* system topology for this node */
hwloc_topology_t topology;
#endif
/* flags */
orte_node_flags_t flags;
/* list of orte_attribute_t */
@ -408,7 +404,6 @@ struct orte_proc_t {
typedef struct orte_proc_t orte_proc_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_proc_t);
#if OPAL_HAVE_HWLOC
/* define an object for storing node topologies */
typedef struct {
opal_object_t super;
@ -416,7 +411,6 @@ typedef struct {
char *sig;
} orte_topology_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_topology_t);
#endif
/**
* Get a job data object

Просмотреть файл

@ -123,9 +123,7 @@ opal_event_base_t *orte_event_base = {0};
bool orte_event_base_active = true;
bool orte_proc_is_bound = false;
int orte_progress_thread_debug = -1;
#if OPAL_HAVE_HWLOC
hwloc_cpuset_t orte_proc_applied_binding = NULL;
#endif
orte_process_name_t orte_name_wildcard = {ORTE_JOBID_WILDCARD, ORTE_VPID_WILDCARD};
@ -246,9 +244,7 @@ int orte_init(int* pargc, char*** pargv, orte_proc_type_t flags)
opal_process_info.proc_session_dir = orte_process_info.proc_session_dir;
opal_process_info.num_local_peers = (int32_t)orte_process_info.num_local_peers;
opal_process_info.my_local_rank = (int32_t)orte_process_info.my_local_rank;
#if OPAL_HAVE_HWLOC
opal_process_info.cpuset = orte_process_info.cpuset;
#endif /* OPAL_HAVE_HWLOC */
#if OPAL_ENABLE_TIMING
opal_timing_set_jobid(ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));

Просмотреть файл

@ -13,7 +13,7 @@
* Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -468,14 +468,12 @@ int orte_register_params(void)
orte_hetero_apps = OPAL_INT_TO_BOOL(value);
#endif
#if OPAL_HAVE_HWLOC
orte_hetero_nodes = false;
(void) mca_base_var_register ("orte", "orte", NULL, "hetero_nodes",
"Nodes in cluster may differ in topology, so send the topology back from each node [Default = false]",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
&orte_hetero_nodes);
#endif
/* allow specification of the launch agent */
orte_launch_agent = "orted";
@ -665,7 +663,6 @@ int orte_register_params(void)
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
&orte_max_vm_size);
#if OPAL_HAVE_HWLOC
if (opal_hwloc_use_hwthreads_as_cpus) {
orte_set_slots = "hwthreads";
} else {
@ -679,9 +676,6 @@ int orte_register_params(void)
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
&orte_set_slots);
#else
orte_set_slots = NULL;
#endif
/* should we display the allocation after determining it? */
orte_display_allocation = false;

Просмотреть файл

@ -241,7 +241,6 @@ static opal_cmd_line_init_t cmd_line_init[] = {
&myglobals.npernode, OPAL_CMD_LINE_TYPE_INT,
"Launch n processes per node on all allocated nodes (synonym for npernode)" },
#if OPAL_HAVE_HWLOC
/* declare hardware threads as independent cpus */
{ NULL, '\0', "use-hwthread-cpus", "use-hwthread-cpus", 0,
&myglobals.use_hwthreads_as_cpus, OPAL_CMD_LINE_TYPE_BOOL,
@ -276,18 +275,6 @@ static opal_cmd_line_init_t cmd_line_init[] = {
&myglobals.slot_list, OPAL_CMD_LINE_TYPE_STRING,
"List of processor IDs to bind processes to [default=NULL]"},
#else
/* Mapping options */
{ NULL, '\0', NULL, "map-by", 1,
&myglobals.mapping_policy, OPAL_CMD_LINE_TYPE_STRING,
"Mapping Policy [slot (default) | node]" },
/* Ranking options */
{ NULL, '\0', NULL, "rank-by", 1,
&myglobals.ranking_policy, OPAL_CMD_LINE_TYPE_STRING,
"Ranking Policy [slot (default) | node]" },
#endif
/* mpiexec-like arguments */
{ NULL, '\0', "wdir", "wdir", 1,
&myglobals.wdir, OPAL_CMD_LINE_TYPE_STRING,
@ -637,7 +624,6 @@ int main(int argc, char *argv[])
exit(rc);
}
}
#if OPAL_HAVE_HWLOC
if (NULL != myglobals.binding_policy) {
if (ORTE_SUCCESS != (rc = opal_hwloc_base_set_binding_policy(&jdata->map->binding,
myglobals.binding_policy))) {
@ -645,7 +631,6 @@ int main(int argc, char *argv[])
exit(rc);
}
}
#endif /* OPAL_HAVE_HWLOC */
/* if they asked for nolocal, mark it so */
if (myglobals.nolocal) {

Просмотреть файл

@ -358,7 +358,6 @@ static opal_cmd_line_init_t cmd_line_init[] = {
NULL, OPAL_CMD_LINE_TYPE_INT,
"Launch n processes per node on all allocated nodes (synonym for npernode)" },
#if OPAL_HAVE_HWLOC
/* declare hardware threads as independent cpus */
{ "hwloc_base_use_hwthreads_as_cpus", '\0', "use-hwthread-cpus", "use-hwthread-cpus", 0,
NULL, OPAL_CMD_LINE_TYPE_BOOL,
@ -405,17 +404,6 @@ static opal_cmd_line_init_t cmd_line_init[] = {
{ "rmaps_ppr_pattern", '\0', NULL, "ppr", 1,
NULL, OPAL_CMD_LINE_TYPE_STRING,
"Comma-separated list of number of processes on a given resource type [default: none]" },
#else
/* Mapping options */
{ "rmaps_base_mapping_policy", '\0', NULL, "map-by", 1,
NULL, OPAL_CMD_LINE_TYPE_STRING,
"Mapping Policy [slot (default) | node]" },
/* Ranking options */
{ "rmaps_base_ranking_policy", '\0', NULL, "rank-by", 1,
NULL, OPAL_CMD_LINE_TYPE_STRING,
"Ranking Policy [slot (default) | node]" },
#endif
/* Allocation options */
{ "orte_display_alloc", '\0', "display-allocation", "display-allocation", 0,
@ -424,11 +412,9 @@ static opal_cmd_line_init_t cmd_line_init[] = {
{ "orte_display_devel_alloc", '\0', "display-devel-allocation", "display-devel-allocation", 0,
NULL, OPAL_CMD_LINE_TYPE_BOOL,
"Display a detailed list (mostly intended for developers) of the allocation being used by this job"},
#if OPAL_HAVE_HWLOC
{ "hwloc_base_cpu_set", '\0', "cpu-set", "cpu-set", 1,
NULL, OPAL_CMD_LINE_TYPE_STRING,
"Comma-separated list of ranges specifying logical cpus allocated to this job [default: none]"},
#endif
{ NULL, 'H', "host", "host", 1,
NULL, OPAL_CMD_LINE_TYPE_STRING,
"List of hosts to invoke processes on" },
@ -509,11 +495,9 @@ static opal_cmd_line_init_t cmd_line_init[] = {
NULL, OPAL_CMD_LINE_TYPE_INT,
"Max number of times to restart a failed process" },
#if OPAL_HAVE_HWLOC
{ "orte_hetero_nodes", '\0', NULL, "hetero-nodes", 0,
NULL, OPAL_CMD_LINE_TYPE_BOOL,
"Nodes in cluster may differ in topology, so send the topology back from each node [Default = false]" },
#endif
#if OPAL_ENABLE_CRDEBUG == 1
{ "opal_cr_enable_crdebug", '\0', "crdebug", "crdebug", 0,

Просмотреть файл

@ -85,9 +85,7 @@ ORTE_DECLSPEC orte_proc_info_t orte_process_info = {
.sock_stdin = NULL,
.sock_stdout = NULL,
.sock_stderr = NULL,
#if OPAL_HAVE_HWLOC
.cpuset = NULL,
#endif
.app_rank = -1,
.my_hostid = ORTE_VPID_INVALID
};

Просмотреть файл

@ -126,9 +126,7 @@ struct orte_proc_info_t {
char *sock_stdin; /**< Path name to temp file for stdin. */
char *sock_stdout; /**< Path name to temp file for stdout. */
char *sock_stderr; /**< Path name to temp file for stderr. */
#if OPAL_HAVE_HWLOC
char *cpuset; /**< String-representation of bitmap where we are bound */
#endif
int app_rank; /**< rank within my app_context */
orte_vpid_t my_hostid; /** identifies the local host for a coprocessor */
};

Просмотреть файл

@ -241,7 +241,7 @@ void oshmem_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) {