From 1a34224948cc7f377777b8b1a6b44d7e105779d1 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 20 Jul 2017 17:39:16 +0900 Subject: [PATCH 1/4] hwloc: do not set the HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM flag Signed-off-by: Gilles Gouaillardet --- opal/mca/hwloc/base/hwloc_base_dt.c | 1 - opal/mca/hwloc/base/hwloc_base_util.c | 4 +--- orte/mca/ess/singleton/ess_singleton_module.c | 2 +- orte/test/system/opal_hwloc.c | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/opal/mca/hwloc/base/hwloc_base_dt.c b/opal/mca/hwloc/base/hwloc_base_dt.c index 10ab99688ae..200ac90c0a8 100644 --- a/opal/mca/hwloc/base/hwloc_base_dt.c +++ b/opal/mca/hwloc/base/hwloc_base_dt.c @@ -107,7 +107,6 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest, * explicitly set a flag so hwloc sets things up correctly */ if (0 != hwloc_topology_set_flags(t, (HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM | - HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM | HWLOC_TOPOLOGY_FLAG_IO_DEVICES))) { rc = OPAL_ERROR; hwloc_topology_destroy(t); diff --git a/opal/mca/hwloc/base/hwloc_base_util.c b/opal/mca/hwloc/base/hwloc_base_util.c index cd75ce61118..3f1dfc0dc13 100644 --- a/opal/mca/hwloc/base/hwloc_base_util.c +++ b/opal/mca/hwloc/base/hwloc_base_util.c @@ -305,8 +305,7 @@ int opal_hwloc_base_get_topology(void) } else if (NULL == opal_hwloc_base_topo_file) { if (0 != hwloc_topology_init(&opal_hwloc_topology) || 0 != hwloc_topology_set_flags(opal_hwloc_topology, - (HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM | - HWLOC_TOPOLOGY_FLAG_IO_DEVICES)) || + HWLOC_TOPOLOGY_FLAG_IO_DEVICES) || 0 != hwloc_topology_load(opal_hwloc_topology)) { return OPAL_ERR_NOT_SUPPORTED; } @@ -356,7 +355,6 @@ int opal_hwloc_base_set_topology(char *topofile) */ if (0 != hwloc_topology_set_flags(opal_hwloc_topology, (HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM | - HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM | HWLOC_TOPOLOGY_FLAG_IO_DEVICES))) { hwloc_topology_destroy(opal_hwloc_topology); return OPAL_ERR_NOT_SUPPORTED; diff --git a/orte/mca/ess/singleton/ess_singleton_module.c b/orte/mca/ess/singleton/ess_singleton_module.c index 78cf662e68b..e3e2fc81bd6 100644 --- a/orte/mca/ess/singleton/ess_singleton_module.c +++ b/orte/mca/ess/singleton/ess_singleton_module.c @@ -15,7 +15,7 @@ * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2016 Research Organization for Information Science + * Copyright (c) 2016-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * diff --git a/orte/test/system/opal_hwloc.c b/orte/test/system/opal_hwloc.c index f07cbf2bf3e..ae2f7f5b40f 100644 --- a/orte/test/system/opal_hwloc.c +++ b/orte/test/system/opal_hwloc.c @@ -74,7 +74,6 @@ int main(int argc, char* argv[]) */ if (0 != hwloc_topology_set_flags(my_topology, (HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM | - HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM | HWLOC_TOPOLOGY_FLAG_IO_DEVICES))) { hwloc_topology_destroy(my_topology); return OPAL_ERR_NOT_SUPPORTED; From 9f29f3bff4464633550c914d836688a7b0db45aa Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 19 Jul 2017 15:23:52 +0900 Subject: [PATCH 2/4] hwloc: since WHOLE_SYSTEM is no more used, remove useless checks related to offline and disallowed elements Signed-off-by: Gilles Gouaillardet --- ompi/mpiext/affinity/c/mpiext_affinity_str.c | 4 +- opal/mca/btl/smcuda/btl_smcuda.c | 9 +- opal/mca/hwloc/base/base.h | 7 +- opal/mca/hwloc/base/hwloc_base_dt.c | 17 -- opal/mca/hwloc/base/hwloc_base_util.c | 256 ++----------------- orte/mca/ess/base/ess_base_fns.c | 11 +- orte/mca/plm/base/plm_base_launch_support.c | 2 - orte/mca/ras/simulator/ras_sim_module.c | 9 +- orte/mca/rmaps/base/rmaps_base_binding.c | 14 +- orte/mca/rmaps/ppr/rmaps_ppr.c | 13 +- orte/orted/orted_main.c | 8 +- 11 files changed, 48 insertions(+), 302 deletions(-) diff --git a/ompi/mpiext/affinity/c/mpiext_affinity_str.c b/ompi/mpiext/affinity/c/mpiext_affinity_str.c index bc6412da665..9ea81fce4aa 100644 --- a/ompi/mpiext/affinity/c/mpiext_affinity_str.c +++ b/ompi/mpiext/affinity/c/mpiext_affinity_str.c @@ -131,7 +131,7 @@ static int get_rsrc_current_binding(char str[OMPI_AFFINITY_STRING_MAX]) /* get our root object */ root = hwloc_get_root_obj(opal_hwloc_topology); - rootset = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, root); + rootset = root->cpuset; /* get our bindings */ boundset = hwloc_bitmap_alloc(); @@ -324,7 +324,7 @@ static int get_layout_current_binding(char str[OMPI_AFFINITY_STRING_MAX]) /* get our root object */ root = hwloc_get_root_obj(opal_hwloc_topology); - rootset = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, root); + rootset = root->cpuset; /* get our bindings */ boundset = hwloc_bitmap_alloc(); diff --git a/opal/mca/btl/smcuda/btl_smcuda.c b/opal/mca/btl/smcuda/btl_smcuda.c index 086f776e66e..03d3a6a116a 100644 --- a/opal/mca/btl/smcuda/btl_smcuda.c +++ b/opal/mca/btl/smcuda/btl_smcuda.c @@ -16,7 +16,7 @@ * reserved. * Copyright (c) 2012-2015 NVIDIA Corporation. All rights reserved. * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ @@ -296,7 +296,6 @@ smcuda_btl_first_time_init(mca_btl_smcuda_t *smcuda_btl, num_mem_nodes > 0 && NULL != opal_process_info.cpuset) { int numa=0, w; unsigned n_bound=0; - hwloc_cpuset_t avail; hwloc_obj_t obj; /* count the number of NUMA nodes to which we are bound */ @@ -306,10 +305,8 @@ smcuda_btl_first_time_init(mca_btl_smcuda_t *smcuda_btl, OPAL_HWLOC_AVAILABLE))) { continue; } - /* get that NUMA node's available cpus */ - avail = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, obj); - /* see if we intersect */ - if (hwloc_bitmap_intersects(avail, opal_hwloc_my_cpuset)) { + /* see if we intersect with that NUMA node's cpus */ + if (hwloc_bitmap_intersects(obj->cpuset, opal_hwloc_my_cpuset)) { n_bound++; numa = w; } diff --git a/opal/mca/hwloc/base/base.h b/opal/mca/hwloc/base/base.h index 0a9c482a743..2f3ab8c5e71 100644 --- a/opal/mca/hwloc/base/base.h +++ b/opal/mca/hwloc/base/base.h @@ -1,6 +1,8 @@ /* * Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -132,9 +134,6 @@ typedef enum { */ OPAL_DECLSPEC extern opal_hwloc_base_mbfa_t opal_hwloc_base_mbfa; -/* some critical helper functions */ -OPAL_DECLSPEC int opal_hwloc_base_filter_cpus(hwloc_topology_t topo); - /** * Discover / load the hwloc topology (i.e., call hwloc_topology_init() and * hwloc_topology_load()). @@ -150,8 +149,6 @@ OPAL_DECLSPEC int opal_hwloc_base_set_topology(char *topofile); * Free the hwloc topology. */ OPAL_DECLSPEC void opal_hwloc_base_free_topology(hwloc_topology_t topo); -OPAL_DECLSPEC hwloc_cpuset_t opal_hwloc_base_get_available_cpus(hwloc_topology_t topo, - hwloc_obj_t obj); OPAL_DECLSPEC unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo, hwloc_obj_type_t target, unsigned cache_level, diff --git a/opal/mca/hwloc/base/hwloc_base_dt.c b/opal/mca/hwloc/base/hwloc_base_dt.c index 200ac90c0a8..4f680788ec9 100644 --- a/opal/mca/hwloc/base/hwloc_base_dt.c +++ b/opal/mca/hwloc/base/hwloc_base_dt.c @@ -136,11 +136,6 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest, goto cleanup; } - /* filter the cpus thru any default cpu set */ - if (OPAL_SUCCESS != (rc = opal_hwloc_base_filter_cpus(t))) { - goto cleanup; - } - /* pass it back */ tarray[i] = t; @@ -268,18 +263,6 @@ static void print_hwloc_obj(char **output, char *prefix, free(tmp); tmp = tmp2; } - if (NULL != obj->online_cpuset) { - hwloc_bitmap_snprintf(string, OPAL_HWLOC_MAX_STRING, obj->online_cpuset); - asprintf(&tmp2, "%s%sOnline: %s", tmp, pfx, string); - free(tmp); - tmp = tmp2; - } - if (NULL != obj->allowed_cpuset) { - hwloc_bitmap_snprintf(string, OPAL_HWLOC_MAX_STRING, obj->allowed_cpuset); - asprintf(&tmp2, "%s%sAllowed: %s", tmp, pfx, string); - free(tmp); - tmp = tmp2; - } if (HWLOC_OBJ_MACHINE == obj->type) { /* root level object - add support values */ support = (struct hwloc_topology_support*)hwloc_topology_get_support(topo); diff --git a/opal/mca/hwloc/base/hwloc_base_util.c b/opal/mca/hwloc/base/hwloc_base_util.c index 3f1dfc0dc13..0c23af43f34 100644 --- a/opal/mca/hwloc/base/hwloc_base_util.c +++ b/opal/mca/hwloc/base/hwloc_base_util.c @@ -110,100 +110,6 @@ hwloc_obj_t opal_hwloc_base_get_pu(hwloc_topology_t topo, return obj; } -/* determine the node-level available cpuset based on - * online vs allowed vs user-specified cpus - */ -int opal_hwloc_base_filter_cpus(hwloc_topology_t topo) -{ - hwloc_obj_t root, pu; - hwloc_cpuset_t avail = NULL, pucpus, res; - opal_hwloc_topo_data_t *sum; - opal_hwloc_obj_data_t *data; - char **ranges=NULL, **range=NULL; - int idx, cpu, start, end; - - root = hwloc_get_root_obj(topo); - - if (NULL == root->userdata) { - root->userdata = (void*)OBJ_NEW(opal_hwloc_topo_data_t); - } - sum = (opal_hwloc_topo_data_t*)root->userdata; - - /* should only ever enter here once, but check anyway */ - if (NULL != sum->available) { - return OPAL_SUCCESS; - } - - /* process any specified default cpu set against this topology */ - if (NULL == opal_hwloc_base_cpu_list) { - /* get the root available cpuset */ - avail = hwloc_bitmap_alloc(); - hwloc_bitmap_and(avail, root->online_cpuset, root->allowed_cpuset); - OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, - "hwloc:base: no cpus specified - using root available cpuset")); - } else { - OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, - "hwloc:base: filtering cpuset")); - /* find the specified logical cpus */ - ranges = opal_argv_split(opal_hwloc_base_cpu_list, ','); - avail = hwloc_bitmap_alloc(); - hwloc_bitmap_zero(avail); - res = hwloc_bitmap_alloc(); - pucpus = hwloc_bitmap_alloc(); - for (idx=0; idx < opal_argv_count(ranges); idx++) { - range = opal_argv_split(ranges[idx], '-'); - switch (opal_argv_count(range)) { - case 1: - /* only one cpu given - get that object */ - cpu = strtoul(range[0], NULL, 10); - if (NULL != (pu = opal_hwloc_base_get_pu(topo, cpu, OPAL_HWLOC_LOGICAL))) { - hwloc_bitmap_and(pucpus, pu->online_cpuset, pu->allowed_cpuset); - hwloc_bitmap_or(res, avail, pucpus); - hwloc_bitmap_copy(avail, res); - data = (opal_hwloc_obj_data_t*)pu->userdata; - if (NULL == data) { - pu->userdata = (void*)OBJ_NEW(opal_hwloc_obj_data_t); - data = (opal_hwloc_obj_data_t*)pu->userdata; - } - data->npus++; - } - break; - case 2: - /* range given */ - start = strtoul(range[0], NULL, 10); - end = strtoul(range[1], NULL, 10); - for (cpu=start; cpu <= end; cpu++) { - if (NULL != (pu = opal_hwloc_base_get_pu(topo, cpu, OPAL_HWLOC_LOGICAL))) { - hwloc_bitmap_and(pucpus, pu->online_cpuset, pu->allowed_cpuset); - hwloc_bitmap_or(res, avail, pucpus); - hwloc_bitmap_copy(avail, res); - data = (opal_hwloc_obj_data_t*)pu->userdata; - if (NULL == data) { - pu->userdata = (void*)OBJ_NEW(opal_hwloc_obj_data_t); - data = (opal_hwloc_obj_data_t*)pu->userdata; - } - data->npus++; - } - } - break; - default: - break; - } - opal_argv_free(range); - } - if (NULL != ranges) { - opal_argv_free(ranges); - } - hwloc_bitmap_free(res); - hwloc_bitmap_free(pucpus); - } - - /* cache this info */ - sum->available = avail; - - return OPAL_SUCCESS; -} - static void fill_cache_line_size(void) { int i = 0, cache_level = 2; @@ -297,11 +203,6 @@ int opal_hwloc_base_get_topology(void) return OPAL_ERROR; } free(val); - /* filter the cpus thru any default cpu set */ - if (OPAL_SUCCESS != (rc = opal_hwloc_base_filter_cpus(opal_hwloc_topology))) { - hwloc_topology_destroy(opal_hwloc_topology); - return rc; - } } else if (NULL == opal_hwloc_base_topo_file) { if (0 != hwloc_topology_init(&opal_hwloc_topology) || 0 != hwloc_topology_set_flags(opal_hwloc_topology, @@ -309,9 +210,6 @@ int opal_hwloc_base_get_topology(void) 0 != hwloc_topology_load(opal_hwloc_topology)) { return OPAL_ERR_NOT_SUPPORTED; } - if (OPAL_SUCCESS != (rc = opal_hwloc_base_filter_cpus(opal_hwloc_topology))) { - return rc; - } } else { if (OPAL_SUCCESS != (rc = opal_hwloc_base_set_topology(opal_hwloc_base_topo_file))) { return rc; @@ -333,7 +231,6 @@ int opal_hwloc_base_get_topology(void) int opal_hwloc_base_set_topology(char *topofile) { struct hwloc_topology_support *support; - int rc; OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, "hwloc:base:set_topology %s", topofile)); @@ -375,12 +272,6 @@ int opal_hwloc_base_set_topology(char *topofile) support->cpubind->set_thisproc_cpubind = true; support->membind->set_thisproc_membind = true; - /* filter the cpus thru any default cpu set */ - rc = opal_hwloc_base_filter_cpus(opal_hwloc_topology); - if (OPAL_SUCCESS != rc) { - return rc; - } - /* fill opal_cache_line_size global with the smallest L1 cache line size */ fill_cache_line_size(); @@ -432,7 +323,6 @@ void opal_hwloc_base_free_topology(hwloc_topology_t topo) void opal_hwloc_base_get_local_cpuset(void) { hwloc_obj_t root; - hwloc_cpuset_t base_cpus; if (NULL != opal_hwloc_topology) { if (NULL == opal_hwloc_my_cpuset) { @@ -445,8 +335,7 @@ void opal_hwloc_base_get_local_cpuset(void) HWLOC_CPUBIND_PROCESS) < 0) { /* we are not bound - use the root's available cpuset */ root = hwloc_get_root_obj(opal_hwloc_topology); - base_cpus = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, root); - hwloc_bitmap_copy(opal_hwloc_my_cpuset, base_cpus); + hwloc_bitmap_copy(opal_hwloc_my_cpuset, root->cpuset); } } } @@ -474,72 +363,6 @@ int opal_hwloc_base_report_bind_failure(const char *file, return OPAL_SUCCESS; } -hwloc_cpuset_t opal_hwloc_base_get_available_cpus(hwloc_topology_t topo, - hwloc_obj_t obj) -{ - hwloc_obj_t root; - hwloc_cpuset_t avail, specd=NULL; - opal_hwloc_topo_data_t *rdata; - opal_hwloc_obj_data_t *data; - - OPAL_OUTPUT_VERBOSE((10, opal_hwloc_base_framework.framework_output, - "hwloc:base: get available cpus")); - - /* get the node-level information */ - root = hwloc_get_root_obj(topo); - rdata = (opal_hwloc_topo_data_t*)root->userdata; - /* bozo check */ - if (NULL == rdata) { - rdata = OBJ_NEW(opal_hwloc_topo_data_t); - root->userdata = (void*)rdata; - OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, - "hwloc:base:get_available_cpus first time - filtering cpus")); - } - - /* are we asking about the root object? */ - if (obj == root) { - OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, - "hwloc:base:get_available_cpus root object")); - return rdata->available; - } - - /* some hwloc object types don't have cpus */ - if (NULL == obj->online_cpuset || NULL == obj->allowed_cpuset) { - return NULL; - } - - /* see if we already have this info */ - if (NULL == (data = (opal_hwloc_obj_data_t*)obj->userdata)) { - /* nope - create the object */ - data = OBJ_NEW(opal_hwloc_obj_data_t); - obj->userdata = (void*)data; - } - - /* do we have the cpuset */ - if (NULL != data->available) { - return data->available; - } - - /* find the available processors on this object */ - avail = hwloc_bitmap_alloc(); - hwloc_bitmap_and(avail, obj->online_cpuset, obj->allowed_cpuset); - - /* filter this against the node-available processors */ - if (NULL == rdata->available) { - hwloc_bitmap_free(avail); - return NULL; - } - specd = hwloc_bitmap_alloc(); - hwloc_bitmap_and(specd, avail, rdata->available); - - /* cache the info */ - data->available = specd; - - /* cleanup */ - hwloc_bitmap_free(avail); - return specd; -} - static void df_search_cores(hwloc_obj_t obj, unsigned int *cnt) { unsigned k; @@ -552,13 +375,6 @@ static void df_search_cores(hwloc_obj_t obj, unsigned int *cnt) obj->userdata = (void*)data; } if (NULL == opal_hwloc_base_cpu_list) { - if (!hwloc_bitmap_intersects(obj->cpuset, obj->allowed_cpuset)) { - /* - * do not count not allowed cores (e.g. cores with zero allowed PU) - * if SMT is enabled, do count cores with at least one allowed hwthread - */ - return; - } data->npus = 1; } *cnt += data->npus; @@ -605,7 +421,6 @@ unsigned int opal_hwloc_base_get_npus(hwloc_topology_t topo, { opal_hwloc_obj_data_t *data; unsigned int cnt = 0; - hwloc_cpuset_t cpuset; data = (opal_hwloc_obj_data_t*)obj->userdata; if (NULL == data || !data->npus_calculated) { @@ -629,12 +444,13 @@ unsigned int opal_hwloc_base_get_npus(hwloc_topology_t topo, df_search_cores(obj, &cnt); } } else { + hwloc_cpuset_t cpuset; /* if we are treating cores as cpus, or the system can't detect * "cores", then get the available cpuset for this object - this will * create and store the data */ - if (NULL == (cpuset = opal_hwloc_base_get_available_cpus(topo, obj))) { + if (NULL == (cpuset = obj->cpuset)) { return 0; } /* count the number of bits that are set - there is @@ -795,7 +611,7 @@ static hwloc_obj_t df_search(hwloc_topology_t topo, } /* see if we already know our available cpuset */ if (NULL == data->available) { - data->available = opal_hwloc_base_get_available_cpus(topo, start); + data->available = hwloc_bitmap_dup(start->cpuset); } if (NULL != data->available && !hwloc_bitmap_iszero(data->available)) { if (NULL != num_objs) { @@ -1092,7 +908,6 @@ static int socket_to_cpu_set(char *cpus, int lower_range, upper_range; int socket_id; hwloc_obj_t obj; - hwloc_bitmap_t res; if ('*' == cpus[0]) { /* requesting cpumask for ALL sockets */ @@ -1100,8 +915,7 @@ static int socket_to_cpu_set(char *cpus, /* set to all available processors - essentially, * this specification equates to unbound */ - res = opal_hwloc_base_get_available_cpus(topo, obj); - hwloc_bitmap_or(cpumask, cpumask, res); + hwloc_bitmap_or(cpumask, cpumask, obj->cpuset); return OPAL_SUCCESS; } @@ -1112,8 +926,7 @@ static int socket_to_cpu_set(char *cpus, socket_id = atoi(range[0]); obj = opal_hwloc_base_get_obj_by_type(topo, HWLOC_OBJ_SOCKET, 0, socket_id, rtype); /* get the available cpus for this socket */ - res = opal_hwloc_base_get_available_cpus(topo, obj); - hwloc_bitmap_or(cpumask, cpumask, res); + hwloc_bitmap_or(cpumask, cpumask, obj->cpuset); break; case 2: /* range of sockets was given */ @@ -1122,10 +935,8 @@ static int socket_to_cpu_set(char *cpus, /* cycle across the range of sockets */ for (socket_id=lower_range; socket_id<=upper_range; socket_id++) { obj = opal_hwloc_base_get_obj_by_type(topo, HWLOC_OBJ_SOCKET, 0, socket_id, rtype); - /* get the available cpus for this socket */ - res = opal_hwloc_base_get_available_cpus(topo, obj); - /* set the corresponding bits in the bitmask */ - hwloc_bitmap_or(cpumask, cpumask, res); + /* set the available cpus for this socket bits in the bitmask */ + hwloc_bitmap_or(cpumask, cpumask, obj->cpuset); } break; default: @@ -1149,7 +960,6 @@ static int socket_core_to_cpu_set(char *socket_core_list, int lower_range, upper_range; int socket_id, core_id; hwloc_obj_t socket, core; - hwloc_cpuset_t res; unsigned int idx; hwloc_obj_type_t obj_type = HWLOC_OBJ_CORE; @@ -1179,9 +989,8 @@ static int socket_core_to_cpu_set(char *socket_core_list, corestr = socket_core[i]; } if ('*' == corestr[0]) { - /* set to all available cpus on this socket */ - res = opal_hwloc_base_get_available_cpus(topo, socket); - hwloc_bitmap_or(cpumask, cpumask, res); + /* set to all cpus on this socket */ + hwloc_bitmap_or(cpumask, cpumask, socket->cpuset); /* we are done - already assigned all cores! */ rc = OPAL_SUCCESS; break; @@ -1205,8 +1014,7 @@ static int socket_core_to_cpu_set(char *socket_core_list, return OPAL_ERR_NOT_FOUND; } /* get the cpus */ - res = opal_hwloc_base_get_available_cpus(topo, core); - hwloc_bitmap_or(cpumask, cpumask, res); + hwloc_bitmap_or(cpumask, cpumask, core->cpuset); } opal_argv_free(list); break; @@ -1227,10 +1035,8 @@ static int socket_core_to_cpu_set(char *socket_core_list, opal_argv_free(socket_core); return OPAL_ERR_NOT_FOUND; } - /* get the cpus */ - res = opal_hwloc_base_get_available_cpus(topo, core); - /* add them into the result */ - hwloc_bitmap_or(cpumask, cpumask, res); + /* get the cpus add them into the result */ + hwloc_bitmap_or(cpumask, cpumask, core->cpuset); } break; @@ -1255,7 +1061,6 @@ int opal_hwloc_base_cpu_list_parse(const char *slot_str, char **item, **rngs; int rc, i, j, k; hwloc_obj_t pu; - hwloc_cpuset_t pucpus; char **range, **list; size_t range_cnt; int core_id, lower_range, upper_range; @@ -1349,10 +1154,8 @@ int opal_hwloc_base_cpu_list_parse(const char *slot_str, opal_argv_free(list); return OPAL_ERR_SILENT; } - /* get the available cpus for that object */ - pucpus = opal_hwloc_base_get_available_cpus(topo, pu); - /* set that in the mask */ - hwloc_bitmap_or(cpumask, cpumask, pucpus); + /* get the cpus for that object and set them in the massk*/ + hwloc_bitmap_or(cpumask, cpumask, pu->cpuset); } opal_argv_free(list); break; @@ -1368,10 +1171,8 @@ int opal_hwloc_base_cpu_list_parse(const char *slot_str, opal_argv_free(rngs); return OPAL_ERR_SILENT; } - /* get the available cpus for that object */ - pucpus = opal_hwloc_base_get_available_cpus(topo, pu); - /* set that in the mask */ - hwloc_bitmap_or(cpumask, cpumask, pucpus); + /* get the cpus for that object and set them in the mask*/ + hwloc_bitmap_or(cpumask, cpumask, pu->cpuset); } break; @@ -1396,7 +1197,6 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top opal_hwloc_locality_t locality; hwloc_obj_t obj; unsigned depth, d, width, w; - hwloc_cpuset_t avail; bool shared; hwloc_obj_type_t type; int sect1, sect2; @@ -1444,11 +1244,9 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top for (w=0; w < width; w++) { /* get the object at this depth/index */ obj = hwloc_get_obj_by_depth(topo, d, w); - /* get the available cpuset for this obj */ - avail = opal_hwloc_base_get_available_cpus(topo, obj); - /* see if our locations intersect with it */ - sect1 = hwloc_bitmap_intersects(avail, loc1); - sect2 = hwloc_bitmap_intersects(avail, loc2); + /* see if our locations intersect with the cpuset for this obj */ + sect1 = hwloc_bitmap_intersects(obj->cpuset, loc1); + sect2 = hwloc_bitmap_intersects(obj->cpuset, loc2); /* if both intersect, then we share this level */ if (sect1 && sect2) { shared = true; @@ -1864,9 +1662,7 @@ int opal_hwloc_base_cset2str(char *str, int len, /* if the cpuset includes all available cpus, then we are unbound */ root = hwloc_get_root_obj(topo); - if (NULL == root->userdata) { - opal_hwloc_base_filter_cpus(topo); - } else { + if (NULL != root->userdata) { sum = (opal_hwloc_topo_data_t*)root->userdata; if (NULL == sum->available) { return OPAL_ERROR; @@ -1934,9 +1730,7 @@ int opal_hwloc_base_cset2mapstr(char *str, int len, /* if the cpuset includes all available cpus, then we are unbound */ root = hwloc_get_root_obj(topo); - if (NULL == root->userdata) { - opal_hwloc_base_filter_cpus(topo); - } else { + if (NULL != root->userdata) { sum = (opal_hwloc_topo_data_t*)root->userdata; if (NULL == sum->available) { return OPAL_ERROR; @@ -2201,7 +1995,7 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo, hwloc_obj_t obj; char *locality=NULL, *tmp, *t2; unsigned depth, d, width, w; - hwloc_cpuset_t cpuset, avail, result; + hwloc_cpuset_t cpuset, result; hwloc_obj_type_t type; /* if this proc is not bound, then there is no locality. We @@ -2249,10 +2043,8 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo, for (w=0; w < width; w++) { /* get the object at this depth/index */ obj = hwloc_get_obj_by_depth(topo, d, w); - /* get the available cpuset for this obj */ - avail = opal_hwloc_base_get_available_cpus(topo, obj); /* see if the location intersects with it */ - if (hwloc_bitmap_intersects(avail, cpuset)) { + if (hwloc_bitmap_intersects(obj->cpuset, cpuset)) { hwloc_bitmap_set(result, w); } } diff --git a/orte/mca/ess/base/ess_base_fns.c b/orte/mca/ess/base/ess_base_fns.c index f40814ef5b5..ae29db2874a 100644 --- a/orte/mca/ess/base/ess_base_fns.c +++ b/orte/mca/ess/base/ess_base_fns.c @@ -13,7 +13,7 @@ * Copyright (c) 2011-2012 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -113,7 +113,7 @@ int orte_ess_base_proc_binding(void) support = (struct hwloc_topology_support*)hwloc_topology_get_support(opal_hwloc_topology); /* get our node object */ node = hwloc_get_root_obj(opal_hwloc_topology); - nodeset = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, node); + nodeset = node->cpuset; /* get our bindings */ cpus = hwloc_bitmap_alloc(); if (hwloc_get_cpubind(opal_hwloc_topology, cpus, HWLOC_CPUBIND_PROCESS) < 0) { @@ -191,14 +191,13 @@ int orte_ess_base_proc_binding(void) error = "Getting hwthread object"; goto error; } - cpus = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, obj); + cpus = obj->cpuset; if (0 > hwloc_set_cpubind(opal_hwloc_topology, cpus, 0)) { ret = ORTE_ERROR; error = "Setting processor affinity failed"; goto error; } hwloc_bitmap_list_asprintf(&orte_process_info.cpuset, cpus); - hwloc_bitmap_free(cpus); OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output, "%s Process bound to hwthread", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); @@ -212,7 +211,7 @@ int orte_ess_base_proc_binding(void) error = "Getting core object"; goto error; } - cpus = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, obj); + cpus = obj->cpuset; if (0 > hwloc_set_cpubind(opal_hwloc_topology, cpus, 0)) { error = "Setting processor affinity failed"; ret = ORTE_ERROR; @@ -256,7 +255,7 @@ int orte_ess_base_proc_binding(void) continue; } /* this is the place! */ - cpus = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, obj); + cpus = obj->cpuset; if (0 > hwloc_set_cpubind(opal_hwloc_topology, cpus, 0)) { ret = ORTE_ERROR; error = "Setting processor affinity failed"; diff --git a/orte/mca/plm/base/plm_base_launch_support.c b/orte/mca/plm/base/plm_base_launch_support.c index 1f68cf4dbed..7af4521a24a 100644 --- a/orte/mca/plm/base/plm_base_launch_support.c +++ b/orte/mca/plm/base/plm_base_launch_support.c @@ -944,8 +944,6 @@ void orte_plm_base_daemon_topology(int status, orte_process_name_t* sender, orted_failed_launch = true; goto CLEANUP; } - /* filter the topology as we'll need it that way later */ - opal_hwloc_base_filter_cpus(topo); /* record the final topology */ t->topo = topo; diff --git a/orte/mca/ras/simulator/ras_sim_module.c b/orte/mca/ras/simulator/ras_sim_module.c index fc8f74194e9..9e71040713f 100644 --- a/orte/mca/ras/simulator/ras_sim_module.c +++ b/orte/mca/ras/simulator/ras_sim_module.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2017 Intel, Inc. All rights reserved. * @@ -205,13 +205,6 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes) hwloc_topology_destroy(topo); goto error_silent; } - if (OPAL_SUCCESS != opal_hwloc_base_filter_cpus(topo)) { - orte_show_help("help-ras-simulator.txt", - "hwloc API fail", true, - __FILE__, __LINE__, "opal_hwloc_base_filter_cpus"); - hwloc_topology_destroy(topo); - goto error_silent; - } /* 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 diff --git a/orte/mca/rmaps/base/rmaps_base_binding.c b/orte/mca/rmaps/base/rmaps_base_binding.c index 0de8defa087..a524823e1ae 100644 --- a/orte/mca/rmaps/base/rmaps_base_binding.c +++ b/orte/mca/rmaps/base/rmaps_base_binding.c @@ -13,7 +13,7 @@ * Copyright (c) 2011-2012 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -133,7 +133,6 @@ static int bind_upwards(orte_job_t *jdata, orte_job_map_t *map; orte_proc_t *proc; hwloc_obj_t obj; - hwloc_cpuset_t cpus; unsigned int idx, ncpus; opal_hwloc_obj_data_t *data; hwloc_obj_t locale; @@ -210,8 +209,7 @@ static int bind_upwards(orte_job_t *jdata, } } /* bind it here */ - cpus = opal_hwloc_base_get_available_cpus(node->topology->topo, obj); - hwloc_bitmap_list_asprintf(&cpu_bitmap, cpus); + hwloc_bitmap_list_asprintf(&cpu_bitmap, obj->cpuset); orte_set_attribute(&proc->attributes, ORTE_PROC_CPU_BITMAP, ORTE_ATTR_GLOBAL, cpu_bitmap, OPAL_STRING); /* record the location */ orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_BOUND, ORTE_ATTR_LOCAL, obj, OPAL_PTR); @@ -250,7 +248,6 @@ static int bind_downwards(orte_job_t *jdata, orte_job_map_t *map; orte_proc_t *proc; hwloc_obj_t trg_obj, nxt_obj; - hwloc_cpuset_t cpus; unsigned int ncpus; opal_hwloc_obj_data_t *data; int total_cpus; @@ -344,8 +341,7 @@ static int bind_downwards(orte_job_t *jdata, } } /* bind the proc here */ - cpus = opal_hwloc_base_get_available_cpus(node->topology->topo, trg_obj); - hwloc_bitmap_or(totalcpuset, totalcpuset, cpus); + hwloc_bitmap_or(totalcpuset, totalcpuset, trg_obj->cpuset); /* track total #cpus */ total_cpus += ncpus; /* move to the next location, in case we need it */ @@ -395,7 +391,6 @@ static int bind_in_place(orte_job_t *jdata, orte_job_map_t *map; orte_node_t *node; orte_proc_t *proc; - hwloc_cpuset_t cpus; unsigned int idx, ncpus; struct hwloc_topology_support *support; opal_hwloc_obj_data_t *data; @@ -566,8 +561,7 @@ static int bind_in_place(orte_job_t *jdata, ORTE_NAME_PRINT(&proc->name), hwloc_obj_type_string(locale->type), idx); /* bind the proc here */ - cpus = opal_hwloc_base_get_available_cpus(node->topology->topo, locale); - hwloc_bitmap_list_asprintf(&cpu_bitmap, cpus); + hwloc_bitmap_list_asprintf(&cpu_bitmap, locale->cpuset); orte_set_attribute(&proc->attributes, ORTE_PROC_CPU_BITMAP, ORTE_ATTR_GLOBAL, cpu_bitmap, OPAL_STRING); /* update the location, in case it changed */ orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_BOUND, ORTE_ATTR_LOCAL, locale, OPAL_PTR); diff --git a/orte/mca/rmaps/ppr/rmaps_ppr.c b/orte/mca/rmaps/ppr/rmaps_ppr.c index 6524337dfd3..33495a01437 100644 --- a/orte/mca/rmaps/ppr/rmaps_ppr.c +++ b/orte/mca/rmaps/ppr/rmaps_ppr.c @@ -3,7 +3,7 @@ * Copyright (c) 2011 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -441,7 +441,7 @@ static void prune(orte_jobid_t jobid, hwloc_obj_type_t lvl; unsigned cache_level = 0, k; int nprocs; - hwloc_cpuset_t avail, cpus, childcpus; + hwloc_cpuset_t avail; int n, limit, nmax, nunder, idx, idxmax = 0; orte_proc_t *proc, *pptr, *procmax; opal_hwloc_level_t ll; @@ -492,7 +492,7 @@ static void prune(orte_jobid_t jobid, lvl, cache_level, i, OPAL_HWLOC_AVAILABLE); /* get the available cpuset */ - avail = opal_hwloc_base_get_available_cpus(node->topology->topo, obj); + avail = obj->cpuset; /* look at the intersection of this object's cpuset and that * of each proc in the job/app - if they intersect, then count this proc @@ -512,8 +512,7 @@ static void prune(orte_jobid_t jobid, ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return; } - cpus = opal_hwloc_base_get_available_cpus(node->topology->topo, locale); - if (hwloc_bitmap_intersects(avail, cpus)) { + if (hwloc_bitmap_intersects(avail, locale->cpuset)) { nprocs++; } } @@ -550,7 +549,6 @@ static void prune(orte_jobid_t jobid, /* find the child with the most procs underneath it */ for (k=0; k < top->arity && limit < nprocs; k++) { /* get this object's available cpuset */ - childcpus = opal_hwloc_base_get_available_cpus(node->topology->topo, top->children[k]); nunder = 0; pptr = NULL; for (n=0; n < node->procs->size; n++) { @@ -566,8 +564,7 @@ static void prune(orte_jobid_t jobid, ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return; } - cpus = opal_hwloc_base_get_available_cpus(node->topology->topo, locale); - if (hwloc_bitmap_intersects(childcpus, cpus)) { + if (hwloc_bitmap_intersects(top->children[k]->cpuset, locale->cpuset)) { nunder++; if (NULL == pptr) { /* save the location of the first proc under this object */ diff --git a/orte/orted/orted_main.c b/orte/orted/orted_main.c index 53a271e440f..99af5e76127 100644 --- a/orte/orted/orted_main.c +++ b/orte/orted/orted_main.c @@ -362,7 +362,7 @@ int orte_daemon(int argc, char *argv[]) if (NULL != orte_daemon_cores) { char **cores=NULL, tmp[128]; hwloc_obj_t pu; - hwloc_cpuset_t ours, pucpus, res; + hwloc_cpuset_t ours, res; int core; /* could be a collection of comma-delimited ranges, so @@ -372,7 +372,6 @@ int orte_daemon(int argc, char *argv[]) if (NULL != cores) { ours = hwloc_bitmap_alloc(); hwloc_bitmap_zero(ours); - pucpus = hwloc_bitmap_alloc(); res = hwloc_bitmap_alloc(); for (i=0; NULL != cores[i]; i++) { core = strtoul(cores[i], NULL, 10); @@ -387,12 +386,10 @@ int orte_daemon(int argc, char *argv[]) orte_daemon_cores); ret = ORTE_ERR_NOT_SUPPORTED; hwloc_bitmap_free(ours); - hwloc_bitmap_free(pucpus); hwloc_bitmap_free(res); goto DONE; } - hwloc_bitmap_and(pucpus, pu->online_cpuset, pu->allowed_cpuset); - hwloc_bitmap_or(res, ours, pucpus); + hwloc_bitmap_or(res, ours, pu->cpuset); hwloc_bitmap_copy(ours, res); } /* if the result is all zeros, then don't bind */ @@ -406,7 +403,6 @@ int orte_daemon(int argc, char *argv[]) } /* cleanup */ hwloc_bitmap_free(ours); - hwloc_bitmap_free(pucpus); hwloc_bitmap_free(res); opal_argv_free(cores); } From 60aa9cfcb619ab69dff8079a6bc10221b282c9f4 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 20 Jul 2017 17:39:44 +0900 Subject: [PATCH 3/4] hwloc: add support for hwloc v2 API Signed-off-by: Gilles Gouaillardet --- ompi/mca/topo/treematch/treematch/tm_hwloc.c | 8 + opal/mca/btl/openib/btl_openib_component.c | 6 +- opal/mca/hwloc/base/base.h | 23 +++ opal/mca/hwloc/base/hwloc_base_dt.c | 9 +- opal/mca/hwloc/base/hwloc_base_frame.c | 8 +- opal/mca/hwloc/base/hwloc_base_util.c | 152 ++++++++++++++++--- opal/mca/hwloc/external/configure.m4 | 16 +- orte/mca/ess/base/ess_base_fns.c | 11 +- orte/mca/ras/simulator/ras_sim_module.c | 2 +- orte/mca/rmaps/base/rmaps_base_binding.c | 30 ++-- orte/mca/rmaps/base/rmaps_base_ranking.c | 13 +- orte/mca/rmaps/round_robin/rmaps_rr.c | 30 ++-- orte/orted/pmix/pmix_server.c | 2 +- orte/test/system/opal_hwloc.c | 5 +- 14 files changed, 233 insertions(+), 82 deletions(-) diff --git a/ompi/mca/topo/treematch/treematch/tm_hwloc.c b/ompi/mca/topo/treematch/treematch/tm_hwloc.c index 4a85588cb99..00e279e0cdf 100644 --- a/ompi/mca/topo/treematch/treematch/tm_hwloc.c +++ b/ompi/mca/topo/treematch/treematch/tm_hwloc.c @@ -159,7 +159,11 @@ tm_topology_t* hwloc_to_tm(char *filename,double **pcost) exit(-1); } +#if HWLOC_API_VERSION < 0x20000 hwloc_topology_ignore_all_keep_structure(topology); +#else +#warning FIXME hwloc v2 +#endif hwloc_topology_load(topology); @@ -229,7 +233,11 @@ tm_topology_t* get_local_topo_with_hwloc(void) /* Build the topology */ hwloc_topology_init(&topology); +#if HWLOC_API_VERSION < 0x20000 hwloc_topology_ignore_all_keep_structure(topology); +#else +#warning FIXME hwloc v2 +#endif hwloc_topology_load(topology); /* Test if symetric */ diff --git a/opal/mca/btl/openib/btl_openib_component.c b/opal/mca/btl/openib/btl_openib_component.c index c7cfb834ebc..42e21e666f6 100644 --- a/opal/mca/btl/openib/btl_openib_component.c +++ b/opal/mca/btl/openib/btl_openib_component.c @@ -19,7 +19,7 @@ * Copyright (c) 2011-2015 NVIDIA Corporation. All rights reserved. * Copyright (c) 2012 Oak Ridge National Laboratory. All rights reserved * Copyright (c) 2013-2016 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2014 Bull SAS. All rights reserved. * $COPYRIGHT$ @@ -2331,6 +2331,7 @@ static float get_ib_dev_distance(struct ibv_device *dev) because we have no way of measuring. */ float distance = 0; +#if HWLOC_API_VERSION < 0x20000 /* Override any distance logic so all devices are used */ if (0 != mca_btl_openib_component.ignore_locality || OPAL_SUCCESS != opal_hwloc_base_get_topology()) { @@ -2475,6 +2476,9 @@ static float get_ib_dev_distance(struct ibv_device *dev) if (NULL != my_cpuset) { hwloc_bitmap_free(my_cpuset); } +#else +#warning FIXME get_ib_dev_distance is not implemented with hwloc v2 +#endif return distance; } diff --git a/opal/mca/hwloc/base/base.h b/opal/mca/hwloc/base/base.h index 2f3ab8c5e71..14130348664 100644 --- a/opal/mca/hwloc/base/base.h +++ b/opal/mca/hwloc/base/base.h @@ -19,6 +19,12 @@ #include "opal/mca/hwloc/hwloc-internal.h" +#if HWLOC_API_VERSION < 0x20000 +#define HWLOC_OBJ_L3CACHE HWLOC_OBJ_CACHE +#define HWLOC_OBJ_L2CACHE HWLOC_OBJ_CACHE +#define HWLOC_OBJ_L1CACHE HWLOC_OBJ_CACHE +#endif + /* * Global functions for MCA overall hwloc open and close */ @@ -83,6 +89,20 @@ OPAL_DECLSPEC extern char *opal_hwloc_base_topo_file; hwloc_bitmap_free(bind); \ } while(0); +#if HWLOC_API_VERSION < 0x20000 +#define OPAL_HWLOC_MAKE_OBJ_CACHE(level, obj, cache_level) \ + do { \ + obj = HWLOC_OBJ_CACHE; \ + cache_level = level; \ + } while(0) +#else +#define OPAL_HWLOC_MAKE_OBJ_CACHE(level, obj, cache_level) \ + do { \ + obj = HWLOC_OBJ_L##level##CACHE; \ + cache_level = 0; \ + } while(0) +#endif + OPAL_DECLSPEC opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t topo, char *cpuset1, char *cpuset2); @@ -282,6 +302,9 @@ OPAL_DECLSPEC char* opal_hwloc_base_get_location(char *locality, OPAL_DECLSPEC opal_hwloc_locality_t opal_hwloc_compute_relative_locality(char *loc1, char *loc2); +OPAL_DECLSPEC int opal_hwloc_base_topology_export_xmlbuffer(hwloc_topology_t topology, char **xmlpath, int *buflen); + +OPAL_DECLSPEC int opal_hwloc_base_topology_set_flags (hwloc_topology_t topology, unsigned long flags, bool io); END_C_DECLS #endif /* OPAL_HWLOC_BASE_H */ diff --git a/opal/mca/hwloc/base/hwloc_base_dt.c b/opal/mca/hwloc/base/hwloc_base_dt.c index 4f680788ec9..0840ee13f11 100644 --- a/opal/mca/hwloc/base/hwloc_base_dt.c +++ b/opal/mca/hwloc/base/hwloc_base_dt.c @@ -31,7 +31,7 @@ int opal_hwloc_pack(opal_buffer_t *buffer, const void *src, t = tarray[i]; /* extract an xml-buffer representation of the tree */ - if (0 != hwloc_topology_export_xmlbuffer(t, &xmlbuffer, &len)) { + if (0 != opal_hwloc_base_topology_export_xmlbuffer(t, &xmlbuffer, &len)) { return OPAL_ERROR; } @@ -106,8 +106,7 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest, /* since we are loading this from an external source, we have to * explicitly set a flag so hwloc sets things up correctly */ - if (0 != hwloc_topology_set_flags(t, (HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM | - HWLOC_TOPOLOGY_FLAG_IO_DEVICES))) { + if (0 != opal_hwloc_base_topology_set_flags(t, HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, true)) { rc = OPAL_ERROR; hwloc_topology_destroy(t); goto cleanup; @@ -191,10 +190,10 @@ int opal_hwloc_compare(const hwloc_topology_t topo1, * where we really need to do a tree-wise search so we only compare * the things we care about, and ignore stuff like MAC addresses */ - if (0 != hwloc_topology_export_xmlbuffer(t1, &x1, &l1)) { + if (0 != opal_hwloc_base_topology_export_xmlbuffer(t1, &x1, &l1)) { return OPAL_EQUAL; } - if (0 != hwloc_topology_export_xmlbuffer(t2, &x2, &l2)) { + if (0 != opal_hwloc_base_topology_export_xmlbuffer(t2, &x2, &l2)) { free(x1); return OPAL_EQUAL; } diff --git a/opal/mca/hwloc/base/hwloc_base_frame.c b/opal/mca/hwloc/base/hwloc_base_frame.c index e27985d38eb..538437fb0d9 100644 --- a/opal/mca/hwloc/base/hwloc_base_frame.c +++ b/opal/mca/hwloc/base/hwloc_base_frame.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2016 Research Organization for Information Science + * Copyright (c) 2016-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -50,9 +50,9 @@ hwloc_obj_type_t opal_hwloc_levels[] = { HWLOC_OBJ_MACHINE, HWLOC_OBJ_NODE, HWLOC_OBJ_SOCKET, - HWLOC_OBJ_CACHE, - HWLOC_OBJ_CACHE, - HWLOC_OBJ_CACHE, + HWLOC_OBJ_L3CACHE, + HWLOC_OBJ_L2CACHE, + HWLOC_OBJ_L1CACHE, HWLOC_OBJ_CORE, HWLOC_OBJ_PU }; diff --git a/opal/mca/hwloc/base/hwloc_base_util.c b/opal/mca/hwloc/base/hwloc_base_util.c index 0c23af43f34..4cddabf3c44 100644 --- a/opal/mca/hwloc/base/hwloc_base_util.c +++ b/opal/mca/hwloc/base/hwloc_base_util.c @@ -114,6 +114,7 @@ static void fill_cache_line_size(void) { int i = 0, cache_level = 2; unsigned size; + unsigned int cache_object = HWLOC_OBJ_L2CACHE; hwloc_obj_t obj; bool found = false; @@ -123,10 +124,11 @@ static void fill_cache_line_size(void) i=0; while (1) { obj = opal_hwloc_base_get_obj_by_type(opal_hwloc_topology, - HWLOC_OBJ_CACHE, cache_level, + cache_object, cache_level, i, OPAL_HWLOC_LOGICAL); if (NULL == obj) { --cache_level; + cache_object = HWLOC_OBJ_L1CACHE; break; } else { if (NULL != obj->attr && @@ -188,10 +190,9 @@ int opal_hwloc_base_get_topology(void) /* since we are loading this from an external source, we have to * explicitly set a flag so hwloc sets things up correctly */ - if (0 != hwloc_topology_set_flags(opal_hwloc_topology, - (HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM | - HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM | - HWLOC_TOPOLOGY_FLAG_IO_DEVICES))) { + if (0 != opal_hwloc_base_topology_set_flags(opal_hwloc_topology, + HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, + true)) { hwloc_topology_destroy(opal_hwloc_topology); free(val); return OPAL_ERROR; @@ -205,8 +206,7 @@ int opal_hwloc_base_get_topology(void) free(val); } else if (NULL == opal_hwloc_base_topo_file) { if (0 != hwloc_topology_init(&opal_hwloc_topology) || - 0 != hwloc_topology_set_flags(opal_hwloc_topology, - HWLOC_TOPOLOGY_FLAG_IO_DEVICES) || + 0 != opal_hwloc_base_topology_set_flags(opal_hwloc_topology, 0, true) || 0 != hwloc_topology_load(opal_hwloc_topology)) { return OPAL_ERR_NOT_SUPPORTED; } @@ -250,9 +250,9 @@ int opal_hwloc_base_set_topology(char *topofile) /* since we are loading this from an external source, we have to * explicitly set a flag so hwloc sets things up correctly */ - if (0 != hwloc_topology_set_flags(opal_hwloc_topology, - (HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM | - HWLOC_TOPOLOGY_FLAG_IO_DEVICES))) { + if (0 != opal_hwloc_base_topology_set_flags(opal_hwloc_topology, + HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, + true)) { hwloc_topology_destroy(opal_hwloc_topology); return OPAL_ERR_NOT_SUPPORTED; } @@ -502,10 +502,13 @@ unsigned int opal_hwloc_base_get_obj_idx(hwloc_topology_t topo, return data->idx; } +#if HWLOC_API_VERSION < 0x20000 /* determine the number of objects of this type */ if (HWLOC_OBJ_CACHE == obj->type) { cache_level = obj->attr->cache.depth; } +#endif + nobjs = opal_hwloc_base_get_nbobjs_by_type(topo, obj->type, cache_level, rtype); OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, @@ -555,9 +558,11 @@ static hwloc_obj_t df_search(hwloc_topology_t topo, opal_hwloc_obj_data_t *data; if (target == start->type) { +#if HWLOC_API_VERSION < 0x20000 if (HWLOC_OBJ_CACHE == start->type && cache_level != start->attr->cache.depth) { goto notfound; } +#endif if (OPAL_HWLOC_LOGICAL == rtype) { /* the hwloc tree is composed of LOGICAL objects, so the only * time we come here is when we are looking for logical caches @@ -662,7 +667,11 @@ unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo, * use the hwloc accessor to get it, unless it is a CACHE * as these are treated as special cases */ - if (OPAL_HWLOC_LOGICAL == rtype && HWLOC_OBJ_CACHE != target) { + if (OPAL_HWLOC_LOGICAL == rtype +#if HWLOC_API_VERSION < 0x20000 + && HWLOC_OBJ_CACHE != target +#endif + ) { /* we should not get an error back, but just in case... */ if (0 > (rc = hwloc_get_nbobjs_by_type(topo, target))) { opal_output(0, "UNKNOWN HWLOC ERROR"); @@ -728,9 +737,11 @@ static hwloc_obj_t df_search_min_bound(hwloc_topology_t topo, if (0 == (k = opal_hwloc_base_get_npus(topo, start))) { goto notfound; } +#if HWLOC_API_VERSION < 0x20000 if (HWLOC_OBJ_CACHE == start->type && cache_level != start->attr->cache.depth) { goto notfound; } +#endif /* see how many procs are bound to us */ data = (opal_hwloc_obj_data_t*)start->userdata; if (NULL == data) { @@ -793,10 +804,12 @@ hwloc_obj_t opal_hwloc_base_find_min_bound_target_under_obj(hwloc_topology_t top /* again, we have to treat caches differently as * the levels distinguish them */ +#if HWLOC_API_VERSION < 0x20000 if (HWLOC_OBJ_CACHE == target && cache_level < obj->attr->cache.depth) { goto moveon; } +#endif return obj; } @@ -809,16 +822,17 @@ hwloc_obj_t opal_hwloc_base_find_min_bound_target_under_obj(hwloc_topology_t top loc = df_search_min_bound(topo, obj, target, cache_level, &min_bound); if (NULL != loc) { +#if HWLOC_API_VERSION < 0x20000 if (HWLOC_OBJ_CACHE == target) { OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, "hwloc:base:min_bound_under_obj found min bound of %u on %s:%u:%u", min_bound, hwloc_obj_type_string(target), cache_level, loc->logical_index)); - } else { + } else +#endif OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output, "hwloc:base:min_bound_under_obj found min bound of %u on %s:%u", min_bound, hwloc_obj_type_string(target), loc->logical_index)); - } } return loc; @@ -845,7 +859,11 @@ hwloc_obj_t opal_hwloc_base_get_obj_by_type(hwloc_topology_t topo, * use the hwloc accessor to get it, unless it is a CACHE * as these are treated as special cases */ - if (OPAL_HWLOC_LOGICAL == rtype && HWLOC_OBJ_CACHE != target) { + if (OPAL_HWLOC_LOGICAL == rtype +#if HWLOC_API_VERSION < 0x20000 + && HWLOC_OBJ_CACHE != target +#endif + ) { return hwloc_get_obj_by_type(topo, target, instance); } @@ -1230,7 +1248,13 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top /* if it isn't one of interest, then ignore it */ if (HWLOC_OBJ_NODE != type && HWLOC_OBJ_SOCKET != type && +#if HWLOC_API_VERSION < 0x20000 HWLOC_OBJ_CACHE != type && +#else + HWLOC_OBJ_L3CACHE != type && + HWLOC_OBJ_L2CACHE != type && + HWLOC_OBJ_L1CACHE != type && +#endif HWLOC_OBJ_CORE != type && HWLOC_OBJ_PU != type) { continue; @@ -1257,6 +1281,7 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top case HWLOC_OBJ_SOCKET: locality |= OPAL_PROC_ON_SOCKET; break; +#if HWLOC_API_VERSION < 0x20000 case HWLOC_OBJ_CACHE: if (3 == obj->attr->cache.depth) { locality |= OPAL_PROC_ON_L3CACHE; @@ -1266,6 +1291,17 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top locality |= OPAL_PROC_ON_L1CACHE; } break; +#else + case HWLOC_OBJ_L3CACHE: + locality |= OPAL_PROC_ON_L3CACHE; + break; + case HWLOC_OBJ_L2CACHE: + locality |= OPAL_PROC_ON_L2CACHE; + break; + case HWLOC_OBJ_L1CACHE: + locality |= OPAL_PROC_ON_L1CACHE; + break; +#endif case HWLOC_OBJ_CORE: locality |= OPAL_PROC_ON_CORE; break; @@ -1801,13 +1837,14 @@ static void sort_by_dist(hwloc_topology_t topo, char* device_name, opal_list_t * { hwloc_obj_t device_obj = NULL; hwloc_obj_t obj = NULL, root = NULL; - const struct hwloc_distances_s* distances; + struct hwloc_distances_s* distances; opal_rmaps_numa_node_t *numa_node; int close_node_index; float latency; unsigned int j; int depth; unsigned i; + unsigned distances_nr = 0; for (device_obj = hwloc_get_obj_by_type(topo, HWLOC_OBJ_OS_DEVICE, 0); device_obj; device_obj = hwloc_get_next_osdev(topo, device_obj)) { if (device_obj->attr->osdev.type == HWLOC_OBJ_OSDEV_OPENFABRICS @@ -1828,6 +1865,7 @@ static void sort_by_dist(hwloc_topology_t topo, char* device_name, opal_list_t * } /* find distance matrix for all numa nodes */ +#if HWLOC_API_VERSION < 0x20000 distances = hwloc_get_whole_distance_matrix_by_type(topo, HWLOC_OBJ_NODE); if (NULL == distances) { /* we can try to find distances under group object. This info can be there. */ @@ -1864,6 +1902,22 @@ static void sort_by_dist(hwloc_topology_t topo, char* device_name, opal_list_t * numa_node->dist_from_closed = latency; opal_list_append(sorted_list, &numa_node->super); } +#else + if (0 != hwloc_distances_get_by_type(topo, HWLOC_OBJ_NODE, &distances_nr, &distances, 0, 0) || 0 == distances_nr) { + opal_output_verbose(5, opal_hwloc_base_framework.framework_output, + "hwloc:base:get_sorted_numa_list: There is no information about distances on the node."); + return; + } + /* fill list of numa nodes */ + for (j = 0; j < distances->nbobjs; j++) { + latency = distances->values[close_node_index + distances->nbobjs * j]; + numa_node = OBJ_NEW(opal_rmaps_numa_node_t); + numa_node->index = j; + numa_node->dist_from_closed = latency; + opal_list_append(sorted_list, &numa_node->super); + } + hwloc_distances_release(topo, distances); +#endif /* sort numa nodes by distance from the closest one to PCI */ opal_list_sort(sorted_list, dist_cmp_fn); return; @@ -1956,9 +2010,9 @@ char* opal_hwloc_base_get_topo_signature(hwloc_topology_t topo) nnuma = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_NODE, 0, OPAL_HWLOC_AVAILABLE); nsocket = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_SOCKET, 0, OPAL_HWLOC_AVAILABLE); - nl3 = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_CACHE, 3, OPAL_HWLOC_AVAILABLE); - nl2 = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_CACHE, 2, OPAL_HWLOC_AVAILABLE); - nl1 = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_CACHE, 1, OPAL_HWLOC_AVAILABLE); + nl3 = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_L3CACHE, 3, OPAL_HWLOC_AVAILABLE); + nl2 = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_L2CACHE, 2, OPAL_HWLOC_AVAILABLE); + nl1 = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_L1CACHE, 1, OPAL_HWLOC_AVAILABLE); ncore = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_CORE, 0, OPAL_HWLOC_AVAILABLE); nhwt = opal_hwloc_base_get_nbobjs_by_type(topo, HWLOC_OBJ_PU, 0, OPAL_HWLOC_AVAILABLE); @@ -2025,7 +2079,13 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo, /* if it isn't one of interest, then ignore it */ if (HWLOC_OBJ_NODE != type && HWLOC_OBJ_SOCKET != type && +#if HWLOC_API_VERSION < 0x20000 HWLOC_OBJ_CACHE != type && +#else + HWLOC_OBJ_L1CACHE != type && + HWLOC_OBJ_L2CACHE != type && + HWLOC_OBJ_L3CACHE != type && +#endif HWLOC_OBJ_CORE != type && HWLOC_OBJ_PU != type) { continue; @@ -2067,6 +2127,7 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo, } locality = t2; break; +#if HWLOC_API_VERSION < 0x20000 case HWLOC_OBJ_CACHE: if (3 == obj->attr->cache.depth) { asprintf(&t2, "%sL3%s:", (NULL == locality) ? "" : locality, tmp); @@ -2091,6 +2152,29 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo, break; } break; +#else + case HWLOC_OBJ_L3CACHE: + asprintf(&t2, "%sL3%s:", (NULL == locality) ? "" : locality, tmp); + if (NULL != locality) { + free(locality); + } + locality = t2; + break; + case HWLOC_OBJ_L2CACHE: + asprintf(&t2, "%sL2%s:", (NULL == locality) ? "" : locality, tmp); + if (NULL != locality) { + free(locality); + } + locality = t2; + break; + case HWLOC_OBJ_L1CACHE: + asprintf(&t2, "%sL1%s:", (NULL == locality) ? "" : locality, tmp); + if (NULL != locality) { + free(locality); + } + locality = t2; + break; +#endif case HWLOC_OBJ_CORE: asprintf(&t2, "%sCR%s:", (NULL == locality) ? "" : locality, tmp); if (NULL != locality) { @@ -2141,6 +2225,7 @@ char* opal_hwloc_base_get_location(char *locality, case HWLOC_OBJ_SOCKET: srch = "SK"; break; +#if HWLOC_API_VERSION < 0x20000 case HWLOC_OBJ_CACHE: if (3 == index) { srch = "L3"; @@ -2150,6 +2235,17 @@ char* opal_hwloc_base_get_location(char *locality, srch = "L0"; } break; +#else + case HWLOC_OBJ_L3CACHE: + srch = "L3"; + break; + case HWLOC_OBJ_L2CACHE: + srch = "L2"; + break; + case HWLOC_OBJ_L1CACHE: + srch = "L0"; + break; +#endif case HWLOC_OBJ_CORE: srch = "CR"; break; @@ -2235,3 +2331,23 @@ opal_hwloc_locality_t opal_hwloc_compute_relative_locality(char *loc1, char *loc hwloc_bitmap_free(bit2); return locality; } + +int opal_hwloc_base_topology_export_xmlbuffer(hwloc_topology_t topology, char **xmlpath, int *buflen) { +#if HWLOC_API_VERSION < 0x20000 + return hwloc_topology_export_xmlbuffer(topology, xmlpath, buflen); +#else + return hwloc_topology_export_xmlbuffer(topology, xmlpath, buflen, 0); +#endif +} + +int opal_hwloc_base_topology_set_flags (hwloc_topology_t topology, unsigned long flags, bool io) { + if (io) { +#if HWLOC_API_VERSION < 0x20000 + flags |= HWLOC_TOPOLOGY_FLAG_IO_DEVICES; +#else + int ret = hwloc_topology_set_io_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_IMPORTANT); + if (0 != ret) return ret; +#endif + } + return hwloc_topology_set_flags(topology, flags); +} diff --git a/opal/mca/hwloc/external/configure.m4 b/opal/mca/hwloc/external/configure.m4 index 032eebce59a..c7c3d02ed9a 100644 --- a/opal/mca/hwloc/external/configure.m4 +++ b/opal/mca/hwloc/external/configure.m4 @@ -183,21 +183,7 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[ [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([Cannot continue])]) - AC_MSG_CHECKING([if external hwloc version is lower than 2.0]) - AS_IF([test "$opal_hwloc_dir" != ""], - [opal_hwloc_external_CFLAGS_save=$CFLAGS - CFLAGS="-I$opal_hwloc_dir/include $opal_hwloc_external_CFLAGS_save"]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[ -#if HWLOC_API_VERSION >= 0x00020000 -#error "hwloc API version is greater or equal than 0x00020000" -#endif - ]])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([OMPI does not currently support hwloc v2 API -Cannot continue])]) + AS_IF([test "$opal_hwloc_dir" != ""], [CFLAGS=$opal_hwloc_external_CFLAGS_save]) diff --git a/orte/mca/ess/base/ess_base_fns.c b/orte/mca/ess/base/ess_base_fns.c index ae29db2874a..0a7a61b2fda 100644 --- a/orte/mca/ess/base/ess_base_fns.c +++ b/orte/mca/ess/base/ess_base_fns.c @@ -232,14 +232,11 @@ int orte_ess_base_proc_binding(void) goto error; } if (OPAL_BIND_TO_L1CACHE == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) { - target = HWLOC_OBJ_CACHE; - cache_level = 1; + OPAL_HWLOC_MAKE_OBJ_CACHE(1, target, cache_level); } else if (OPAL_BIND_TO_L2CACHE == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) { - target = HWLOC_OBJ_CACHE; - cache_level = 2; + OPAL_HWLOC_MAKE_OBJ_CACHE(2, target, cache_level); } else if (OPAL_BIND_TO_L3CACHE == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) { - target = HWLOC_OBJ_CACHE; - cache_level = 3; + OPAL_HWLOC_MAKE_OBJ_CACHE(3, target, cache_level); } else if (OPAL_BIND_TO_SOCKET == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) { target = HWLOC_OBJ_SOCKET; } else if (OPAL_BIND_TO_NUMA == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) { @@ -251,9 +248,11 @@ int orte_ess_base_proc_binding(void) } for (obj = obj->parent; NULL != obj; obj = obj->parent) { if (target == obj->type) { +#if HWLOC_API_VERSION < 0x20000 if (HWLOC_OBJ_CACHE == target && cache_level != obj->attr->cache.depth) { continue; } +#endif /* this is the place! */ cpus = obj->cpuset; if (0 > hwloc_set_cpubind(opal_hwloc_topology, cpus, 0)) { diff --git a/orte/mca/ras/simulator/ras_sim_module.c b/orte/mca/ras/simulator/ras_sim_module.c index 9e71040713f..dd7eea91c86 100644 --- a/orte/mca/ras/simulator/ras_sim_module.c +++ b/orte/mca/ras/simulator/ras_sim_module.c @@ -135,7 +135,7 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes) /* since we are loading this from an external source, we have to * explicitly set a flag so hwloc sets things up correctly */ - if (0 != hwloc_topology_set_flags(topo, HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM)) { + if (0 != opal_hwloc_base_topology_set_flags(topo, HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, false)) { orte_show_help("help-ras-simulator.txt", "hwloc API fail", true, __FILE__, __LINE__, "hwloc_topology_set_flags"); diff --git a/orte/mca/rmaps/base/rmaps_base_binding.c b/orte/mca/rmaps/base/rmaps_base_binding.c index a524823e1ae..646921861fb 100644 --- a/orte/mca/rmaps/base/rmaps_base_binding.c +++ b/orte/mca/rmaps/base/rmaps_base_binding.c @@ -171,9 +171,11 @@ static int bind_upwards(orte_job_t *jdata, hwloc_obj_type_string(target), hwloc_obj_type_string(obj->type)); if (target == obj->type) { +#if HWLOC_API_VERSION < 0x20000 if (HWLOC_OBJ_CACHE == target && cache_level != obj->attr->cache.depth) { continue; } +#endif /* get its index */ if (UINT_MAX == (idx = opal_hwloc_base_get_obj_idx(node->topology->topo, obj, OPAL_HWLOC_AVAILABLE))) { ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM); @@ -726,16 +728,13 @@ int orte_rmaps_base_compute_bindings(orte_job_t *jdata) hwb = HWLOC_OBJ_SOCKET; break; case OPAL_BIND_TO_L3CACHE: - hwb = HWLOC_OBJ_CACHE; - clvl = 3; + OPAL_HWLOC_MAKE_OBJ_CACHE(3, hwb, clvl); break; case OPAL_BIND_TO_L2CACHE: - hwb = HWLOC_OBJ_CACHE; - clvl = 2; + OPAL_HWLOC_MAKE_OBJ_CACHE(2, hwb, clvl); break; case OPAL_BIND_TO_L1CACHE: - hwb = HWLOC_OBJ_CACHE; - clvl = 1; + OPAL_HWLOC_MAKE_OBJ_CACHE(1, hwb, clvl); break; case OPAL_BIND_TO_CORE: hwb = HWLOC_OBJ_CORE; @@ -763,16 +762,13 @@ int orte_rmaps_base_compute_bindings(orte_job_t *jdata) hwm = HWLOC_OBJ_SOCKET; break; case ORTE_MAPPING_BYL3CACHE: - hwm = HWLOC_OBJ_CACHE; - clvm = 3; + OPAL_HWLOC_MAKE_OBJ_CACHE(3, hwm, clvm); break; case ORTE_MAPPING_BYL2CACHE: - hwm = HWLOC_OBJ_CACHE; - clvm = 2; + OPAL_HWLOC_MAKE_OBJ_CACHE(2, hwm, clvm); break; case ORTE_MAPPING_BYL1CACHE: - hwm = HWLOC_OBJ_CACHE; - clvm = 1; + OPAL_HWLOC_MAKE_OBJ_CACHE(1, hwm, clvm); break; case ORTE_MAPPING_BYCORE: hwm = HWLOC_OBJ_CORE; @@ -915,28 +911,30 @@ int orte_rmaps_base_compute_bindings(orte_job_t *jdata) } } else { /* determine the relative depth on this node */ +#if HWLOC_API_VERSION < 0x20000 if (HWLOC_OBJ_CACHE == hwb) { /* must use a unique function because blasted hwloc * just doesn't deal with caches very well...sigh */ bind_depth = hwloc_get_cache_type_depth(node->topology->topo, clvl, (hwloc_obj_cache_type_t)-1); - } else { + } else +#endif bind_depth = hwloc_get_type_depth(node->topology->topo, hwb); - } if (0 > bind_depth) { /* didn't find such an object */ orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:no-objects", true, hwloc_obj_type_string(hwb), node->name); return ORTE_ERR_SILENT; } +#if HWLOC_API_VERSION < 0x20000 if (HWLOC_OBJ_CACHE == hwm) { /* must use a unique function because blasted hwloc * just doesn't deal with caches very well...sigh */ map_depth = hwloc_get_cache_type_depth(node->topology->topo, clvm, (hwloc_obj_cache_type_t)-1); - } else { + } else +#endif map_depth = hwloc_get_type_depth(node->topology->topo, hwm); - } if (0 > map_depth) { /* didn't find such an object */ orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:no-objects", diff --git a/orte/mca/rmaps/base/rmaps_base_ranking.c b/orte/mca/rmaps/base/rmaps_base_ranking.c index 8be87fa50e1..6102f0cdf51 100644 --- a/orte/mca/rmaps/base/rmaps_base_ranking.c +++ b/orte/mca/rmaps/base/rmaps_base_ranking.c @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2011 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -466,6 +468,8 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata) orte_proc_t *proc, *pptr; int rc; bool one_found; + hwloc_obj_type_t target; + unsigned cache_level; map = jdata->map; @@ -508,7 +512,8 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata) opal_output_verbose(5, orte_rmaps_base_framework.framework_output, "mca:rmaps: computing ranks by L3cache for job %s", ORTE_JOBID_PRINT(jdata->jobid)); - if (ORTE_SUCCESS != (rc = rank_by(jdata, HWLOC_OBJ_CACHE, 3))) { + OPAL_HWLOC_MAKE_OBJ_CACHE(3, target, cache_level); + if (ORTE_SUCCESS != (rc = rank_by(jdata, target, cache_level))) { if (ORTE_ERR_NOT_SUPPORTED == rc && !(ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE(map->ranking))) { ORTE_SET_RANKING_POLICY(map->ranking, ORTE_RANK_BY_SLOT); @@ -523,7 +528,8 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata) opal_output_verbose(5, orte_rmaps_base_framework.framework_output, "mca:rmaps: computing ranks by L2cache for job %s", ORTE_JOBID_PRINT(jdata->jobid)); - if (ORTE_SUCCESS != (rc = rank_by(jdata, HWLOC_OBJ_CACHE, 2))) { + OPAL_HWLOC_MAKE_OBJ_CACHE(2, target, cache_level); + if (ORTE_SUCCESS != (rc = rank_by(jdata, target, cache_level))) { if (ORTE_ERR_NOT_SUPPORTED == rc && !(ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE(map->ranking))) { ORTE_SET_RANKING_POLICY(map->ranking, ORTE_RANK_BY_SLOT); @@ -538,7 +544,8 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata) opal_output_verbose(5, orte_rmaps_base_framework.framework_output, "mca:rmaps: computing ranks by L1cache for job %s", ORTE_JOBID_PRINT(jdata->jobid)); - if (ORTE_SUCCESS != (rc = rank_by(jdata, HWLOC_OBJ_CACHE, 1))) { + OPAL_HWLOC_MAKE_OBJ_CACHE(1, target, cache_level); + if (ORTE_SUCCESS != (rc = rank_by(jdata, target, cache_level))) { if (ORTE_ERR_NOT_SUPPORTED == rc && !(ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE(map->ranking))) { ORTE_SET_RANKING_POLICY(map->ranking, ORTE_RANK_BY_SLOT); diff --git a/orte/mca/rmaps/round_robin/rmaps_rr.c b/orte/mca/rmaps/round_robin/rmaps_rr.c index b268c4953e7..ab1b3584b1e 100644 --- a/orte/mca/rmaps/round_robin/rmaps_rr.c +++ b/orte/mca/rmaps/round_robin/rmaps_rr.c @@ -13,6 +13,8 @@ * Copyright (c) 2011-2012 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -93,6 +95,8 @@ static int orte_rmaps_rr_map(orte_job_t *jdata) /* cycle through the app_contexts, mapping them sequentially */ for(i=0; i < jdata->apps->size; i++) { + hwloc_obj_type_t target; + unsigned cache_level; if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) { continue; } @@ -171,8 +175,9 @@ static int orte_rmaps_rr_map(orte_job_t *jdata) app->num_procs); } } else if (ORTE_MAPPING_BYL1CACHE == ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) { - rc = orte_rmaps_rr_byobj(jdata, app, &node_list, num_slots, - app->num_procs, HWLOC_OBJ_CACHE, 1); + OPAL_HWLOC_MAKE_OBJ_CACHE(1, target, cache_level); + rc = orte_rmaps_rr_byobj(jdata, app, &node_list, num_slots, app->num_procs, + target, cache_level); if (ORTE_ERR_NOT_FOUND == rc) { /* if the mapper couldn't map by this object because * it isn't available, but the error allows us to try @@ -183,8 +188,9 @@ static int orte_rmaps_rr_map(orte_job_t *jdata) app->num_procs); } } else if (ORTE_MAPPING_BYL2CACHE == ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) { - rc = orte_rmaps_rr_byobj(jdata, app, &node_list, num_slots, - app->num_procs, HWLOC_OBJ_CACHE, 2); + OPAL_HWLOC_MAKE_OBJ_CACHE(2, target, cache_level); + rc = orte_rmaps_rr_byobj(jdata, app, &node_list, num_slots, app->num_procs, + target, cache_level); if (ORTE_ERR_NOT_FOUND == rc) { /* if the mapper couldn't map by this object because * it isn't available, but the error allows us to try @@ -195,8 +201,9 @@ static int orte_rmaps_rr_map(orte_job_t *jdata) app->num_procs); } } else if (ORTE_MAPPING_BYL3CACHE == ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) { - rc = orte_rmaps_rr_byobj(jdata, app, &node_list, num_slots, - app->num_procs, HWLOC_OBJ_CACHE, 3); + OPAL_HWLOC_MAKE_OBJ_CACHE(3, target, cache_level); + rc = orte_rmaps_rr_byobj(jdata, app, &node_list, num_slots, app->num_procs, + target, cache_level); if (ORTE_ERR_NOT_FOUND == rc) { /* if the mapper couldn't map by this object because * it isn't available, but the error allows us to try @@ -272,6 +279,8 @@ static int orte_rmaps_rr_map(orte_job_t *jdata) static int orte_rmaps_rr_assign_locations(orte_job_t *jdata) { mca_base_component_t *c = &mca_rmaps_round_robin_component.base_version; + hwloc_obj_type_t target; + unsigned cache_level; int rc; if (NULL == jdata->map->last_mapper || @@ -316,7 +325,8 @@ static int orte_rmaps_rr_assign_locations(orte_job_t *jdata) rc = orte_rmaps_rr_assign_root_level(jdata); } } else if (ORTE_MAPPING_BYL1CACHE == ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) { - rc = orte_rmaps_rr_assign_byobj(jdata, HWLOC_OBJ_CACHE, 1); + OPAL_HWLOC_MAKE_OBJ_CACHE(1, target, cache_level); + rc = orte_rmaps_rr_assign_byobj(jdata, target, cache_level); if (ORTE_ERR_NOT_FOUND == rc) { /* if the mapper couldn't map by this object because * it isn't available, but the error allows us to try @@ -326,7 +336,8 @@ static int orte_rmaps_rr_assign_locations(orte_job_t *jdata) rc = orte_rmaps_rr_assign_root_level(jdata); } } else if (ORTE_MAPPING_BYL2CACHE == ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) { - rc = orte_rmaps_rr_assign_byobj(jdata, HWLOC_OBJ_CACHE, 2); + OPAL_HWLOC_MAKE_OBJ_CACHE(2, target, cache_level); + rc = orte_rmaps_rr_assign_byobj(jdata, target, cache_level); if (ORTE_ERR_NOT_FOUND == rc) { /* if the mapper couldn't map by this object because * it isn't available, but the error allows us to try @@ -336,7 +347,8 @@ static int orte_rmaps_rr_assign_locations(orte_job_t *jdata) rc = orte_rmaps_rr_assign_root_level(jdata); } } else if (ORTE_MAPPING_BYL3CACHE == ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) { - rc = orte_rmaps_rr_assign_byobj(jdata, HWLOC_OBJ_CACHE, 3); + OPAL_HWLOC_MAKE_OBJ_CACHE(3, target, cache_level); + rc = orte_rmaps_rr_assign_byobj(jdata, target, cache_level); if (ORTE_ERR_NOT_FOUND == rc) { /* if the mapper couldn't map by this object because * it isn't available, but the error allows us to try diff --git a/orte/orted/pmix/pmix_server.c b/orte/orted/pmix/pmix_server.c index 2d7913b33d1..cd705438e59 100644 --- a/orte/orted/pmix/pmix_server.c +++ b/orte/orted/pmix/pmix_server.c @@ -235,7 +235,7 @@ int pmix_server_init(void) int len; kv = OBJ_NEW(opal_value_t); kv->key = strdup(OPAL_PMIX_LOCAL_TOPO); - if (0 != hwloc_topology_export_xmlbuffer(opal_hwloc_topology, &xmlbuffer, &len)) { + if (0 != opal_hwloc_base_topology_export_xmlbuffer(opal_hwloc_topology, &xmlbuffer, &len)) { OBJ_RELEASE(kv); OBJ_DESTRUCT(&info); return ORTE_ERROR; diff --git a/orte/test/system/opal_hwloc.c b/orte/test/system/opal_hwloc.c index ae2f7f5b40f..ce45c8697c5 100644 --- a/orte/test/system/opal_hwloc.c +++ b/orte/test/system/opal_hwloc.c @@ -72,9 +72,8 @@ int main(int argc, char* argv[]) /* since we are loading this from an external source, we have to * explicitly set a flag so hwloc sets things up correctly */ - if (0 != hwloc_topology_set_flags(my_topology, - (HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM | - HWLOC_TOPOLOGY_FLAG_IO_DEVICES))) { + if (0 != opal_hwloc_base_topology_set_flags(my_topology, + HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM)) { hwloc_topology_destroy(my_topology); return OPAL_ERR_NOT_SUPPORTED; } From 593e4ce63f22d32943de1915cd509261ccf20042 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Mon, 10 Apr 2017 10:12:59 +0900 Subject: [PATCH 4/4] hwloc: add hwloc2x internal hwloc 2x is used with --with-hwloc=future Signed-off-by: Gilles Gouaillardet --- opal/mca/hwloc/external/configure.m4 | 3 +- opal/mca/hwloc/hwloc1116/configure.m4 | 3 +- opal/mca/hwloc/hwloc2x/Makefile.am | 39 + opal/mca/hwloc/hwloc2x/autogen.subdirs | 1 + opal/mca/hwloc/hwloc2x/configure.m4 | 112 + opal/mca/hwloc/hwloc2x/hwloc/AUTHORS | 29 + opal/mca/hwloc/hwloc2x/hwloc/COPYING | 39 + opal/mca/hwloc/hwloc2x/hwloc/Makefile.am | 89 + opal/mca/hwloc/hwloc2x/hwloc/NEWS | 1482 +++++ opal/mca/hwloc/hwloc2x/hwloc/README | 65 + opal/mca/hwloc/hwloc2x/hwloc/VERSION | 47 + opal/mca/hwloc/hwloc2x/hwloc/autogen.sh | 2 + .../hwloc/hwloc2x/hwloc/config/distscript.sh | 130 + .../hwloc/config/distscript_embedded.sh | 13 + opal/mca/hwloc/hwloc2x/hwloc/config/hwloc.m4 | 1364 ++++ .../hwloc/config/hwloc_check_attributes.m4 | 534 ++ .../hwloc/config/hwloc_check_vendor.m4 | 246 + .../hwloc/config/hwloc_check_visibility.m4 | 131 + .../hwloc2x/hwloc/config/hwloc_components.m4 | 66 + .../hwloc2x/hwloc/config/hwloc_get_version.sh | 98 + .../hwloc2x/hwloc/config/hwloc_internal.m4 | 470 ++ .../hwloc/hwloc2x/hwloc/config/hwloc_pkg.m4 | 207 + opal/mca/hwloc/hwloc2x/hwloc/config/netloc.m4 | 116 + opal/mca/hwloc/hwloc2x/hwloc/configure.ac | 271 + .../hwloc2x/hwloc/contrib/hwloc-valgrind.supp | 161 + .../hwloc2x/hwloc/contrib/misc/Makefile.am | 2 + .../hwloc2x/hwloc/contrib/systemd/Makefile.am | 2 + opal/mca/hwloc/hwloc2x/hwloc/doc/Makefile.am | 2 + .../hwloc2x/hwloc/doc/doxygen-config.cfg.in | 2 + .../hwloc2x/hwloc/doc/examples/Makefile.am | 2 + opal/mca/hwloc/hwloc2x/hwloc/hwloc.pc.in | 12 + .../mca/hwloc/hwloc2x/hwloc/hwloc/Makefile.am | 230 + opal/mca/hwloc/hwloc2x/hwloc/hwloc/base64.c | 306 + opal/mca/hwloc/hwloc2x/hwloc/hwloc/bind.c | 951 +++ opal/mca/hwloc/hwloc2x/hwloc/hwloc/bitmap.c | 1522 +++++ .../hwloc/hwloc2x/hwloc/hwloc/components.c | 784 +++ opal/mca/hwloc/hwloc2x/hwloc/hwloc/diff.c | 468 ++ .../mca/hwloc/hwloc2x/hwloc/hwloc/distances.c | 927 +++ opal/mca/hwloc/hwloc2x/hwloc/hwloc/dolib.c | 47 + opal/mca/hwloc/hwloc2x/hwloc/hwloc/misc.c | 166 + .../hwloc/hwloc2x/hwloc/hwloc/pci-common.c | 954 +++ .../hwloc/hwloc2x/hwloc/hwloc/topology-aix.c | 875 +++ .../hwloc/hwloc2x/hwloc/hwloc/topology-bgq.c | 301 + .../hwloc/hwloc2x/hwloc/hwloc/topology-cuda.c | 170 + .../hwloc2x/hwloc/hwloc/topology-darwin.c | 307 + .../hwloc/hwloc2x/hwloc/hwloc/topology-fake.c | 61 + .../hwloc2x/hwloc/hwloc/topology-freebsd.c | 254 + .../hwloc/hwloc2x/hwloc/hwloc/topology-gl.c | 185 + .../hwloc2x/hwloc/hwloc/topology-hardwired.c | 223 + .../hwloc/hwloc2x/hwloc/hwloc/topology-hpux.c | 312 + .../hwloc2x/hwloc/hwloc/topology-linux.c | 5790 +++++++++++++++++ .../hwloc2x/hwloc/hwloc/topology-netbsd.c | 213 + .../hwloc/hwloc2x/hwloc/hwloc/topology-noos.c | 57 + .../hwloc/hwloc2x/hwloc/hwloc/topology-nvml.c | 146 + .../hwloc2x/hwloc/hwloc/topology-opencl.c | 203 + .../hwloc/hwloc2x/hwloc/hwloc/topology-pci.c | 323 + .../hwloc/hwloc/topology-solaris-chiptype.c | 346 + .../hwloc2x/hwloc/hwloc/topology-solaris.c | 817 +++ .../hwloc2x/hwloc/hwloc/topology-synthetic.c | 1215 ++++ .../hwloc2x/hwloc/hwloc/topology-windows.c | 1171 ++++ .../hwloc/hwloc2x/hwloc/hwloc/topology-x86.c | 1437 ++++ .../hwloc2x/hwloc/hwloc/topology-xml-libxml.c | 569 ++ .../hwloc/hwloc/topology-xml-nolibxml.c | 873 +++ .../hwloc/hwloc2x/hwloc/hwloc/topology-xml.c | 2398 +++++++ opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology.c | 3684 +++++++++++ .../mca/hwloc/hwloc2x/hwloc/hwloc/traversal.c | 553 ++ .../hwloc/hwloc2x/hwloc/include/Makefile.am | 65 + opal/mca/hwloc/hwloc2x/hwloc/include/hwloc.h | 2184 +++++++ .../hwloc/include/hwloc/autogen/config.h.in | 201 + .../hwloc2x/hwloc/include/hwloc/bitmap.h | 376 ++ .../hwloc/hwloc2x/hwloc/include/hwloc/cuda.h | 220 + .../hwloc2x/hwloc/include/hwloc/cudart.h | 177 + .../hwloc2x/hwloc/include/hwloc/deprecated.h | 216 + .../hwloc/hwloc2x/hwloc/include/hwloc/diff.h | 284 + .../hwloc2x/hwloc/include/hwloc/distances.h | 223 + .../hwloc2x/hwloc/include/hwloc/export.h | 236 + .../hwloc/hwloc2x/hwloc/include/hwloc/gl.h | 135 + .../hwloc2x/hwloc/include/hwloc/glibc-sched.h | 125 + .../hwloc2x/hwloc/include/hwloc/helper.h | 1081 +++ .../hwloc2x/hwloc/include/hwloc/inlines.h | 140 + .../hwloc2x/hwloc/include/hwloc/intel-mic.h | 134 + .../hwloc/include/hwloc/linux-libnuma.h | 273 + .../hwloc/hwloc2x/hwloc/include/hwloc/linux.h | 79 + .../hwloc2x/hwloc/include/hwloc/myriexpress.h | 127 + .../hwloc/hwloc2x/hwloc/include/hwloc/nvml.h | 181 + .../hwloc2x/hwloc/include/hwloc/opencl.h | 196 + .../hwloc/include/hwloc/openfabrics-verbs.h | 150 + .../hwloc2x/hwloc/include/hwloc/plugins.h | 522 ++ .../hwloc2x/hwloc/include/hwloc/rename.h | 707 ++ opal/mca/hwloc/hwloc2x/hwloc/include/netloc.h | 56 + .../hwloc2x/hwloc/include/netloc/utarray.h | 237 + .../hwloc2x/hwloc/include/netloc/uthash.h | 966 +++ .../hwloc2x/hwloc/include/netlocscotch.h | 122 + .../hwloc/include/private/autogen/config.h.in | 728 +++ .../hwloc/include/private/components.h | 43 + .../hwloc2x/hwloc/include/private/cpuid-x86.h | 86 + .../hwloc2x/hwloc/include/private/debug.h | 82 + .../hwloc2x/hwloc/include/private/misc.h | 439 ++ .../hwloc2x/hwloc/include/private/netloc.h | 578 ++ .../hwloc2x/hwloc/include/private/private.h | 388 ++ .../hwloc/include/private/solaris-chiptype.h | 59 + .../hwloc/hwloc2x/hwloc/include/private/xml.h | 102 + opal/mca/hwloc/hwloc2x/hwloc/netloc.pc.in | 11 + .../hwloc/hwloc2x/hwloc/netloc/Makefile.am | 87 + .../hwloc/hwloc2x/hwloc/netloc/architecture.c | 852 +++ opal/mca/hwloc/hwloc2x/hwloc/netloc/edge.c | 87 + opal/mca/hwloc/hwloc2x/hwloc/netloc/hwloc.c | 288 + opal/mca/hwloc/hwloc2x/hwloc/netloc/mpicomm.c | 101 + opal/mca/hwloc/hwloc2x/hwloc/netloc/node.c | 129 + opal/mca/hwloc/hwloc2x/hwloc/netloc/path.c | 31 + .../hwloc2x/hwloc/netloc/physical_link.c | 88 + opal/mca/hwloc/hwloc2x/hwloc/netloc/scotch.c | 469 ++ opal/mca/hwloc/hwloc2x/hwloc/netloc/support.c | 59 + .../mca/hwloc/hwloc2x/hwloc/netloc/topology.c | 598 ++ .../hwloc/hwloc2x/hwloc/netlocscotch.pc.in | 11 + .../mca/hwloc/hwloc2x/hwloc/tests/Makefile.am | 2 + .../hwloc2x/hwloc/tests/hwloc/Makefile.am | 2 + .../hwloc/tests/hwloc/linux/Makefile.am | 2 + .../tests/hwloc/linux/allowed/Makefile.am | 2 + .../hwloc/linux/allowed/test-topology.sh.in | 2 + .../tests/hwloc/linux/gather/Makefile.am | 2 + .../linux/gather/test-gather-topology.sh.in | 2 + .../tests/hwloc/linux/test-topology.sh.in | 2 + .../hwloc/tests/hwloc/ports/Makefile.am | 2 + .../hwloc/tests/hwloc/rename/Makefile.am | 2 + .../hwloc2x/hwloc/tests/hwloc/wrapper.sh.in | 2 + .../hwloc2x/hwloc/tests/hwloc/x86/Makefile.am | 2 + .../hwloc/tests/hwloc/x86/test-topology.sh.in | 2 + .../hwloc2x/hwloc/tests/hwloc/xml/Makefile.am | 2 + .../hwloc/tests/hwloc/xml/test-topology.sh.in | 2 + .../hwloc2x/hwloc/tests/netloc/Makefile.am | 2 + .../hwloc2x/hwloc/tests/netloc/tests.sh.in | 2 + .../mca/hwloc/hwloc2x/hwloc/utils/Makefile.am | 2 + .../hwloc2x/hwloc/utils/hwloc/Makefile.am | 2 + .../hwloc/utils/hwloc/hwloc-compress-dir.in | 2 + .../utils/hwloc/hwloc-gather-topology.in | 2 + .../hwloc/utils/hwloc/test-fake-plugin.sh.in | 2 + .../utils/hwloc/test-hwloc-annotate.sh.in | 2 + .../hwloc/utils/hwloc/test-hwloc-calc.sh.in | 2 + .../utils/hwloc/test-hwloc-compress-dir.sh.in | 2 + .../utils/hwloc/test-hwloc-diffpatch.sh.in | 2 + .../utils/hwloc/test-hwloc-distrib.sh.in | 2 + .../hwloc/test-hwloc-dump-hwdata/Makefile.am | 2 + .../test-hwloc-dump-hwdata.sh.in | 2 + .../hwloc/utils/hwloc/test-hwloc-info.sh.in | 2 + .../hwloc2x/hwloc/utils/lstopo/Makefile.am | 2 + .../hwloc/utils/lstopo/lstopo-windows.c | 2 + .../hwloc/utils/lstopo/test-lstopo.sh.in | 2 + .../hwloc/utils/netloc/draw/Makefile.am | 2 + .../hwloc/utils/netloc/infiniband/Makefile.am | 2 + .../netloc/infiniband/netloc_ib_gather_raw.in | 477 ++ .../hwloc/utils/netloc/mpi/Makefile.am | 2 + opal/mca/hwloc/hwloc2x/hwloc2x.h | 50 + opal/mca/hwloc/hwloc2x/hwloc2x_component.c | 57 + opal/mca/hwloc/hwloc2x/owner.txt | 7 + 155 files changed, 49968 insertions(+), 2 deletions(-) create mode 100644 opal/mca/hwloc/hwloc2x/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/autogen.subdirs create mode 100644 opal/mca/hwloc/hwloc2x/configure.m4 create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/AUTHORS create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/COPYING create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/NEWS create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/README create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/VERSION create mode 100755 opal/mca/hwloc/hwloc2x/hwloc/autogen.sh create mode 100755 opal/mca/hwloc/hwloc2x/hwloc/config/distscript.sh create mode 100755 opal/mca/hwloc/hwloc2x/hwloc/config/distscript_embedded.sh create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/config/hwloc.m4 create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_attributes.m4 create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_vendor.m4 create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_visibility.m4 create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_components.m4 create mode 100755 opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_get_version.sh create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_internal.m4 create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_pkg.m4 create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/config/netloc.m4 create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/configure.ac create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/contrib/hwloc-valgrind.supp create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/contrib/misc/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/contrib/systemd/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/doc/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/doc/doxygen-config.cfg.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/doc/examples/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc.pc.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/base64.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/bind.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/bitmap.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/components.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/diff.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/distances.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/dolib.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/misc.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/pci-common.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-aix.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-bgq.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-cuda.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-darwin.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-fake.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-freebsd.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-gl.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-hardwired.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-hpux.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-linux.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-netbsd.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-noos.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-nvml.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-opencl.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-pci.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-solaris-chiptype.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-solaris.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-synthetic.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-windows.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-x86.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-xml-libxml.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-xml-nolibxml.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology-xml.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/topology.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/hwloc/traversal.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/autogen/config.h.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/bitmap.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/cuda.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/cudart.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/deprecated.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/diff.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/distances.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/export.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/gl.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/glibc-sched.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/helper.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/inlines.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/intel-mic.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/linux-libnuma.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/linux.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/myriexpress.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/nvml.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/opencl.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/openfabrics-verbs.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/plugins.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/hwloc/rename.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/netloc.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/netloc/utarray.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/netloc/uthash.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/netlocscotch.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/autogen/config.h.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/components.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/cpuid-x86.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/debug.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/misc.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/netloc.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/private.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/solaris-chiptype.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/include/private/xml.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc.pc.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/architecture.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/edge.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/hwloc.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/mpicomm.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/node.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/path.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/physical_link.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/scotch.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/support.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netloc/topology.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/netlocscotch.pc.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/linux/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/linux/allowed/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/linux/allowed/test-topology.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/linux/gather/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/linux/gather/test-gather-topology.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/linux/test-topology.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/ports/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/rename/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/wrapper.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/x86/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/x86/test-topology.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/xml/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/hwloc/xml/test-topology.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/netloc/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/tests/netloc/tests.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/hwloc-compress-dir.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/hwloc-gather-topology.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-fake-plugin.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-hwloc-annotate.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-hwloc-calc.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-hwloc-compress-dir.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-hwloc-diffpatch.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-hwloc-distrib.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-hwloc-dump-hwdata/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/hwloc/test-hwloc-info.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/lstopo/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/lstopo/lstopo-windows.c create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/lstopo/test-lstopo.sh.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/netloc/draw/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/netloc/infiniband/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/netloc/infiniband/netloc_ib_gather_raw.in create mode 100644 opal/mca/hwloc/hwloc2x/hwloc/utils/netloc/mpi/Makefile.am create mode 100644 opal/mca/hwloc/hwloc2x/hwloc2x.h create mode 100644 opal/mca/hwloc/hwloc2x/hwloc2x_component.c create mode 100644 opal/mca/hwloc/hwloc2x/owner.txt diff --git a/opal/mca/hwloc/external/configure.m4 b/opal/mca/hwloc/external/configure.m4 index c7c3d02ed9a..411d8ad1c1f 100644 --- a/opal/mca/hwloc/external/configure.m4 +++ b/opal/mca/hwloc/external/configure.m4 @@ -103,7 +103,8 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[ AS_IF([test "$with_hwloc" = "external"], [opal_hwloc_external_want=yes]) AS_IF([test "$with_hwloc" != "" && \ test "$with_hwloc" != "no" && \ - test "$with_hwloc" != "internal"], [opal_hwloc_external_want=yes]) + test "$with_hwloc" != "internal" && \ + test "$with_hwloc" != "future"], [opal_hwloc_external_want=yes]) AS_IF([test "$with_hwloc" = "no"], [opal_hwloc_external_want=no]) # If we still want external support, try it diff --git a/opal/mca/hwloc/hwloc1116/configure.m4 b/opal/mca/hwloc/hwloc1116/configure.m4 index de1ff24ac38..fbb8bd24b13 100644 --- a/opal/mca/hwloc/hwloc1116/configure.m4 +++ b/opal/mca/hwloc/hwloc1116/configure.m4 @@ -88,7 +88,8 @@ AC_DEFUN([MCA_opal_hwloc_hwloc1116_CONFIG],[ # Run the hwloc configuration - if no external hwloc, then set the prefixi # to minimize the chance that someone will use the internal symbols - AS_IF([test "$opal_hwloc_external" = "no"], + AS_IF([test "$opal_hwloc_external" = "no" && + test "$with_hwloc" != "future"], [HWLOC_SET_SYMBOL_PREFIX([opal_hwloc1116_])]) # save XML or graphical options diff --git a/opal/mca/hwloc/hwloc2x/Makefile.am b/opal/mca/hwloc/hwloc2x/Makefile.am new file mode 100644 index 00000000000..7a9a9da0b59 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/Makefile.am @@ -0,0 +1,39 @@ +# +# Copyright (c) 2011-2016 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2014-2015 Intel, Inc. All right reserved. +# Copyright (c) 2016 Los Alamos National Security, LLC. All rights +# reserved. +# Copyright (c) 2017 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +EXTRA_DIST = autogen.subdirs + +SUBDIRS = hwloc +DIST_SUBDIRS=hwloc + +# Headers and sources +headers = hwloc2x.h +sources = hwloc2x_component.c + +libs = hwloc/hwloc/libhwloc_embedded.la + +# We only ever build this component statically +noinst_LTLIBRARIES = libmca_hwloc_hwloc2x.la +libmca_hwloc_hwloc2x_la_SOURCES = $(headers) $(sources) +nodist_libmca_hwloc_hwloc2x_la_SOURCES = $(nodist_headers) +libmca_hwloc_hwloc2x_la_LDFLAGS = -module -avoid-version +libmca_hwloc_hwloc2x_la_LIBADD = $(libs) +libmca_hwloc_hwloc2x_la_DEPENDENCIES = $(libs) + +# Conditionally install the header files +if WANT_INSTALL_HEADERS +opaldir = $(opalincludedir)/$(subdir) +nobase_opal_HEADERS = $(headers) +nobase_nodist_opal_HEADERS = $(nodist_headers) +endif diff --git a/opal/mca/hwloc/hwloc2x/autogen.subdirs b/opal/mca/hwloc/hwloc2x/autogen.subdirs new file mode 100644 index 00000000000..beb596cf6af --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/autogen.subdirs @@ -0,0 +1 @@ +hwloc diff --git a/opal/mca/hwloc/hwloc2x/configure.m4 b/opal/mca/hwloc/hwloc2x/configure.m4 new file mode 100644 index 00000000000..1d0d1272372 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/configure.m4 @@ -0,0 +1,112 @@ +# -*- shell-script -*- +# +# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2014-2015 Intel, Inc. All rights reserved. +# Copyright (c) 2015-2017 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# Copyright (c) 2016 Los Alamos National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# +# Priority +# +AC_DEFUN([MCA_opal_hwloc_hwloc2x_PRIORITY], [90]) + +# +# Force this component to compile in static-only mode +# +AC_DEFUN([MCA_opal_hwloc_hwloc2x_COMPILE_MODE], [ + AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) + $4="static" + AC_MSG_RESULT([$$4]) +]) + +# MCA_hwloc_hwloc2x_POST_CONFIG() +# --------------------------------- +AC_DEFUN([MCA_opal_hwloc_hwloc2x_POST_CONFIG],[ + OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc2x_basedir]) + + # If we won, then do all the rest of the setup + AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc2x_support" = "yes"], + [ + # Set this variable so that the framework m4 knows what + # file to include in opal/mca/hwloc/hwloc-internal.h + opal_hwloc_hwloc2x_basedir=opal/mca/hwloc/hwloc2x + opal_hwloc_base_include="$opal_hwloc_hwloc2x_basedir/hwloc2x.h" + + # Add some stuff to CPPFLAGS so that the rest of the source + # tree can be built + file=$opal_hwloc_hwloc2x_basedir/hwloc + CPPFLAGS="-I$OPAL_TOP_SRCDIR/$file/include $CPPFLAGS" + AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"], + [CPPFLAGS="-I$OPAL_TOP_BUILDDIR/$file/include $CPPFLAGS"]) + unset file + ]) + OPAL_VAR_SCOPE_POP +])dnl + + +# MCA_hwloc_hwloc2x_CONFIG([action-if-found], [action-if-not-found]) +# -------------------------------------------------------------------- +AC_DEFUN([MCA_opal_hwloc_hwloc2x_CONFIG],[ + # Hwloc needs to know if we have Verbs support + AC_REQUIRE([OPAL_CHECK_VERBS_DIR]) + + AC_CONFIG_FILES([opal/mca/hwloc/hwloc2x/Makefile]) + + OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc2x_flags opal_hwloc_hwloc2x_save_CPPFLAGS opal_hwloc_hwloc2x_basedir opal_hwloc_hwloc2x_file opal_hwloc_future]) + + # default to this component not providing support + opal_hwloc_hwloc2x_basedir=opal/mca/hwloc/hwloc2x + opal_hwloc_hwloc2x_support=no + + AS_IF([test "$with_hwloc" = "future"], + [opal_hwloc_future="yes"], + [opal_hwloc_future="no"]) + + opal_hwloc_hwloc2x_save_CPPFLAGS=$CPPFLAGS + + # Run the hwloc configuration - if no external hwloc, then set the prefix + # to minimize the chance that someone will use the internal symbols + + opal_hwloc_hwloc2x_flags="--enable-embedded-mode --with-hwloc-symbol-prefix=opal_hwloc2x_ --disable-cairo --disable-pugins --enable-static --enable-xml" + AS_IF([test "$opal_check_cuda_happy" = "yes"], + [CPPFLAGS="$CPPFLAGS $opal_datatype_cuda_CPPFLAGS", + opal_hwloc_hwloc2x_flags="$opal_hwloc_hwloc2x_flags --enable-nvml CPPFLAGS=\"$CPPFLAGS\""] + [opal_hwloc_hwloc2x_flags="$opal_hwloc_hwloc2x_flags --disable-nvml"]) + + OPAL_CONFIG_SUBDIR([opal/mca/hwloc/hwloc2x/hwloc], + [$opal_hwloc_hwloc2x_flags], + [opal_hwloc_hwloc2x_support="yes"], + [opal_hwloc_hwloc2x_support="no"]) + + CPPFLAGS=$opal_hwloc_hwloc2x_save_CPPFLAGS + + # If we are not building the internal hwloc, then indicate that + # this component should not be built. NOTE: we still did all the + # above configury so that all the proper GNU Autotools + # infrastructure is setup properly (e.g., w.r.t. SUBDIRS=hwloc in + # this directory's Makefile.am, we still need the Autotools "make + # distclean" infrastructure to work properly). + AS_IF([test "$opal_hwloc_future" != "yes"], + [AC_MSG_WARN([not using future hwloc; disqualifying this component]) + opal_hwloc_hwloc2x_support=no]) + + # Done! + AS_IF([test "$opal_hwloc_hwloc2x_support" = "yes"], + [AC_DEFINE_UNQUOTED([HWLOC_SYM_PREFIX],[opal_hwloc2x_]) + AC_DEFINE_UNQUOTED([HWLOC_SYM_PREFIX_CAPS], [OPAL_HWLOC2X_]) + AC_DEFINE_UNQUOTED([HWLOC_SYM_TRANSFORM], [1]) + AC_DEFINE([HAVE_DECL_HWLOC_OBJ_OSDEV_COPROC], [1]) + $1], + [$2]) + + OPAL_VAR_SCOPE_POP +])dnl diff --git a/opal/mca/hwloc/hwloc2x/hwloc/AUTHORS b/opal/mca/hwloc/hwloc2x/hwloc/AUTHORS new file mode 100644 index 00000000000..740de337b20 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/AUTHORS @@ -0,0 +1,29 @@ +netloc Authors +============== + +The following cumulative list contains the names of most individuals who +have committed code to the hwloc repository. + +Name Affiliation(s) +--------------------------- -------------------- +Cédric Augonnet University of Bordeaux +Guillaume Beauchamp Inria +Ahmad Boissetri Binzagr Inria +Cyril Bordage Inria +Nicholas Buroker UWL +Jérôme Clet-Ortega University of Bordeaux +Ludovic Courtès Inria +Nathalie Furmento CNRS +Brice Goglin Inria +Joshua Hursey UWL +Alexey Kardashevskiy IBM +Douglas MacFarland UWL +Antoine Rougier intern from University of Bordeaux +Jeff Squyres Cisco +Samuel Thibault University of Bordeaux + +Affiliaion abbreviations: +------------------------- +Cisco = Cisco Systems, Inc. +CNRS = Centre national de la recherche scientifique (France) +UWL = University of Wisconsin-La Crosse diff --git a/opal/mca/hwloc/hwloc2x/hwloc/COPYING b/opal/mca/hwloc/hwloc2x/hwloc/COPYING new file mode 100644 index 00000000000..e77516e1801 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/COPYING @@ -0,0 +1,39 @@ +Copyright © 2004-2006 The Trustees of Indiana University and Indiana University Research and Technology Corporation. All rights reserved. +Copyright © 2004-2005 The University of Tennessee and The University of Tennessee Research Foundation. All rights reserved. +Copyright © 2004-2005 High Performance Computing Center Stuttgart, University of Stuttgart. All rights reserved. +Copyright © 2004-2005 The Regents of the University of California. All rights reserved. +Copyright © 2009 CNRS +Copyright © 2009-2016 Inria. All rights reserved. +Copyright © 2009-2015 Université Bordeaux +Copyright © 2009-2015 Cisco Systems, Inc. All rights reserved. +Copyright © 2009-2012 Oracle and/or its affiliates. All rights reserved. +Copyright © 2010 IBM +Copyright © 2010 Jirka Hladky +Copyright © 2012 Aleksej Saushev, The NetBSD Foundation +Copyright © 2012 Blue Brain Project, EPFL. All rights reserved. +Copyright © 2013-2014 University of Wisconsin-La Crosse. All rights reserved. +Copyright © 2015 Research Organization for Information Science and Technology (RIST). All rights reserved. +Copyright © 2015-2016 Intel, Inc. All rights reserved. +See COPYING in top-level directory. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/opal/mca/hwloc/hwloc2x/hwloc/Makefile.am b/opal/mca/hwloc/hwloc2x/hwloc/Makefile.am new file mode 100644 index 00000000000..3aa78ab251e --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/Makefile.am @@ -0,0 +1,89 @@ +# Copyright © 2009-2016 Inria. All rights reserved. +# Copyright © 2009 Université Bordeaux +# Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. +# See COPYING in top-level directory. + +# Note that the -I directory must *exactly* match what was specified +# via AC_CONFIG_MACRO_DIR in configure.ac. +ACLOCAL_AMFLAGS = -I ./config + +# +# "make distcheck" requires that tarballs are able to be able to "make +# dist", so we have to include config/distscript.sh. +# +EXTRA_DIST = \ + README VERSION COPYING AUTHORS \ + config/hwloc_get_version.sh \ + config/distscript.sh + +SUBDIRS = include hwloc + +if BUILD_NETLOC +SUBDIRS += netloc +endif + +if HWLOC_BUILD_STANDALONE +SUBDIRS += utils tests contrib/systemd contrib/misc +# We need doc/ if HWLOC_BUILD_DOXYGEN, or during make install if HWLOC_INSTALL_DOXYGEN. +# There's no INSTALL_SUBDIRS, so always enter doc/ and check HWLOC_BUILD/INSTALL_DOXYGEN there +SUBDIRS += doc +endif + +# Do not let automake automatically add the non-standalone dirs to the +# distribution tarball if we're building in embedded mode. +DIST_SUBDIRS = $(SUBDIRS) + +# Only install the pkg file if we're building in standalone mode (and not on Windows) +if HWLOC_BUILD_STANDALONE +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = hwloc.pc +if BUILD_NETLOC +# JMS Need to compare hwloc.pc and netloc.pc -- I think netloc.pc is +# missing some things. +# pkgconfig_DATA += netloc.pc Disabled until the netloc API is public +EXTRA_DIST += netloc.pc +if BUILD_NETLOCSCOTCH +pkgconfig_DATA += netlocscotch.pc +endif BUILD_NETLOCSCOTCH +endif BUILD_NETLOC +endif HWLOC_BUILD_STANDALONE + +# Only install the valgrind suppressions file if we're building in +# standalone mode +if HWLOC_BUILD_STANDALONE +dist_pkgdata_DATA = contrib/hwloc-valgrind.supp +endif + +# Only install entire visual studio subdirectory if we're building in +# standalone mode +if HWLOC_BUILD_STANDALONE +EXTRA_DIST += contrib/windows +endif + +if HWLOC_BUILD_STANDALONE +dist-hook: + sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(HWLOC_VERSION)" +endif HWLOC_BUILD_STANDALONE + +if HWLOC_BUILD_STANDALONE +if HWLOC_HAVE_WINDOWS +# +# Winball specific rules +# +install-data-local: + sed -e 's/$$/'$$'\015'/ < $(srcdir)/README > $(DESTDIR)$(prefix)/README.txt + sed -e 's/$$/'$$'\015'/ < $(srcdir)/NEWS > $(DESTDIR)$(prefix)/NEWS.txt + sed -e 's/$$/'$$'\015'/ < $(srcdir)/COPYING > $(DESTDIR)$(prefix)/COPYING.txt +uninstall-local: + rm -f $(DESTDIR)$(prefix)/README.txt $(DESTDIR)$(prefix)/NEWS.txt $(DESTDIR)$(prefix)/COPYING.txt +endif HWLOC_HAVE_WINDOWS +endif HWLOC_BUILD_STANDALONE + +# +# Build the documenation and top-level README file +# +if HWLOC_BUILD_STANDALONE +.PHONY: doc readme +doc readme: + $(MAKE) -C doc +endif HWLOC_BUILD_STANDALONE diff --git a/opal/mca/hwloc/hwloc2x/hwloc/NEWS b/opal/mca/hwloc/hwloc2x/hwloc/NEWS new file mode 100644 index 00000000000..e1a0fffef5f --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/NEWS @@ -0,0 +1,1482 @@ +Copyright © 2009 CNRS +Copyright © 2009-2017 Inria. All rights reserved. +Copyright © 2009-2013 Université Bordeaux +Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. + +$COPYRIGHT$ + +Additional copyrights may follow + +$HEADER$ + +=========================================================================== + +This file contains the main features as well as overviews of specific +bug fixes (and other actions) for each version of hwloc since version +0.9 (as initially released as "libtopology", then re-branded to "hwloc" +in v0.9.1). + + +Version 2.0.0 +------------- +* The ABI of the library has changed. For instance some hwloc_obj fields + were reordered. + - HWLOC_API_VERSION and hwloc_get_api_version() now give 0x00020000. + - See "How do I handle ABI breaks and API upgrades ?" in the FAQ + and https://github.com/open-mpi/hwloc/wiki/Upgrading-to-v2.0-API +* Major changes + + Topologies always have at least one NUMA object. On non-NUMA machines, + a single NUMA object is added to describe the entire machine memory. + The NUMA level cannot be ignored anymore. + + The HWLOC_OBJ_CACHE type is replaced with 8 types HWLOC_OBJ_L[1-5]CACHE + and HWLOC_OBJ_L[1-3]ICACHE that remove the need to disambiguate levels + when looking for caches with _by_type() functions. + - New hwloc_obj_type_is_{,d,i}cache() functions may be used to check whether + a given type is a cache. + + Replace hwloc_topology_ignore*() functions with hwloc_topology_set_type_filter() + and hwloc_topology_set_all_types_filter(). + - Contrary to hwloc_topology_ignore_{type,all}_keep_structure() which + removed individual objects, HWLOC_TYPE_FILTER_KEEP_STRUCTURE only removes + entire levels (so that topology do not become too asymmetric). + + Remove HWLOC_TOPOLOGY_FLAG_ICACHES in favor of hwloc_topology_set_icache_types_filter() + with HWLOC_TYPE_FILTER_KEEP_ALL. + + Remove HWLOC_TOPOLOGY_FLAG_IO_DEVICES, _IO_BRIDGES and _WHOLE_IO in favor of + hwloc_topology_set_io_types_filter() with HWLOC_TYPE_FILTER_KEEP_ALL or + HWLOC_TYPE_FILTER_KEEP_IMPORTANT. + + hwloc_topology_restrict() doesn't remove objects that contain memory + by default anymore. + - The list of existing restrict flags was modified. + + XML export functions take an additional flags argument, + for instance for exporting XMLs that are compatible with hwloc 1.x. + + The distance API has been completely reworked. It is now described + in hwloc/distances.h. + + Add the experimental netloc subproject. It is enabled by default when + supported and can be disabled with --disable-netloc. + It currently brings command-line tools to gather and visualize the + topology of InfiniBand fabrics, and an API to convert such topologies + into Scotch architectures for process mapping. + See the documentation for details. + + Remove the online_cpuset from struct hwloc_obj. Offline PUs get unknown + topologies on Linux nowadays, and wrong topology on Solaris. Other OS + do not support them. And one cannot do much about them anyway. Just keep + them in complete_cpuset. + + Remove the custom interface for assembling the topologies of different + nodes as well as the hwloc-assembler tools. + + Remove Kerrighed support from the Linux backend. + + Remove Tru64 (OSF/1) support. + - Remove HWLOC_MEMBIND_REPLICATE which wasn't available anywhere else. +* API + + Objects now have a "subtype" field that supersedes former "Type" and + "CoProcType" info attributes. + + The almost-unused "os_level" attribute has been removed from the + hwloc_obj structure. + + I/O and Misc objects are now stored in a dedicated children list, only + normal children with non-NULL cpusets and nodesets are in the main + children list. + - hwloc_get_next_child() may still be used to iterate over these 3 lists + of children at once. + + Replace hwloc_topology_insert_misc_object_by_cpuset() with + hwloc_topology_insert_group_object() to precisely specify the location + of an additional hierarchy level in the topology. + + Misc objects have their own level and depth to iterate over all of them. + + Misc objects may now only be inserted as a leaf object with + hwloc_topology_insert_misc_object() which deprecates + hwloc_topology_insert_misc_object_by_parent(). + + hwloc_topology_set_fsroot() is removed, the environment variable + HWLOC_FSROOT may be used for the same remote testing/debugging purpose. + + hwloc_type_sscanf() deprecates the old hwloc_obj_type_sscanf(). + + hwloc_type_sscanf_as_depth() is added to convert a type name into + a level depth. + + hwloc_type_name() deprecates the old hwloc_obj_type_string(). + + Remove the deprecated hwloc_obj_snprintf(), hwloc_obj_type_of_string(), + hwloc_distribute[v](). + + hwloc_obj_cpuset_snprintf() is deprecated in favor of hwloc_bitmap_snprintf(). + + Functions diff_load_xml*(), diff_export_xml*() and diff_destroy() in + hwloc/diff.h do not need a topology as first parameter anymore. + + hwloc_parse_cpumap_file () superseded by hwloc_linux_read_path_as_cpumask() + in hwloc/linux.h. +* Tools + - lstopo and hwloc-info have a new --filter option matching the new filtering API. + - hwloc-distances was removed and replaced with lstopo --distances. +* Plugin API + + hwloc_fill_object_sets() is renamed into hwloc_obj_add_children_sets(). +* Misc + + Linux OS devices do not have to be attached through PCI anymore, + for instance enabling the discovery of NVDIMM block devices. + + Add a SectorSize attribute to block OS devices on Linux. + + Misc MemoryModule objects are only added when full I/O discovery is enabled + (WHOLE_IO topology flag). + + Do not set PCI devices and bridges name automatically. Vendor and device + names are already in info attributes. + + Exporting to synthetic now ignores I/O and Misc objects. + + XML and Synthetic export functions have moved to hwloc/export.h, + automatically included from hwloc.h. + + Separate OS device discovery from PCI discovery. Only the latter is disabled + with --disable-pci at configure time. Both may be disabled with --disable-io. + + The old `libpci' component name from hwloc 1.6 is not supported anymore, + only the `pci' name from hwloc 1.7 is now recognized. + + The `linuxpci' component is now renamed into `linuxio'. + + The HWLOC_PCI___LOCALCPUS environment variables are superseded + with a single HWLOC_PCI_LOCALITY where bus ranges may be specified. + + Add HWLOC_SYNTHETIC environment variable to enforce a synthetic topology + as if hwloc_topology_set_synthetic() had been called. + + HWLOC_COMPONENTS doesn't support xml or synthetic component attributes + anymore, they should be passed in HWLOC_XMLFILE or HWLOC_SYNTHETIC instead. + + HWLOC_COMPONENTS takes precedence over other environment variables + for selecting components. + + Remove the dependency on libnuma on Linux. + + +Version 1.11.7 +-------------- +* Fix hwloc-bind --membind for CPU-less NUMA nodes (again). + Thanks to Gilles Gouaillardet for reporting the issue. +* Fix a memory leak on IBM S/390 platforms running Linux. +* Fix a memory leak when forcing the x86 backend first on amd64/topoext + platforms running Linux. +* Command-line tools now support "hbm" instead "numanode" for filtering + only high-bandwidth memory nodes when selecting locations. + + hwloc-bind also support --hbm and --no-hbm for filtering only or + no HBM nodes. + Thanks to Nicolas Denoyelle for the suggestion. +* Add --children and --descendants to hwloc-info for listing object + children or object descendants of a specific type. +* Add --no-index, --index, --no-attrs, --attrs to disable/enable display + of index numbers or attributes in the graphical lstopo output. +* Try to gather hwloc-dump-hwdata output from all possible locations + in hwloc-gather-topology. +* Updates to the documentation of locations in hwloc(7) and + command-line tools manpages. + + +Version 1.11.6 +-------------- +* Make the Linux discovery about twice faster, especially on the CPU side, + by trying to avoid sysfs file accesses as much as possible. +* Add support for AMD Family 17h processors (Zen) SMT cores in the Linux + and x86 backends. +* Add the HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES flag (and the + HWLOC_THISSYSTEM_ALLOWED_RESOURCES environment variable) for reading the + set of allowed resources from the local operating system even if the + topology was loaded from XML or synthetic. +* Fix hwloc_bitmap_set/clr_range() for infinite ranges that do not + overlap currently defined ranges in the bitmap. +* Don't reset the lstopo zoom scale when moving the X11 window. +* lstopo now has --flags for manually setting topology flags. +* hwloc_get_depth_type() returns HWLOC_TYPE_DEPTH_UNKNOWN for Misc objects. + + +Version 1.11.5 +-------------- +* Add support for Knights Mill Xeon Phi, thanks to Piotr Luc for the patch. +* Reenable distance gathering on Solaris, disabled by mistake since v1.0. + Thanks to TU Wien for the help. +* Fix hwloc_get_*obj*_inside_cpuset() functions to ignore objects with + empty CPU sets, for instance, CPU-less NUMA nodes such as KNL MCDRAM. + Thanks to Nicolas Denoyelle for the report. +* Fix XML import of multiple distance matrices. +* Add a FAQ entry about "hwloc is only a structural model, it ignores + performance models, memory bandwidth, etc.?" + + +Version 1.11.4 +-------------- +* Add MemoryMode and ClusterMode attributes in the Machine object on KNL. + Add doc/examples/get-knl-modes.c for an example of retrieving them. + Thanks to Grzegorz Andrejczuk. +* Fix Linux build with -m32 with respect to libudev. + Thanks to Paul Hargrove for reporting the issue. +* Fix build with Visual Studio 2015, thanks to Eloi Gaudry for reporting + the issue and providing the patch. +* Don't forget to display OS device children in the graphical lstopo. +* Fix a memory leak on Solaris, thanks to Bryon Gloden for the patch. +* Properly handle realloc() failures, thanks to Bryon Gloden for reporting + the issue. +* Fix lstopo crash in ascii/fig/windows outputs when some objects have a + lstopoStyle info attribute. + + +Version 1.11.3 +-------------- +* Bug fixes + + Fix a memory leak on Linux S/390 hosts with books. + + Fix /proc/mounts parsing on Linux by using mntent.h. + Thanks to Nathan Hjelm for reporting the issue. + + Fix a x86 infinite loop on VMware due to the x2APIC feature being + advertised without actually being fully supported. + Thanks to Jianjun Wen for reporting the problem and testing the patch. + + Fix the return value of hwloc_alloc() on mmap() failure. + Thanks to Hugo Brunie for reporting the issue. + + Fix the return value of command-line tools in some error cases. + + Do not break individual thread bindings during x86 backend discovery in a + multithreaded process. Thanks to Farouk Mansouri for the report. + + Fix hwloc-bind --membind for CPU-less NUMA nodes. + + Fix some corner cases in the XML export/import of application userdata. +* API Improvements + + Add HWLOC_MEMBIND_BYNODESET flag so that membind() functions accept + either cpusets or nodesets. + + Add hwloc_get_area_memlocation() to check where pages are actually + allocated. Only implemented on Linux for now. + - There's no _nodeset() variant, but the new flag HWLOC_MEMBIND_BYNODESET + is supported. + + Make hwloc_obj_type_sscanf() parse back everything that may be outputted + by hwloc_obj_type_snprintf(). +* Detection Improvements + + Allow the x86 backend to add missing cache levels, so that it completes + what the Solaris backend lacks. + Thanks to Ryan Zezeski for reporting the issue. + + Do not filter-out FibreChannel PCI adapters by default anymore. + Thanks to Matt Muggeridge for the report. + + Add support for CUDA compute capability 6.x. +* Tools + + Add --support to hwloc-info to list supported features, just like with + hwloc_topology_get_support(). + - Also add --objects and --topology to explicitly switch between the + default modes. + + Add --tid to let hwloc-bind operate on individual threads on Linux. + + Add --nodeset to let hwloc-bind report memory binding as NUMA node sets. + + hwloc-annotate and lstopo don't drop application userdata from XMLs anymore. + - Add --cu to hwloc-annotate to drop these application userdata. + + Make the hwloc-dump-hwdata dump directory configurable through configure + options such as --runstatedir or --localstatedir. +* Misc Improvements + + Add systemd service template contrib/systemd/hwloc-dump-hwdata.service + for launching hwloc-dump-hwdata at boot on Linux. + Thanks to Grzegorz Andrejczuk. + + Add HWLOC_PLUGINS_BLACKLIST environment variable to prevent some plugins + from being loaded. Thanks to Alexandre Denis for the suggestion. + + Small improvements for various Windows build systems, + thanks to Jonathan L Peyton and Marco Atzeri. + + +Version 1.11.2 +-------------- +* Improve support for Intel Knights Landing Xeon Phi on Linux: + + Group local NUMA nodes of normal memory (DDR) and high-bandwidth memory + (MCDRAM) together through "Cluster" groups so that the local MCDRAM is + easy to find. + - See "How do I find the local MCDRAM NUMA node on Intel Knights + Landing Xeon Phi?" in the documentation. + - For uniformity across all KNL configurations, always have a NUMA node + object even if the host is UMA. + + Fix the detection of the memory-side cache: + - Add the hwloc-dump-hwdata superuser utility to dump SMBIOS information + into /var/run/hwloc/ as root during boot, and load this dumped + information from the hwloc library at runtime. + - See "Why do I need hwloc-dump-hwdata for caches on Intel Knights + Landing Xeon Phi?" in the documentation. + Thanks to Grzegorz Andrejczuk for the patches and for the help. +* The x86 and linux backends may now be combined for discovering CPUs + through x86 CPUID and memory from the Linux kernel. + This is useful for working around buggy CPU information reported by Linux + (for instance the AMD Bulldozer/Piledriver bug below). + Combination is enabled by passing HWLOC_COMPONENTS=x86 in the environment. +* Fix L3 cache sharing on AMD Opteron 63xx (Piledriver) and 62xx (Bulldozer) + in the x86 backend. Thanks to many users who helped. +* Fix the overzealous L3 cache sharing fix added to the x86 backend in 1.11.1 + for AMD Opteron 61xx (Magny-Cours) processors. +* The x86 backend may now add the info attribute Inclusive=0 or 1 to caches + it discovers, or to caches discovered by other backends earlier. + Thanks to Guillaume Beauchamp for the patch. +* Fix the management on alloc_membind() allocation failures on AIX, HP-UX + and OSF/Tru64. +* Fix spurious failures to load with ENOMEM on AIX in case of Misc objects + below PUs. +* lstopo improvements in X11 and Windows graphical mode: + + Add + - f 1 shortcuts to manually zoom-in, zoom-out, reset the scale, + or fit the entire window. + + Display all keyboard shortcuts in the console. +* Debug messages may be disabled at runtime by passing HWLOC_DEBUG_VERBOSE=0 + in the environment when --enable-debug was passed to configure. +* Add a FAQ entry "What are these Group objects in my topology?". + + +Version 1.11.1 +-------------- +* Detection fixes + + Hardwire the topology of Fujitsu K-computer, FX10, FX100 servers to + workaround buggy Linux kernels. + Thanks to Takahiro Kawashima and Gilles Gouaillardet. + + Fix L3 cache information on AMD Opteron 61xx Magny-Cours processors + in the x86 backend. Thanks to Guillaume Beauchamp for the patch. + + Detect block devices directly attached to PCI without a controller, + for instance NVMe disks. Thanks to Barry M. Tannenbaum. + + Add the PCISlot attribute to all PCI functions instead of only the + first one. +* Miscellaneous internal fixes + + Ignore PCI bridges that could fail assertions by reporting buggy + secondary-subordinate bus numbers + Thanks to George Bosilca for reporting the issue. + + Fix an overzealous assertion when inserting an intermediate Group object + while Groups are totally ignored. + + Fix a memory leak on Linux on AMD processors with dual-core compute units. + Thanks to Bob Benner. + + Fix a memory leak on failure to load a xml diff file. + + Fix some segfaults when inputting an invalid synthetic description. + + Fix a segfault when plugins fail to find core symbols. + Thanks to Guy Streeter. +* Many fixes and improvements in the Windows backend: + + Fix the discovery of more than 32 processors and multiple processor + groups. Thanks to Barry M. Tannenbaum for the help. + + Add thread binding set support in case of multiple process groups. + + Add thread binding get support. + + Add get_last_cpu_location() support for the current thread. + + Disable the unsupported process binding in case of multiple processor + groups. + + Fix/update the Visual Studio support under contrib/windows. + Thanks to Eloi Gaudry for the help. +* Tools fixes + + Fix a segfault when displaying logical indexes in the graphical lstopo. + Thanks to Guillaume Mercier for reporting the issue. + + Fix lstopo linking with X11 libraries, for instance on Mac OS X. + Thanks to Scott Atchley and Pierre Ramet for reporting the issue. + + hwloc-annotate, hwloc-diff and hwloc-patch do not drop unavailable + resources from the output anymore and those may be annotated as well. + + Command-line tools may now import XML from the standard input with -i -.xml + + Add missing documentation for the hwloc-info --no-icaches option. + + +Version 1.11.0 +-------------- +* API + + Socket objects are renamed into Package to align with the terminology + used by processor vendors. The old HWLOC_OBJ_SOCKET type and "Socket" + name are still supported for backward compatibility. + + HWLOC_OBJ_NODE is replaced with HWLOC_OBJ_NUMANODE for clarification. + HWLOC_OBJ_NODE is still supported for backward compatibility. + "Node" and "NUMANode" strings are supported as in earlier releases. +* Detection improvements + + Add support for Intel Knights Landing Xeon Phi. + Thanks to Grzegorz Andrejczuk and Lukasz Anaczkowski. + + Add Vendor, Model, Revision, SerialNumber, Type and LinuxDeviceID + info attributes to Block OS devices on Linux. Thanks to Vineet Pedaballe + for the help. + - Add --disable-libudev to avoid dependency on the libudev library. + + Add "MemoryModule" Misc objects with information about DIMMs, on Linux + when privileged and when I/O is enabled. + Thanks to Vineet Pedaballe for the help. + + Add a PCISlot attribute to PCI devices on Linux when supported to + identify the physical PCI slot where the board is plugged. + + Add CPUStepping info attribute on x86 processors, + thanks to Thomas Röhl for the suggestion. + + Ignore the device-tree on non-Power architectures to avoid buggy + detection on ARM. Thanks to Orion Poplawski for reporting the issue. + + Work-around buggy Xeon E5v3 BIOS reporting invalid PCI-NUMA affinity + for the PCI links on the second processor. + + Add support for CUDA compute capability 5.x, thanks Benjamin Worpitz. + + Many fixes to the x86 backend + - Add L1i and fix L2/L3 type on old AMD processors without topoext support. + - Fix Intel CPU family and model numbers when basic family isn't 6 or 15. + - Fix package IDs on recent AMD processors. + - Fix misc issues due to incomplete APIC IDs on x2APIC processors. + - Avoid buggy discovery on old SGI Altix UVs with non-unique APIC IDs. + + Gather total machine memory on NetBSD. +* Tools + + lstopo + - Collapse identical PCI devices unless --no-collapse is given. + This avoids gigantic outputs when a PCI device contains dozens of + identical virtual functions. + - The ASCII art output is now called "ascii", for instance in + "lstopo -.ascii". + The former "txt" extension is retained for backward compatibility. + - Automatically scales graphical box width to the inner text in Cairo, + ASCII and Windows outputs. + - Add --rect to lstopo to force rectangular layout even for NUMA nodes. + - Add --restrict-flags to configure the behavior of --restrict. + - Objects may have a "Type" info attribute to specify a better type name + and display it in lstopo. + - Really export all verbose information to the given output file. + + hwloc-annotate + - May now operate on all types of objects, including I/O. + - May now insert Misc objects in the topology. + - Do not drop instruction caches and I/O devices from the output anymore. + + Fix lstopo path in hwloc-gather-topology after install. +* Misc + + Fix hwloc/cudart.h for machines with multiple PCI domains, + thanks to Imre Kerr for reporting the problem. + + Fix PCI Bridge-specific depth attribute. + + Fix hwloc_bitmap_intersect() for two infinite bitmaps. + + Fix some corner cases in the building of levels on large NUMA machines + with non-uniform NUMA groups and I/Os. + + Improve the performance of object insertion by cpuset for large + topologies. + + Prefix verbose XML import errors with the source name. + + Improve pkg-config checks and error messages. + + Fix excluding after a component with an argument in the HWLOC_COMPONENTS + environment variable. +* Documentation + + Fix the recommended way in documentation and examples to allocate memory + on some node, it should use HWLOC_MEMBIND_BIND. + Thanks to Nicolas Bouzat for reporting the issue. + + Add a "Miscellaneous objects" section in the documentation. + + Add a FAQ entry "What happens to my topology if I disable symmetric + multithreading, hyper-threading, etc. ?" to the documentation. + + +Version 1.10.1 +-------------- +* Actually remove disallowed NUMA nodes from nodesets when the whole-system + flag isn't enabled. +* Fix the gathering of PCI domains. Thanks to James Custer for reporting + the issue and providing a patch. +* Fix the merging of identical parent and child in presence of Misc objects. + Thanks to Dave Love for reporting the issue. +* Fix some misordering of children when merging with ignore_keep_structure() + in partially allowed topologies. +* Fix an overzealous assertion in the debug code when running on a single-PU + host with I/O. Thanks to Thomas Van Doren for reporting the issue. +* Don't forget to setup NUMA node object nodesets in x86 backend (for BSDs) + and OSF/Tru64 backend. +* Fix cpuid-x86 build error with gcc -O3 on x86-32. Thanks to Thomas Van Doren + for reporting the issue. +* Fix support for future very large caches in the x86 backend. +* Fix vendor/device names for SR-IOV PCI devices on Linux. +* Fix an unlikely crash in case of buggy hierarchical distance matrix. +* Fix PU os_index on some AIX releases. Thanks to Hendryk Bockelmann and + Erik Schnetter for helping debugging. +* Fix hwloc_bitmap_isincluded() in case of infinite sets. +* Change hwloc-ls.desktop into a lstopo.desktop and only install it if + lstopo is built with Cairo/X11 support. It cannot work with a non-graphical + lstopo or hwloc-ls. +* Add support for the renaming of Socket into Package in future releases. +* Add support for the replacement of HWLOC_OBJ_NODE with HWLOC_OBJ_NUMANODE + in future releases. +* Clarify the documentation of distance matrices in hwloc.h and in the manpage + of the hwloc-distances. Thanks to Dave Love for the suggestion. +* Improve some error messages by displaying more information about the + hwloc library in use. +* Document how to deal with the ABI break when upgrading to the upcoming 2.0 + See "How do I handle ABI breaks and API upgrades ?" in the FAQ. + + +Version 1.10.0 +-------------- +* API + + Add hwloc_topology_export_synthetic() to export a topology to a + synthetic string without using lstopo. See the Synthetic topologies + section in the documentation. + + Add hwloc_topology_set/get_userdata() to let the application save + a private pointer in the topology whenever it needs a way to find + its own object corresponding to a topology. + + Add hwloc_get_numanode_obj_by_os_index() and document that this function + as well as hwloc_get_pu_obj_by_os_index() are good at converting + nodesets and cpusets into objects. + + hwloc_distrib() does not ignore any objects anymore when there are + too many of them. They get merged with others instead. + Thanks to Tim Creech for reporting the issue. +* Tools + + hwloc-bind --get now executes the command after displaying + the binding instead of ignoring the command entirely. + Thanks to John Donners for the suggestion. + + Clarify that memory sizes shown in lstopo are local by default + unless specified (total memory added in the root object). +* Synthetic topologies + + Synthetic topology descriptions may now specify attributes such as + memory sizes and OS indexes. See the Synthetic topologies section + in the documentation. + + lstopo now exports in this fully-detailed format by default. + The new option --export-synthetic-flags may be used to revert + back the old format. +* Documentation + + Add the doc/examples/ subdirectory with several real-life examples, + including the already existing hwloc-hello.C for basics. + Thanks to Rob Aulwes for the suggestion. + + Improve the documentation of CPU and memory binding in the API. + + Add a FAQ entry about operating system errors, especially on AMD + platforms with buggy cache information. + + Add a FAQ entry about loading many topologies in a single program. +* Misc + + Work around buggy Linux kernels reporting 2 sockets instead + 1 socket with 2 NUMA nodes for each Xeon E5 v3 (Haswell) processor. + + pciutils/libpci support is now removed since libpciaccess works + well and there's also a Linux-specific PCI backend. For the record, + pciutils was GPL and therefore disabled by default since v1.6.2. + + Add --disable-cpuid configure flag to work around buggy processor + simulators reporting invalid CPUID information. + Thanks for Andrew Friedley for reporting the issue. + + Fix a racy use of libltdl when manipulating multiple topologies in + different threads. + Thanks to Andra Hugo for reporting the issue and testing patches. + + Fix some build failures in private/misc.h. + Thanks to Pavan Balaji and Ralph Castain for the reports. + + Fix failures to detect X11/Xutil.h on some Solaris platforms. + Thanks to Siegmar Gross for reporting the failure. + + The plugin ABI has changed, this release will not load plugins + built against previous hwloc releases. + + +Version 1.9.1 +------------- +* Fix a crash when the PCI locality is invalid. Attach to the root object + instead. Thanks to Nicolas Denoyelle for reporting the issue. +* Fix -f in lstopo manpage. Thanks to Jirka Hladky for reporting the issue. +* Fix hwloc_obj_type_sscanf() and others when strncasecmp() is not properly + available. Thanks to Nick Papior Andersen for reporting the problem. +* Mark Linux file descriptors as close-on-exec to avoid leaks on exec. +* Fix some minor memory leaks. + + +Version 1.9.0 +------------- +* API + + Add hwloc_obj_type_sscanf() to extend hwloc_obj_type_of_string() with + type-specific attributes such as Cache/Group depth and Cache type. + hwloc_obj_type_of_string() is moved to hwloc/deprecated.h. + + Add hwloc_linux_get_tid_last_cpu_location() for retrieving the + last CPU where a Linux thread given by TID ran. + + Add hwloc_distrib() to extend the old hwloc_distribute[v]() functions. + hwloc_distribute[v]() is moved to hwloc/deprecated.h. + + Don't mix total and local memory when displaying verbose object attributes + with hwloc_obj_attr_snprintf() or in lstopo. +* Backends + + Add CPUVendor, CPUModelNumber and CPUFamilyNumber info attributes for + x86, ia64 and Xeon Phi sockets on Linux, to extend the x86-specific + support added in v1.8.1. Requested by Ralph Castain. + + Add many CPU- and Platform-related info attributes on ARM and POWER + platforms, in the Machine and Socket objects. + + Add CUDA info attributes describing the number of multiprocessors and + cores and the size of the global, shared and L2 cache memories in CUDA + OS devices. + + Add OpenCL info attributes describing the number of compute units and + the global memory size in OpenCL OS devices. + + The synthetic backend now accepts extended types such as L2Cache, L1i or + Group3. lstopo also exports synthetic strings using these extended types. +* Tools + + lstopo + - Do not overwrite output files by default anymore. + Pass -f or --force to enforce it. + - Display OpenCL, CUDA and Xeon Phi numbers of cores and memory sizes + in the graphical output. + - Fix export to stdout when specifying a Cairo-based output type + with --of. + + hwloc-ps + - Add -e or --get-last-cpu-location to report where processes/threads + run instead of where they are bound. + - Report locations as likely-more-useful objects such as Cores or Sockets + instead of Caches when possible. + + hwloc-bind + - Fix failure on Windows when not using --pid. + - Add -e as a synonym to --get-last-cpu-location. + + hwloc-distrib + - Add --reverse to distribute using last objects first and singlify + into last bits first. Thanks to Jirka Hladky for the suggestion. + + hwloc-info + - Report unified caches when looking for data or instruction cache + ancestor objects. +* Misc + + Add experimental Visual Studio support under contrib/windows. + Thanks to Eloi Gaudry for his help and for providing the first draft. + + Fix some overzealous assertions and warnings about the ordering of + objects on a level with respect to cpusets. The ordering is only + guaranteed for complete cpusets (based on the first bit in sets). + + Fix some memory leaks when importing xml diffs and when exporting a + "too complex" entry. + + +Version 1.8.1 +------------- +* Fix the cpuid code on Windows 64bits so that the x86 backend gets + enabled as expected and can populate CPU information. + Thanks to Robin Scher for reporting the problem. +* Add CPUVendor/CPUModelNumber/CPUFamilyNumber attributes when running + on x86 architecture. Thanks to Ralph Castain for the suggestion. +* Work around buggy BIOS reporting duplicate NUMA nodes on Linux. + Thanks to Jeff Becker for reporting the problem and testing the patch. +* Add a name to the lstopo graphical window. Thanks to Michael Prokop + for reporting the issue. + + +Version 1.8.0 +------------- +* New components + + Add the "linuxpci" component that always works on Linux even when + libpciaccess and libpci aren't available (and even with a modified + file-system root). By default the old "pci" component runs first + because "linuxpci" lacks device names (obj->name is always NULL). +* API + + Add the topology difference API in hwloc/diff.h for manipulating + many similar topologies. + + Add hwloc_topology_dup() for duplicating an entire topology. + + hwloc.h and hwloc/helper.h have been reorganized to clarify the + documentation sections. The actual inline code has moved out of hwloc.h + into the new hwloc/inlines.h. + + Deprecated functions are now in hwloc/deprecated.h, and not in the + official documentation anymore. +* Tools + + Add hwloc-diff and hwloc-patch tools together with the new diff API. + + Add hwloc-compress-dir to (de)compress an entire directory of XML files + using hwloc-diff and hwloc-patch. + + Object colors in the graphical output of lstopo may be changed by adding + a "lstopoStyle" info attribute. See CUSTOM COLORS in the lstopo(1) manpage + for details. Thanks to Jirka Hladky for discussing the idea. + + hwloc-gather-topology may now gather I/O-related files on Linux when + --io is given. Only the linuxpci component supports discovering I/O + objects from these extended tarballs. + + hwloc-annotate now supports --ri to remove/replace info attributes with + a given name. + + hwloc-info supports "root" and "all" special locations for dumping + information about the root object. + + lstopo now supports --append-legend to append custom lines of text + to the legend in the graphical output. Thanks to Jirka Hladky for + discussing the idea. + + hwloc-calc and friends have a more robust parsing of locations given + on the command-line and they report useful error messages about it. + + Add --whole-system to hwloc-bind, hwloc-calc, hwloc-distances and + hwloc-distrib, and add --restrict to hwloc-bind for uniformity among + tools. +* Misc + + Calling hwloc_topology_load() or hwloc_topology_set_*() on an already + loaded topology now returns an error (deprecated since release 1.6.1). + + Fix the initialisation of cpusets and nodesets in Group objects added + when inserting PCI hostbridges. + + Never merge Group objects that were added explicitly by the user with + hwloc_custom_insert_group_object_by_parent(). + + Add a sanity check during dynamic plugin loading to prevent some + crashes when hwloc is dynamically loaded by another plugin mechanisms. + + Add --with-hwloc-plugins-path to specify the install/load directories + of plugins. + + Add the MICSerialNumber info attribute to the root object when running + hwloc inside a Xeon Phi to match the same attribute in the MIC OS device + when running in the host. + + +Version 1.7.2 +------------- +* Do not create invalid block OS devices on very old Linux kernel such + as RHEL4 2.6.9. +* Fix PCI subvendor/device IDs. +* Fix the management of Misc objects inserted by parent. + Thanks to Jirka Hladky for reporting the problem. +* Add a PortState into attribute to OpenFabrics OS devices. +* Add a MICSerialNumber info attribute to Xeon PHI/MIC OS devices. +* Improve verbose error messages when failing to load from XML. + + +Version 1.7.1 +------------- +* Fix a failed assertion in the distance grouping code when loading a XML + file that already contains some groups. + Thanks to Laercio Lima Pilla for reporting the problem. +* Remove unexpected Group objects when loading XML topologies with I/O + objects and NUMA distances. + Thanks to Elena Elkina for reporting the problem and testing patches. +* Fix PCI link speed discovery when using libpciaccess. +* Fix invalid libpciaccess virtual function device/vendor IDs when using + SR-IOV PCI devices on Linux. +* Fix GL component build with old NVCtrl releases. + Thanks to Jirka Hladky for reporting the problem. +* Fix embedding breakage caused by libltdl. + Thanks to Pavan Balaji for reporting the problem. +* Always use the system-wide libltdl instead of shipping one inside hwloc. +* Document issues when enabling plugins while embedding hwloc in another + project, in the documentation section Embedding hwloc in Other Software. +* Add a FAQ entry "How to get useful topology information on NetBSD?" + in the documentation. +* Somes fixes in the renaming code for embedding. +* Miscellaneous minor build fixes. + + +Version 1.7.0 +------------- +* New operating system backends + + Add BlueGene/Q compute node kernel (CNK) support. See the FAQ in the + documentation for details. Thanks to Jeff Hammond, Christopher Samuel + and Erik Schnetter for their help. + + Add NetBSD support, thanks to Aleksej Saushev. +* New I/O device discovery + + Add co-processor OS devices such as "mic0" for Intel Xeon Phi (MIC) + on Linux. Thanks to Jerome Vienne for helping. + + Add co-processor OS devices such as "cuda0" for NVIDIA CUDA-capable GPUs. + + Add co-processor OS devices such as "opencl0d0" for OpenCL GPU devices + on the AMD OpenCL implementation. + + Add GPU OS devices such as ":0.0" for NVIDIA X11 displays. + + Add GPU OS devices such as "nvml0" for NVIDIA GPUs. + Thanks to Marwan Abdellah and Stefan Eilemann for helping. + These new OS devices have some string info attributes such as CoProcType, + GPUModel, etc. to better identify them. + See the I/O Devices and Attributes documentation sections for details. +* New components + + Add the "opencl", "cuda", "nvml" and "gl" components for I/O device + discovery. + + "nvml" also improves the discovery of NVIDIA GPU PCIe link speed. + All of these new components may be built as plugins. They may also be + disabled entirely by passing --disable-opencl/cuda/nvml/gl to configure. + See the I/O Devices, Components and Plugins, and FAQ documentation + sections for details. +* API + + Add hwloc_topology_get_flags(). + + Add hwloc/plugins.h for building external plugins. + See the Adding new discovery components and plugins section. +* Interoperability + + Add hwloc/opencl.h, hwloc/nvml.h, hwloc/gl.h and hwloc/intel-mic.h + to retrieve the locality of OS devices that correspond to AMD OpenCL + GPU devices or indexes, to NVML devices or indexes, to NVIDIA X11 + displays, or to Intel Xeon Phi (MIC) device indexes. + + Add new helpers in hwloc/cuda.h and hwloc/cudart.h to convert + between CUDA devices or indexes and hwloc OS devices. + + Add hwloc_ibv_get_device_osdev() and clarify the requirements + of the OpenFabrics Verbs helpers in hwloc/openfabrics-verbs.h. +* Tools + + hwloc-info is not only a synonym of lstopo -s anymore, it also + dumps information about objects given on the command-line. +* Documentation + + Add a section "Existing components and plugins". + + Add a list of common OS devices in section "Software devices". + + Add a new FAQ entry "Why is lstopo slow?" about lstopo slowness + issues because of GPUs. + + Clarify the documentation of inline helpers in hwloc/myriexpress.h + and hwloc/openfabrics-verbs.h. +* Misc + + Improve cache detection on AIX. + + The HWLOC_COMPONENTS variable now excludes the components whose + names are prefixed with '-'. + + lstopo --ignore PU now works when displaying the topology in + graphical and textual mode (not when exporting to XML). + + Make sure I/O options always appear in lstopo usage, not only when + using pciutils/libpci. + + Remove some unneeded Linux specific includes from some interoperability + headers. + + Fix some inconsistencies in hwloc-distrib and hwloc-assembler-remote + manpages. Thanks to Guy Streeter for the report. + + Fix a memory leak on AIX when getting memory binding. + + Fix many small memory leaks on Linux. + + The `libpci' component is now called `pci' but the old name is still + accepted in the HWLOC_COMPONENTS variable for backward compatibility. + + +Version 1.6.2 +------------- +* Use libpciaccess instead of pciutils/libpci by default for I/O discovery. + pciutils/libpci is only used if --enable-libpci is given to configure + because its GPL license may taint hwloc. See the Installation section + in the documentation for details. +* Fix get_cpubind on Solaris when bound to a single PU with + processor_bind(). Thanks to Eugene Loh for reporting the problem + and providing a patch. + + +Version 1.6.1 +------------- +* Fix some crash or buggy detection in the x86 backend when Linux + cgroups/cpusets restrict the available CPUs. +* Fix the pkg-config output with --libs --static. + Thanks to Erik Schnetter for reporting one of the problems. +* Fix the output of hwloc-calc -H --hierarchical when using logical + indexes in the output. +* Calling hwloc_topology_load() multiple times on the same topology + is officially deprecated. hwloc will warn in such cases. +* Add some documentation about existing plugins/components, package + dependencies, and I/O devices specification on the command-line. + + +Version 1.6.0 +------------- +* Major changes + + Reorganize the backend infrastructure to support dynamic selection + of components and dynamic loading of plugins. For details, see the + new documentation section Components and plugins. + - The HWLOC_COMPONENTS variable lets one replace the default discovery + components. + - Dynamic loading of plugins may be enabled with --enable-plugins + (except on AIX and Windows). It will build libxml2 and libpci + support as separated modules. This helps reducing the dependencies + of the core hwloc library when distributed as a binary package. +* Backends + + Add CPUModel detection on Darwin and x86/FreeBSD. + Thanks to Robin Scher for providing ways to implement this. + + The x86 backend now adds CPUModel info attributes to socket objects + created by other backends that do not natively support this attribute. + + Fix detection on FreeBSD in case of cpuset restriction. Thanks to + Sebastian Kuzminsky for reporting the problem. +* XML + + Add hwloc_topology_set_userdata_import/export_callback(), + hwloc_export_obj_userdata() and _userdata_base64() to let + applications specify how to save/restore the custom data they placed + in the userdata private pointer field of hwloc objects. +* Tools + + Add hwloc-annotate program to add string info attributes to XML + topologies. + + Add --pid-cmd to hwloc-ps to append the output of a command to each + PID line. May be used for showing Open MPI process ranks, see the + hwloc-ps(1) manpage for details. + + hwloc-bind now exits with an error if binding fails; the executable + is not launched unless binding suceeeded or --force was given. + + Add --quiet to hwloc-calc and hwloc-bind to hide non-fatal error + messages. + + Fix command-line pid support in windows tools. + + All programs accept --verbose as a synonym to -v. +* Misc + + Fix some DIR descriptor leaks on Linux. + + Fix I/O device lists when some were filtered out after a XML import. + + Fix the removal of I/O objects when importing a I/O-enabled XML topology + without any I/O topology flag. + + When merging objects with HWLOC_IGNORE_TYPE_KEEP_STRUCTURE or + lstopo --merge, compare object types before deciding which one of two + identical object to remove (e.g. keep sockets in favor of caches). + + Add some GUID- and LID-related info attributes to OpenFabrics + OS devices. + + Only add CPUType socket attributes on Solaris/Sparc. Other cases + don't report reliable information (Solaris/x86), and a replacement + is available as the Architecture string info in the Machine object. + + Add missing Backend string info on Solaris in most cases. + + Document object attributes and string infos in a new Attributes + section in the documentation. + + Add a section about Synthetic topologies in the documentation. + + +Version 1.5.2 (some of these changes are in v1.6.2 but not in v1.6) +------------- +* Use libpciaccess instead of pciutils/libpci by default for I/O discovery. + pciutils/libpci is only used if --enable-libpci is given to configure + because its GPL license may taint hwloc. See the Installation section + in the documentation for details. +* Fix get_cpubind on Solaris when bound to a single PU with + processor_bind(). Thanks to Eugene Loh for reporting the problem + and providing a patch. +* Fix some DIR descriptor leaks on Linux. +* Fix I/O device lists when some were filtered out after a XML import. +* Add missing Backend string info on Solaris in most cases. +* Fix the removal of I/O objects when importing a I/O-enabled XML topology + without any I/O topology flag. +* Fix the output of hwloc-calc -H --hierarchical when using logical + indexes in the output. +* Fix the pkg-config output with --libs --static. + Thanks to Erik Schnetter for reporting one of the problems. + + +Version 1.5.1 +------------- +* Fix block OS device detection on Linux kernel 3.3 and later. + Thanks to Guy Streeter for reporting the problem and testing the fix. +* Fix the cpuid code in the x86 backend (for FreeBSD). Thanks to + Sebastian Kuzminsky for reporting problems and testing patches. +* Fix 64bit detection on FreeBSD. +* Fix some corner cases in the management of the thissystem flag with + respect to topology flags and environment variables. +* Fix some corner cases in command-line parsing checks in hwloc-distrib + and hwloc-distances. +* Make sure we do not miss some block OS devices on old Linux kernels + when a single PCI device has multiple IDE hosts/devices behind it. +* Do not disable I/O devices or instruction caches in hwloc-assembler output. + + +Version 1.5.0 +------------- +* Backends + + Do not limit the number of processors to 1024 on Solaris anymore. + + Gather total machine memory on FreeBSD. Thanks to Cyril Roelandt. + + XML topology files do not depend on the locale anymore. Float numbers + such as NUMA distances or PCI link speeds now always use a dot as a + decimal separator. + + Add instruction caches detection on Linux, AIX, Windows and Darwin. + + Add get_last_cpu_location() support for the current thread on AIX. + + Support binding on AIX when threads or processes were bound with + bindprocessor(). Thanks to Hendryk Bockelmann for reporting the issue + and testing patches, and to Farid Parpia for explaining the binding + interfaces. + + Improve AMD topology detection in the x86 backend (for FreeBSD) using + the topoext feature. +* API + + Increase HWLOC_API_VERSION to 0x00010500 so that API changes may be + detected at build-time. + + Add a cache type attribute describind Data, Instruction and Unified + caches. Caches with different types but same depth (for instance L1d + and L1i) are placed on different levels. + + Add hwloc_get_cache_type_depth() to retrieve the hwloc level depth of + of the given cache depth and type, for instance L1i or L2. + It helps disambiguating the case where hwloc_get_type_depth() returns + HWLOC_TYPE_DEPTH_MULTIPLE. + + Instruction caches are ignored unless HWLOC_TOPOLOGY_FLAG_ICACHES is + passed to hwloc_topology_set_flags() before load. + + Add hwloc_ibv_get_device_osdev_by_name() OpenFabrics helper in + openfabrics-verbs.h to find the hwloc OS device object corresponding to + an OpenFabrics device. +* Tools + + Add lstopo-no-graphics, a lstopo built without graphical support to + avoid dependencies on external libraries such as Cairo and X11. When + supported, graphical outputs are only available in the original lstopo + program. + - Packagers splitting lstopo and lstopo-no-graphics into different + packages are advised to use the alternatives system so that lstopo + points to the best available binary. + + Instruction caches are enabled in lstopo by default. Use --no-icaches + to disable them. + + Add -t/--threads to show threads in hwloc-ps. +* Removal of obsolete components + + Remove the old cpuset interface (hwloc/cpuset.h) which is deprecated and + superseded by the bitmap API (hwloc/bitmap.h) since v1.1. + hwloc_cpuset and nodeset types are still defined, but all hwloc_cpuset_* + compatibility wrappers are now gone. + + Remove Linux libnuma conversion helpers for the deprecated and + broken nodemask_t interface. + + Remove support for "Proc" type name, it was superseded by "PU" in v1.0. + + Remove hwloc-mask symlinks, it was replaced by hwloc-calc in v1.0. +* Misc + + Fix PCIe 3.0 link speed computation. + + Non-printable characters are dropped from strings during XML export. + + Fix importing of escaped characters with the minimalistic XML backend. + + Assert hwloc_is_thissystem() in several I/O related helpers. + + Fix some memory leaks in the x86 backend for FreeBSD. + + Minor fixes to ease native builds on Windows. + + Limit the number of retries when operating on all threads within a + process on Linux if the list of threads is heavily getting modified. + + +Version 1.4.3 +------------- +* This release is only meant to fix the pciutils license issue when upgrading + to hwloc v1.5 or later is not possible. It contains several other minor + fixes but ignores many of them that are only in v1.5 or later. +* Use libpciaccess instead of pciutils/libpci by default for I/O discovery. + pciutils/libpci is only used if --enable-libpci is given to configure + because its GPL license may taint hwloc. See the Installation section + in the documentation for details. +* Fix PCIe 3.0 link speed computation. +* Fix importing of escaped characters with the minimalistic XML backend. +* Fix a memory leak in the x86 backend. + + +Version 1.4.2 +------------- +* Fix build on Solaris 9 and earlier when fabsf() is not a compiler + built-in. Thanks to Igor Galić for reporting the problem. +* Fix support for more than 32 processors on Windows. Thanks to Hartmut + Kaiser for reporting the problem. +* Fix process-wide binding and cpulocation routines on Linux when some + threads disappear in the meantime. Thanks to Vlad Roubtsov for reporting + the issue. +* Make installed scripts executable. Thanks to Jirka Hladky for reporting + the problem. +* Fix libtool revision management when building for Windows. This fix was + also released as hwloc v1.4.1.1 Windows builds. Thanks to Hartmut Kaiser + for reporting the problem. +* Fix the __hwloc_inline keyword in public headers when compiling with a + C++ compiler. +* Add Port info attribute to network OS devices inside OpenFabrics PCI + devices so as to identify which interface corresponds to which port. +* Document requirements for interoperability helpers: I/O devices discovery + is required for some of them; the topology must match the current host + for most of them. + + +Version 1.4.1 +------------- +* This release contains all changes from v1.3.2. +* Fix hwloc_alloc_membind, thanks Karl Napf for reporting the issue. +* Fix memory leaks in some get_membind() functions. +* Fix helpers converting from Linux libnuma to hwloc (hwloc/linux-libnuma.h) + in case of out-of-order NUMA node ids. +* Fix some overzealous assertions in the distance grouping code. +* Workaround BIOS reporting empty I/O locality in CUDA and OpenFabrics + helpers on Linux. Thanks to Albert Solernou for reporting the problem. +* Install a valgrind suppressions file hwloc-valgrind.supp (see the FAQ). +* Fix memory binding documentation. Thanks to Karl Napf for reporting the + issues. + + +Version 1.4.0 (does not contain all v1.3.2 changes) +------------- +* Major features + + Add "custom" interface and "assembler" tools to build multi-node + topology. See the Multi-node Topologies section in the documentation + for details. +* Interface improvements + + Add symmetric_subtree object attribute to ease assumptions when consulting + regular symmetric topologies. + + Add a CPUModel and CPUType info attribute to Socket objects on Linux + and Solaris. + + Add hwloc_get_obj_index_inside_cpuset() to retrieve the "logical" index + of an object within a subtree of the topology. + + Add more NVIDIA CUDA helpers in cuda.h and cudart.h to find hwloc objects + corresponding to CUDA devices. +* Discovery improvements + + Add a group object above partial distance matrices to make sure + the matrices are available in the final topology, except when this + new object would contradict the existing hierarchy. + + Grouping by distances now also works when loading from XML. + + Fix some corner cases in object insertion, for instance when dealing + with NUMA nodes without any CPU. +* Backends + + Implement hwloc_get_area_membind() on Linux. + + Honor I/O topology flags when importing from XML. + + Further improve XML-related error checking and reporting. + + Hide synthetic topology error messages unless HWLOC_SYNTHETIC_VERBOSE=1. +* Tools + + Add synthetic exporting of symmetric topologies to lstopo. + + lstopo --horiz and --vert can now be applied to some specific object types. + + lstopo -v -p now displays distance matrices with physical indexes. + + Add hwloc-distances utility to list distances. +* Documentation + + Fix and/or document the behavior of most inline functions in hwloc/helper.h + when the topology contains some I/O or Misc objects. + + Backend documentation enhancements. +* Bug fixes + + Fix missing last bit in hwloc_linux_get_thread_cpubind(). + Thanks to Carolina Gómez-Tostón Gutiérrez for reporting the issue. + + Fix FreeBSD build without cpuid support. + + Fix several Windows build issues. + + Fix inline keyword definition in public headers. + + Fix dependencies in the embedded library. + + Improve visibility support detection. Thanks to Dave Love for providing + the patch. + + Remove references to internal symbols in the tools. + + +Version 1.3.3 +------------- +* This release is only meant to fix the pciutils license issue when upgrading + to hwloc v1.4 or later is not possible. It contains several other minor + fixes but ignores many of them that are only in v1.4 or later. +* Use libpciaccess instead of pciutils/libpci by default for I/O discovery. + pciutils/libpci is only used if --enable-libpci is given to configure + because its GPL license may taint hwloc. See the Installation section + in the documentation for details. + + +Version 1.3.2 +------------- +* Fix missing last bit in hwloc_linux_get_thread_cpubind(). + Thanks to Carolina Gómez-Tostón Gutiérrez for reporting the issue. +* Fix build with -mcmodel=medium. Thanks to Devendar Bureddy for reporting + the issue. +* Fix build with Solaris Studio 12 compiler when XML is disabled. + Thanks to Paul H. Hargrove for reporting the problem. +* Fix installation with old GNU sed, for instance on Red Hat 8. + Thanks to Paul H. Hargrove for reporting the problem. +* Fix PCI locality when Linux cgroups restrict the available CPUs. +* Fix floating point issue when grouping by distance on mips64 architecture. + Thanks to Paul H. Hargrove for reporting the problem. +* Fix conversion from/to Linux libnuma when some NUMA nodes have no memory. +* Fix support for gccfss compilers with broken ffs() support. Thanks to + Paul H. Hargrove for reporting the problem and providing a patch. +* Fix FreeBSD build without cpuid support. +* Fix several Windows build issues. +* Fix inline keyword definition in public headers. +* Fix dependencies in the embedded library. +* Detect when a compiler such as xlc may not report compile errors + properly, causing some configure checks to be wrong. Thanks to + Paul H. Hargrove for reporting the problem and providing a patch. +* Improve visibility support detection. Thanks to Dave Love for providing + the patch. +* Remove references to internal symbols in the tools. +* Fix installation on systems with limited command-line size. + Thanks to Paul H. Hargrove for reporting the problem. +* Further improve XML-related error checking and reporting. + + +Version 1.3.1 +------------- +* Fix pciutils detection with pkg-config when not installed in standard + directories. +* Fix visibility options detection with the Solaris Studio compiler. + Thanks to Igor Galić and Terry Dontje for reporting the problems. +* Fix support for old Linux sched.h headers such as those found + on Red Hat 8. Thanks to Paul H. Hargrove for reporting the problems. +* Fix inline and attribute support for Solaris compilers. Thanks to + Dave Love for reporting the problems. +* Print a short summary at the end of the configure output. Thanks to + Stefan Eilemann for the suggestion. +* Add --disable-libnuma configure option to disable libnuma-based + memory binding support on Linux. Thanks to Rayson Ho for the + suggestion. +* Make hwloc's configure script properly obey $PKG_CONFIG. Thanks to + Nathan Phillip Brink for raising the issue. +* Silence some harmless pciutils warnings, thanks to Paul H. Hargrove + for reporting the problem. +* Fix the documentation with respect to hwloc_pid_t and hwloc_thread_t + being either pid_t and pthread_t on Unix, or HANDLE on Windows. + + +Version 1.3.0 +------------- +* Major features + + Add I/O devices and bridges to the topology using the pciutils + library. Only enabled after setting the relevant flag with + hwloc_topology_set_flags() before hwloc_topology_load(). See the + I/O Devices section in the documentation for details. +* Discovery improvements + + Add associativity to the cache attributes. + + Add support for s390/z11 "books" on Linux. + + Add the HWLOC_GROUPING_ACCURACY environment variable to relax + distance-based grouping constraints. See the Environment Variables + section in the documentation for details about grouping behavior + and configuration. + + Allow user-given distance matrices to remove or replace those + discovered by the OS backend. +* XML improvements + + XML is now always supported: a minimalistic custom import/export + code is used when libxml2 is not available. It is only guaranteed + to read XML files generated by hwloc. + + hwloc_topology_export_xml() and export_xmlbuffer() now return an + integer. + + Add hwloc_free_xmlbuffer() to free the buffer allocated by + hwloc_topology_export_xmlbuffer(). + + Hide XML topology error messages unless HWLOC_XML_VERBOSE=1. +* Minor API updates + + Add hwloc_obj_add_info to customize object info attributes. +* Tools + + lstopo now displays I/O devices by default. Several options are + added to configure the I/O discovery. + + hwloc-calc and hwloc-bind now accept I/O devices as input. + + Add --restrict option to hwloc-calc and hwloc-distribute. + + Add --sep option to change the output field separator in hwloc-calc. + + Add --whole-system option to hwloc-ps. + + +Version 1.2.2 +------------- +* Fix build on AIX 5.2, thanks Utpal Kumar Ray for the report. +* Fix XML import of very large page sizes or counts on 32bits platform, + thanks to Karsten Hopp for the RedHat ticket. +* Fix crash when administrator limitations such as Linux cgroup require + to restrict distance matrices. Thanks to Ake Sandgren for reporting the + problem. +* Fix the removal of objects such as AMD Magny-Cours dual-node sockets + in case of administrator restrictions. +* Improve error reporting and messages in case of wrong synthetic topology + description. +* Several other minor internal fixes and documentation improvements. + + +Version 1.2.1 +------------- +* Improve support of AMD Bulldozer "Compute-Unit" modules by detecting + logical processors with different core IDs on Linux. +* Fix hwloc-ps crash when listing processes from another Linux cpuset. + Thanks to Carl Smith for reporting the problem. +* Fix build on AIX and Solaris. Thanks to Carl Smith and Andreas Kupries + for reporting the problems. +* Fix cache size detection on Darwin. Thanks to Erkcan Özcan for reporting + the problem. +* Make configure fail if --enable-xml or --enable-cairo is given and + proper support cannot be found. Thanks to Andreas Kupries for reporting + the XML problem. +* Fix spurious L1 cache detection on AIX. Thanks to Hendryk Bockelmann + for reporting the problem. +* Fix hwloc_get_last_cpu_location(THREAD) on Linux. Thanks to Gabriele + Fatigati for reporting the problem. +* Fix object distance detection on Solaris. +* Add pthread_self weak symbol to ease static linking. +* Minor documentation fixes. + + +Version 1.2.0 +------------- +* Major features + + Expose latency matrices in the API as an array of distance structures + within objects. Add several helpers to find distances. + + Add hwloc_topology_set_distance_matrix() and environment variables + to provide a matrix of distances between a given set of objects. + + Add hwloc_get_last_cpu_location() and hwloc_get_proc_last_cpu_location() + to retrieve the processors where a process or thread recently ran. + - Add the corresponding --get-last-cpu-location option to hwloc-bind. + + Add hwloc_topology_restrict() to restrict an existing topology to a + given cpuset. + - Add the corresponding --restrict option to lstopo. +* Minor API updates + + Add hwloc_bitmap_list_sscanf/snprintf/asprintf to convert between bitmaps + and strings such as 4-5,7-9,12,15- + + hwloc_bitmap_set/clr_range() now support infinite ranges. + + Clarify the difference between inserting Misc objects by cpuset or by + parent. + + hwloc_insert_misc_object_by_cpuset() now returns NULL in case of error. +* Discovery improvements + + x86 backend (for freebsd): add x2APIC support + + Support standard device-tree phandle, to get better support on e.g. ARM + systems providing it. + + Detect cache size on AIX. Thanks Christopher and IBM. + + Improve grouping to support asymmetric topologies. +* Tools + + Command-line tools now support "all" and "root" special locations + consisting in the entire topology, as well as type names with depth + attributes such as L2 or Group4. + + hwloc-calc improvements: + - Add --number-of/-N option to report the number of objects of a given + type or depth. + - -I is now equivalent to --intersect for listing the indexes of + objects of a given type or depth that intersects the input. + - Add -H to report the output as a hierarchical combination of types + and depths. + + Add --thissystem to lstopo. + + Add lstopo-win, a console-less lstopo variant on Windows. +* Miscellaneous + + Remove C99 usage from code base. + + Rename hwloc-gather-topology.sh into hwloc-gather-topology + + Fix AMD cache discovery on freebsd when there is no L3 cache, thanks + Andriy Gapon for the fix. + + +Version 1.1.2 +------------- +* Fix a segfault in the distance-based grouping code when some objects + are not placed in any group. Thanks to Bernd Kallies for reporting + the problem and providing a patch. +* Fix the command-line parsing of hwloc-bind --mempolicy interleave. + Thanks to Guy Streeter for reporting the problem. +* Stop truncating the output in hwloc_obj_attr_snprintf() and in the + corresponding lstopo output. Thanks to Guy Streeter for reporting the + problem. +* Fix object levels ordering in synthetic topologies. +* Fix potential incoherency between device tree and kernel information, + when SMT is disabled on Power machines. +* Fix and document the behavior of hwloc_topology_set_synthetic() in case + of invalid argument. Thanks to Guy Streeter for reporting the problem. +* Add some verbose error message reporting when it looks like the OS + gives erroneous information. +* Do not include unistd.h and stdint.h in public headers on Windows. +* Move config.h files into their own subdirectories to avoid name + conflicts when AC_CONFIG_HEADERS adds -I's for them. +* Remove the use of declaring variables inside "for" loops. +* Some other minor fixes. +* Many minor documentation fixes. + + +Version 1.1.1 +------------- +* Add hwloc_get_api_version() which returns the version of hwloc used + at runtime. Thanks to Guy Streeter for the suggestion. +* Fix the number of hugepages reported for NUMA nodes on Linux. +* Fix hwloc_bitmap_to_ulong() right after allocating the bitmap. + Thanks to Bernd Kallies for reporting the problem. +* Fix hwloc_bitmap_from_ith_ulong() to properly zero the first ulong. + Thanks to Guy Streeter for reporting the problem. +* Fix hwloc_get_membind_nodeset() on Linux. + Thanks to Bernd Kallies for reporting the problem and providing a patch. +* Fix some file descriptor leaks in the Linux discovery. +* Fix the minimum width of NUMA nodes, caches and the legend in the graphical + lstopo output. Thanks to Jirka Hladky for reporting the problem. +* Various fixes to bitmap conversion from/to taskset-strings. +* Fix and document snprintf functions behavior when the buffer size is too + small or zero. Thanks to Guy Streeter for reporting the problem. +* Fix configure to avoid spurious enabling of the cpuid backend. + Thanks to Tim Anderson for reporting the problem. +* Cleanup error management in hwloc-gather-topology.sh. + Thanks to Jirka Hladky for reporting the problem and providing a patch. +* Add a manpage and usage for hwloc-gather-topology.sh on Linux. + Thanks to Jirka Hladky for providing a patch. +* Memory binding documentation enhancements. + + +Version 1.1.0 +------------- + +* API + + Increase HWLOC_API_VERSION to 0x00010100 so that API changes may be + detected at build-time. + + Add a memory binding interface. + + The cpuset API (hwloc/cpuset.h) is now deprecated. It is replaced by + the bitmap API (hwloc/bitmap.h) which offers the same features with more + generic names since it applies to CPU sets, node sets and more. + Backward compatibility with the cpuset API and ABI is still provided but + it will be removed in a future release. + Old types (hwloc_cpuset_t, ...) are still available as a way to clarify + what kind of hwloc_bitmap_t each API function manipulates. + Upgrading to the new API only requires to replace hwloc_cpuset_ function + calls with the corresponding hwloc_bitmap_ calls, with the following + renaming exceptions: + - hwloc_cpuset_cpu -> hwloc_bitmap_only + - hwloc_cpuset_all_but_cpu -> hwloc_bitmap_allbut + - hwloc_cpuset_from_string -> hwloc_bitmap_sscanf + + Add an `infos' array in each object to store couples of info names and + values. It enables generic storage of things like the old dmi board infos + that were previously stored in machine specific attributes. + + Add linesize cache attribute. +* Features + + Bitmaps (and thus CPU sets and node sets) are dynamically (re-)allocated, + the maximal number of CPUs (HWLOC_NBMAXCPUS) has been removed. + + Improve the distance-based grouping code to better support irregular + distance matrices. + + Add support for device-tree to get cache information (useful on Power + architectures). +* Helpers + + Add NVIDIA CUDA helpers in cuda.h and cudart.h to ease interoperability + with CUDA Runtime and Driver APIs. + + Add Myrinet Express helper in myriexpress.h to ease interoperability. +* Tools + + lstopo now displays physical/OS indexes by default in graphical mode + (use -l to switch back to logical indexes). The textual output still uses + logical by default (use -p to switch to physical indexes). + + lstopo prefixes logical indexes with `L#' and physical indexes with `P#'. + Physical indexes are also printed as `P#N' instead of `phys=N' within + object attributes (in parentheses). + + Add a legend at the bottom of the lstopo graphical output, use --no-legend + to remove it. + + Add hwloc-ps to list process' bindings. + + Add --membind and --mempolicy options to hwloc-bind. + + Improve tools command-line options by adding a generic --input option + (and more) which replaces the old --xml, --synthetic and --fsys-root. + + Cleanup lstopo output configuration by adding --output-format. + + Add --intersect in hwloc-calc, and replace --objects with --largest. + + Add the ability to work on standard input in hwloc-calc. + + Add --from, --to and --at in hwloc-distrib. + + Add taskset-specific functions and command-line tools options to + manipulate CPU set strings in the format of the taskset program. + + Install hwloc-gather-topology.sh on Linux. + + +Version 1.0.3 +------------- + +* Fix support for Linux cpuset when emulated by a cgroup mount point. +* Remove unneeded runtime dependency on libibverbs.so in the library and + all utils programs. +* Fix hwloc_cpuset_to_linux_libnuma_ulongs in case of non-linear OS-indexes + for NUMA nodes. +* lstopo now displays physical/OS indexes by default in graphical mode + (use -l to switch back to logical indexes). The textual output still uses + logical by default (use -p to switch to physical indexes). + + +Version 1.0.2 +------------- + +* Public headers can now be included directly from C++ programs. +* Solaris fix for non-contiguous cpu numbers. Thanks to Rolf vandeVaart for + reporting the issue. +* Darwin 10.4 fix. Thanks to Olivier Cessenat for reporting the issue. +* Revert 1.0.1 patch that ignored sockets with unknown ID values since it + only slightly helped POWER7 machines with old Linux kernels while it + prevents recent kernels from getting the complete POWER7 topology. +* Fix hwloc_get_common_ancestor_obj(). +* Remove arch-specific bits in public headers. +* Some fixes in the lstopo graphical output. +* Various man page clarifications and minor updates. + + +Version 1.0.1 +------------- + +* Various Solaris fixes. Thanks to Yannick Martin for reporting the issue. +* Fix "non-native" builds on x86 platforms (e.g., when building 32 + bit executables with compilers that natively build 64 bit). +* Ignore sockets with unknown ID values (which fixes issues on POWER7 + machines). Thanks to Greg Bauer for reporting the issue. +* Various man page clarifications and minor updates. +* Fixed memory leaks in hwloc_setup_group_from_min_distance_clique(). +* Fix cache type filtering on MS Windows 7. Thanks to Αλέξανδρος + Παπαδογιαννάκ for reporting the issue. +* Fixed warnings when compiling with -DNDEBUG. + + +Version 1.0.0 +------------- + +* The ABI of the library has changed. +* Backend updates + + Add FreeBSD support. + + Add x86 cpuid based backend. + + Add Linux cgroup support to the Linux cpuset code. + + Support binding of entire multithreaded process on Linux. + + Fix and enable Group support in Windows. + + Cleanup XML export/import. +* Objects + + HWLOC_OBJ_PROC is renamed into HWLOC_OBJ_PU for "Processing Unit", + its stringified type name is now "PU". + + Use new HWLOC_OBJ_GROUP objects instead of MISC when grouping + objects according to NUMA distances or arbitrary OS aggregation. + + Rework memory attributes. + + Add different cpusets in each object to specify processors that + are offline, unavailable, ... + + Cleanup the storage of object names and DMI infos. +* Features + + Add support for looking up specific PID topology information. + + Add hwloc_topology_export_xml() to export the topology in a XML file. + + Add hwloc_topology_get_support() to retrieve the supported features + for the current topology context. + + Support non-SYSTEM object as the root of the tree, use MACHINE in + most common cases. + + Add hwloc_get_*cpubind() routines to retrieve the current binding + of processes and threads. +* API + + Add HWLOC_API_VERSION to help detect the currently used API version. + + Add missing ending "e" to *compare* functions. + + Add several routines to emulate PLPA functions. + + Rename and rework the cpuset and/or/xor/not/clear operators to output + their result in a dedicated argument instead of modifying one input. + + Deprecate hwloc_obj_snprintf() in favor of hwloc_obj_type/attr_snprintf(). + + Clarify the use of parent and ancestor in the API, do not use father. + + Replace hwloc_get_system_obj() with hwloc_get_root_obj(). + + Return -1 instead of HWLOC_OBJ_TYPE_MAX in the API since the latter + isn't public. + + Relax constraints in hwloc_obj_type_of_string(). + + Improve displaying of memory sizes. + + Add 0x prefix to cpuset strings. +* Tools + + lstopo now displays logical indexes by default, use --physical to + revert back to OS/physical indexes. + + Add colors in the lstopo graphical outputs to distinguish between online, + offline, reserved, ... objects. + + Extend lstopo to show cpusets, filter objects by type, ... + + Renamed hwloc-mask into hwloc-calc which supports many new options. +* Documentation + + Add a hwloc(7) manpage containing general information. + + Add documentation about how to switch from PLPA to hwloc. + + Cleanup the distributed documentation files. +* Miscellaneous + + Many compilers warning fixes. + + Cleanup the ABI by using the visibility attribute. + + Add project embedding support. + + +Version 0.9.4 (unreleased) +-------------------------- + +* Fix reseting colors to normal in lstopo -.txt output. +* Fix Linux pthread_t binding error report. + + +Version 0.9.3 +------------- + +* Fix autogen.sh to work with Autoconf 2.63. +* Fix various crashes in particular conditions: + - xml files with root attributes + - offline CPUs + - partial sysfs support + - unparseable /proc/cpuinfo + - ignoring NUMA level while Misc level have been generated +* Tweak documentation a bit +* Do not require the pthread library for binding the current thread on Linux +* Do not erroneously consider the sched_setaffinity prototype is the old version + when there is actually none. +* Fix _syscall3 compilation on archs for which we do not have the + sched_setaffinity system call number. +* Fix AIX binding. +* Fix libraries dependencies: now only lstopo depends on libtermcap, fix + binutils-gold link +* Have make check always build and run hwloc-hello.c +* Do not limit size of a cpuset. + + +Version 0.9.2 +------------- + +* Trivial documentation changes. + + +Version 0.9.1 +------------- + +* Re-branded to "hwloc" and moved to the Open MPI project, relicensed under the + BSD license. +* The prefix of all functions and tools is now hwloc, and some public + functions were also renamed for real. +* Group NUMA nodes into Misc objects according to their physical distance + that may be reported by the OS/BIOS. + May be ignored by setting HWLOC_IGNORE_DISTANCES=1 in the environment. +* Ignore offline CPUs on Solaris. +* Improved binding support on AIX. +* Add HP-UX support. +* CPU sets are now allocated/freed dynamically. +* Add command line options to tune the lstopo graphical output, add + semi-graphical textual output +* Extend topobind to support multiple cpusets or objects on the command + line as topomask does. +* Add an Infiniband-specific helper hwloc/openfabrics-verbs.h to retrieve + the physical location of IB devices. + + +Version 0.9 (libtopology) +------------------------- + +* First release. diff --git a/opal/mca/hwloc/hwloc2x/hwloc/README b/opal/mca/hwloc/hwloc2x/hwloc/README new file mode 100644 index 00000000000..eadf3bc6a00 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/README @@ -0,0 +1,65 @@ +Introduction + +The Hardware Locality (hwloc) software project aims at easing the process of +discovering hardware resources in parallel architectures. It offers +command-line tools and a C API for consulting these resources, their locality, +attributes, and interconnection. hwloc primarily aims at helping +high-performance computing (HPC) applications, but is also applicable to any +project seeking to exploit code and/or data locality on modern computing +platforms. + +hwloc is actually made of two subprojects distributed together: + + * The original hwloc project for describing the internals of computing nodes. + It is described in details between sections Hardware Locality (hwloc) + Introduction and Network Locality (netloc). + * The network-oriented companion called netloc (Network Locality), described + in details starting at section Network Locality (netloc). Netloc may be + disabled, but the original hwloc cannot. Both hwloc and netloc APIs are + documented after these sections. + +Installation + +hwloc (http://www.open-mpi.org/projects/hwloc/) is available under the BSD +license. It is hosted as a sub-project of the overall Open MPI project (http:// +www.open-mpi.org/). Note that hwloc does not require any functionality from +Open MPI -- it is a wholly separate (and much smaller!) project and code base. +It just happens to be hosted as part of the overall Open MPI project. + +Nightly development snapshots are available on the web site. Additionally, the +code can be directly cloned from Git: + +shell$ git clone https://github.com/open-mpi/hwloc.git +shell$ cd hwloc +shell$ ./autogen.sh + +Note that GNU Autoconf >=2.63, Automake >=1.11 and Libtool >=2.2.6 are required +when building from a Git clone. + +Installation by itself is the fairly common GNU-based process: + +shell$ ./configure --prefix=... +shell$ make +shell$ make install + +hwloc- and netloc-specific configure options and requirements are documented in +sections hwloc Installation and Netloc Installation respectively. + +Also note that if you install supplemental libraries in non-standard locations, +hwloc's configure script may not be able to find them without some help. You +may need to specify additional CPPFLAGS, LDFLAGS, or PKG_CONFIG_PATH values on +the configure command line. + +For example, if libpciaccess was installed into /opt/pciaccess, hwloc's +configure script may not find it be default. Try adding PKG_CONFIG_PATH to the +./configure command line, like this: + +./configure PKG_CONFIG_PATH=/opt/pciaccess/lib/pkgconfig ... + +Running the "lstopo" tool is a good way to check as a graphical output whether +hwloc properly detected the architecture of your node. Netloc command-line +tools can be used to display the network topology interconnecting your nodes. + + + +See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation. diff --git a/opal/mca/hwloc/hwloc2x/hwloc/VERSION b/opal/mca/hwloc/hwloc2x/hwloc/VERSION new file mode 100644 index 00000000000..d3bb6ed2012 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/VERSION @@ -0,0 +1,47 @@ +# This is the VERSION file for hwloc, describing the precise version +# of hwloc in this distribution. The various components of the version +# number below are combined to form a single version number string. + +# major, minor, and release are generally combined in the form +# ... If release is zero, then it is omitted. + +# Please update HWLOC_VERSION in contrib/windows/private_config.h too. + +major=2 +minor=0 +release=0 + +# greek is used for alpha or beta release tags. If it is non-empty, +# it will be appended to the version number. It does not have to be +# numeric. Common examples include a1 (alpha release 1), b1 (beta +# release 1), sc2005 (Super Computing 2005 release). The only +# requirement is that it must be entirely printable ASCII characters +# and have no white space. + +greek=a1 + +# The date when this release was created + +date="Unreleased developer copy" + +# If snapshot=1, then use the value from snapshot_version as the +# entire hwloc version (i.e., ignore major, minor, release, and +# greek). This is only set to 1 when making snapshot tarballs. +snapshot=1 +snapshot_version=${major}.${minor}.${release}${greek}-git + +# The shared library version of hwloc's public library. This version +# is maintained in accordance with the "Library Interface Versions" +# chapter from the GNU Libtool documentation. Notes: + +# 1. Since version numbers are associated with *releases*, the version +# number maintained on the hwloc git master (and developer branches) +# is always 0:0:0. + +# 2. Version numbers are described in the Libtool current:revision:age +# format. + +libhwloc_so_version=0:0:0 +libnetloc_so_version=0:0:0 + +# Please also update the lines in contrib/windows/libhwloc.vcxproj diff --git a/opal/mca/hwloc/hwloc2x/hwloc/autogen.sh b/opal/mca/hwloc/hwloc2x/hwloc/autogen.sh new file mode 100755 index 00000000000..df4280218e1 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/autogen.sh @@ -0,0 +1,2 @@ +: +autoreconf ${autoreconf_args:-"-ivf"} diff --git a/opal/mca/hwloc/hwloc2x/hwloc/config/distscript.sh b/opal/mca/hwloc/hwloc2x/hwloc/config/distscript.sh new file mode 100755 index 00000000000..d72a3fd3052 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/config/distscript.sh @@ -0,0 +1,130 @@ +#!/bin/sh -f +# +# Copyright © 2004-2005 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright © 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright © 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright © 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright © 2010-2014 Inria. All rights reserved. +# Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +builddir="`pwd`" + +srcdir=$1 +cd "$srcdir" +srcdir=`pwd` +cd "$builddir" + +distdir="$builddir/$2" +HWLOC_VERSION=$3 + +if test "$distdir" = ""; then + echo "Must supply relative distdir as argv[2] -- aborting" + exit 1 +elif test "$HWLOC_VERSION" = ""; then + echo "Must supply version as argv[1] -- aborting" + exit 1 +fi + +#======================================================================== + +start=`date` +cat < $i << EOF +# This is a dummy file that is not needed in embedded mode, +# but sadly, automake *requires* it +EOF +done + diff --git a/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc.m4 b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc.m4 new file mode 100644 index 00000000000..df4764a5788 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc.m4 @@ -0,0 +1,1364 @@ +dnl -*- Autoconf -*- +dnl +dnl Copyright © 2009-2016 Inria. All rights reserved. +dnl Copyright © 2009-2012, 2015-2017 Université Bordeaux +dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana +dnl University Research and Technology +dnl Corporation. All rights reserved. +dnl Copyright © 2004-2012 The Regents of the University of California. +dnl All rights reserved. +dnl Copyright © 2004-2008 High Performance Computing Center Stuttgart, +dnl University of Stuttgart. All rights reserved. +dnl Copyright © 2006-2017 Cisco Systems, Inc. All rights reserved. +dnl Copyright © 2012 Blue Brain Project, BBP/EPFL. All rights reserved. +dnl Copyright © 2012 Oracle and/or its affiliates. All rights reserved. +dnl See COPYING in top-level directory. + +# Main hwloc m4 macro, to be invoked by the user +# +# Expects two or three paramters: +# 1. Configuration prefix +# 2. What to do upon success +# 3. What to do upon failure +# 4. If non-empty, print the announcement banner +# +AC_DEFUN([HWLOC_SETUP_CORE],[ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([AC_CANONICAL_TARGET]) + AC_REQUIRE([AC_PROG_CC]) + + AS_IF([test "x$4" != "x"], + [cat < header file.]) + ]) + AC_CHECK_HEADERS([sys/mman.h]) + + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0601" + AC_CHECK_TYPES([KAFFINITY, + PROCESSOR_CACHE_TYPE, + CACHE_DESCRIPTOR, + LOGICAL_PROCESSOR_RELATIONSHIP, + RelationProcessorPackage, + SYSTEM_LOGICAL_PROCESSOR_INFORMATION, + GROUP_AFFINITY, + PROCESSOR_RELATIONSHIP, + NUMA_NODE_RELATIONSHIP, + CACHE_RELATIONSHIP, + PROCESSOR_GROUP_INFO, + GROUP_RELATIONSHIP, + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, + PSAPI_WORKING_SET_EX_BLOCK, + PSAPI_WORKING_SET_EX_INFORMATION, + PROCESSOR_NUMBER], + [],[],[[#include ]]) + CPPFLAGS="$old_CPPFLAGS" + AC_CHECK_LIB([gdi32], [main], + [HWLOC_LIBS="-lgdi32 $HWLOC_LIBS" + AC_DEFINE([HAVE_LIBGDI32], 1, [Define to 1 if we have -lgdi32])]) + AC_CHECK_LIB([user32], [PostQuitMessage], [hwloc_have_user32="yes"]) + + AC_CHECK_HEADER([windows.h], [ + AC_DEFINE([HWLOC_HAVE_WINDOWS_H], [1], [Define to 1 if you have the `windows.h' header.]) + ]) + + AC_CHECK_HEADERS([sys/lgrp_user.h], [ + AC_CHECK_LIB([lgrp], [lgrp_init], + [HWLOC_LIBS="-llgrp $HWLOC_LIBS" + AC_DEFINE([HAVE_LIBLGRP], 1, [Define to 1 if we have -llgrp]) + AC_CHECK_DECLS([lgrp_latency_cookie],,,[[#include ]]) + ]) + ]) + AC_CHECK_HEADERS([kstat.h], [ + AC_CHECK_LIB([kstat], [main], + [HWLOC_LIBS="-lkstat $HWLOC_LIBS" + AC_DEFINE([HAVE_LIBKSTAT], 1, [Define to 1 if we have -lkstat])]) + ]) + + AC_CHECK_DECLS([fabsf], [ + AC_CHECK_LIB([m], [fabsf], + [HWLOC_LIBS="-lm $HWLOC_LIBS"]) + ], [], [[#include ]]) + + AC_CHECK_HEADERS([picl.h], [ + AC_CHECK_LIB([picl], [picl_initialize], + [HWLOC_LIBS="-lpicl $HWLOC_LIBS"])]) + + AC_CHECK_DECLS([_SC_NPROCESSORS_ONLN, + _SC_NPROCESSORS_CONF, + _SC_NPROC_ONLN, + _SC_NPROC_CONF, + _SC_PAGESIZE, + _SC_PAGE_SIZE, + _SC_LARGE_PAGESIZE],,[:],[[#include ]]) + + AC_HAVE_HEADERS([mach/mach_host.h]) + AC_HAVE_HEADERS([mach/mach_init.h], [ + AC_CHECK_FUNCS([host_info]) + ]) + + AC_CHECK_HEADERS([sys/param.h]) + AC_CHECK_HEADERS([sys/sysctl.h], [ + AC_CHECK_DECLS([CTL_HW, HW_NCPU],,,[[ + #if HAVE_SYS_PARAM_H + #include + #endif + #include + ]]) + ],,[ + AC_INCLUDES_DEFAULT + #if HAVE_SYS_PARAM_H + #include + #endif + ]) + + AC_CHECK_DECLS([strtoull], [], [AC_CHECK_FUNCS([strtoull])], [AC_INCLUDES_DEFAULT]) + + # Needed for Windows in private/misc.h + AC_CHECK_TYPES([ssize_t]) + AC_CHECK_DECLS([snprintf], [], [], [AC_INCLUDES_DEFAULT]) + AC_CHECK_DECLS([strcasecmp], [], [], [AC_INCLUDES_DEFAULT]) + # strdup and putenv are declared in windows headers but marked deprecated + AC_CHECK_DECLS([_strdup], [], [], [AC_INCLUDES_DEFAULT]) + AC_CHECK_DECLS([_putenv], [], [], [AC_INCLUDES_DEFAULT]) + # Could add mkdir and access for hwloc-gather-cpuid.c on Windows + + # Do a full link test instead of just using AC_CHECK_FUNCS, which + # just checks to see if the symbol exists or not. For example, + # the prototype of sysctl uses u_int, which on some platforms + # (such as FreeBSD) is only defined under __BSD_VISIBLE, __USE_BSD + # or other similar definitions. So while the symbols "sysctl" and + # "sysctlbyname" might still be available in libc (which autoconf + # checks for), they might not be actually usable. + AC_TRY_LINK([ + #include + #include + #include + ], + [return sysctl(NULL,0,NULL,NULL,NULL,0);], + AC_DEFINE([HAVE_SYSCTL],[1],[Define to '1' if sysctl is present and usable])) + AC_TRY_LINK([ + #include + #include + #include + ], + [return sysctlbyname(NULL,NULL,NULL,NULL,0);], + AC_DEFINE([HAVE_SYSCTLBYNAME],[1],[Define to '1' if sysctlbyname is present and usable])) + + AC_CHECK_DECLS([getprogname], [], [], [AC_INCLUDES_DEFAULT]) + AC_CHECK_DECLS([getexecname], [], [], [AC_INCLUDES_DEFAULT]) + AC_CHECK_DECLS([GetModuleFileName], [], [], [#include ]) + # program_invocation_name and __progname may be available but not exported in headers + AC_MSG_CHECKING([for program_invocation_name]) + AC_TRY_LINK([ + #ifndef _GNU_SOURCE + # define _GNU_SOURCE + #endif + #include + #include + extern char *program_invocation_name; + ],[ + return printf("%s\n", program_invocation_name); + ], + [AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1], [Define to '1' if program_invocation_name is present and usable]) + AC_MSG_RESULT([yes]) + ],[AC_MSG_RESULT([no])]) + AC_MSG_CHECKING([for __progname]) + AC_TRY_LINK([ + #include + extern char *__progname; + ],[ + return printf("%s\n", __progname); + ], + [AC_DEFINE([HAVE___PROGNAME], [1], [Define to '1' if __progname is present and usable]) + AC_MSG_RESULT([yes]) + ],[AC_MSG_RESULT([no])]) + + case ${target} in + *-*-mingw*|*-*-cygwin*) + hwloc_pid_t=HANDLE + hwloc_thread_t=HANDLE + ;; + *) + hwloc_pid_t=pid_t + AC_CHECK_TYPES([pthread_t], [hwloc_thread_t=pthread_t], [:], [[#include ]]) + ;; + esac + AC_DEFINE_UNQUOTED(hwloc_pid_t, $hwloc_pid_t, [Define this to the process ID type]) + if test "x$hwloc_thread_t" != "x" ; then + AC_DEFINE_UNQUOTED(hwloc_thread_t, $hwloc_thread_t, [Define this to the thread ID type]) + fi + + _HWLOC_CHECK_DECL([sched_setaffinity], [ + AC_DEFINE([HWLOC_HAVE_SCHED_SETAFFINITY], [1], [Define to 1 if glibc provides a prototype of sched_setaffinity()]) + AS_IF([test "$HWLOC_STRICT_ARGS_CFLAGS" = "FAIL"],[ + AC_MSG_WARN([Support for sched_setaffinity() requires a C compiler which]) + AC_MSG_WARN([considers incorrect argument counts to be a fatal error.]) + AC_MSG_ERROR([Cannot continue.]) + ]) + AC_MSG_CHECKING([for old prototype of sched_setaffinity]) + hwloc_save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $HWLOC_STRICT_ARGS_CFLAGS" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #ifndef _GNU_SOURCE + # define _GNU_SOURCE + #endif + #include + static unsigned long mask; + ]], [[ sched_setaffinity(0, (void*) &mask); ]])], + [AC_DEFINE([HWLOC_HAVE_OLD_SCHED_SETAFFINITY], [1], [Define to 1 if glibc provides the old prototype (without length) of sched_setaffinity()]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + CFLAGS=$hwloc_save_CFLAGS + ], , [[ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif +#include +]]) + + AC_MSG_CHECKING([for working CPU_SET]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + cpu_set_t set; + ]], [[ CPU_ZERO(&set); CPU_SET(0, &set);]])], + [AC_DEFINE([HWLOC_HAVE_CPU_SET], [1], [Define to 1 if the CPU_SET macro works]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + + AC_MSG_CHECKING([for working CPU_SET_S]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + cpu_set_t *set; + ]], [[ + set = CPU_ALLOC(1024); + CPU_ZERO_S(CPU_ALLOC_SIZE(1024), set); + CPU_SET_S(CPU_ALLOC_SIZE(1024), 0, set); + CPU_FREE(set); + ]])], + [AC_DEFINE([HWLOC_HAVE_CPU_SET_S], [1], [Define to 1 if the CPU_SET_S macro works]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + + AC_MSG_CHECKING([for working syscall with 6 parameters]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + #include + ]], [[syscall(0, 1, 2, 3, 4, 5, 6);]])], + [AC_DEFINE([HWLOC_HAVE_SYSCALL], [1], [Define to 1 if function `syscall' is available with 6 parameters]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + + AC_PATH_PROGS([HWLOC_MS_LIB], [lib]) + AC_ARG_VAR([HWLOC_MS_LIB], [Path to Microsoft's Visual Studio `lib' tool]) + + AC_PATH_PROG([BASH], [bash]) + + AC_CHECK_FUNCS([ffs], [ + _HWLOC_CHECK_DECL([ffs],[ + AC_DEFINE([HWLOC_HAVE_DECL_FFS], [1], [Define to 1 if function `ffs' is declared by system headers]) + ]) + AC_DEFINE([HWLOC_HAVE_FFS], [1], [Define to 1 if you have the `ffs' function.]) + if ( $CC --version | grep gccfss ) >/dev/null 2>&1 ; then + dnl May be broken due to + dnl https://forums.oracle.com/forums/thread.jspa?threadID=1997328 + dnl TODO: a more selective test, since bug may be version dependent. + dnl We can't use AC_TRY_LINK because the failure does not appear until + dnl run/load time and there is currently no precedent for AC_TRY_RUN + dnl use in hwloc. --PHH + dnl For now, we're going with "all gccfss compilers are broken". + dnl Better to be safe and correct; it's not like this is + dnl performance-critical code, after all. + AC_DEFINE([HWLOC_HAVE_BROKEN_FFS], [1], + [Define to 1 if your `ffs' function is known to be broken.]) + fi + ]) + AC_CHECK_FUNCS([ffsl], [ + _HWLOC_CHECK_DECL([ffsl],[ + AC_DEFINE([HWLOC_HAVE_DECL_FFSL], [1], [Define to 1 if function `ffsl' is declared by system headers]) + ]) + AC_DEFINE([HWLOC_HAVE_FFSL], [1], [Define to 1 if you have the `ffsl' function.]) + ]) + + AC_CHECK_FUNCS([fls], [ + _HWLOC_CHECK_DECL([fls],[ + AC_DEFINE([HWLOC_HAVE_DECL_FLS], [1], [Define to 1 if function `fls' is declared by system headers]) + ]) + AC_DEFINE([HWLOC_HAVE_FLS], [1], [Define to 1 if you have the `fls' function.]) + ]) + AC_CHECK_FUNCS([flsl], [ + _HWLOC_CHECK_DECL([flsl],[ + AC_DEFINE([HWLOC_HAVE_DECL_FLSL], [1], [Define to 1 if function `flsl' is declared by system headers]) + ]) + AC_DEFINE([HWLOC_HAVE_FLSL], [1], [Define to 1 if you have the `flsl' function.]) + ]) + + AC_CHECK_FUNCS([clz], [ + _HWLOC_CHECK_DECL([clz],[ + AC_DEFINE([HWLOC_HAVE_DECL_CLZ], [1], [Define to 1 if function `clz' is declared by system headers]) + ]) + AC_DEFINE([HWLOC_HAVE_CLZ], [1], [Define to 1 if you have the `clz' function.]) + ]) + AC_CHECK_FUNCS([clzl], [ + _HWLOC_CHECK_DECL([clzl],[ + AC_DEFINE([HWLOC_HAVE_DECL_CLZL], [1], [Define to 1 if function `clzl' is declared by system headers]) + ]) + AC_DEFINE([HWLOC_HAVE_CLZL], [1], [Define to 1 if you have the `clzl' function.]) + ]) + + AS_IF([test "$hwloc_c_vendor" != "android"], [AC_CHECK_FUNCS([openat], [hwloc_have_openat=yes])]) + + + AC_CHECK_HEADERS([malloc.h]) + AC_CHECK_FUNCS([getpagesize memalign posix_memalign]) + + AC_CHECK_HEADERS([sys/utsname.h]) + AC_CHECK_FUNCS([uname]) + + dnl Don't check for valgrind in embedded mode because this may conflict + dnl with the embedder projects also checking for it. + dnl We only use Valgrind to nicely disable the x86 backend with a warning, + dnl but we can live without it in embedded mode (it auto-disables itself + dnl because of invalid CPUID outputs). + dnl Non-embedded checks usually go to hwloc_internal.m4 but this one is + dnl is really for the core library. + AS_IF([test "$hwloc_mode" != "embedded"], + [AC_CHECK_HEADERS([valgrind/valgrind.h]) + AC_CHECK_DECLS([RUNNING_ON_VALGRIND],,[:],[[#include ]]) + ],[ + AC_DEFINE([HAVE_DECL_RUNNING_ON_VALGRIND], [0], [Embedded mode; just assume we do not have Valgrind support]) + ]) + + AC_CHECK_HEADERS([pthread_np.h]) + AC_CHECK_DECLS([pthread_setaffinity_np],,[:],[[ + #include + #ifdef HAVE_PTHREAD_NP_H + # include + #endif + ]]) + AC_CHECK_DECLS([pthread_getaffinity_np],,[:],[[ + #include + #ifdef HAVE_PTHREAD_NP_H + # include + #endif + ]]) + AC_CHECK_FUNC([sched_setaffinity], [hwloc_have_sched_setaffinity=yes]) + AC_CHECK_HEADERS([sys/cpuset.h],,,[[#include ]]) + AC_CHECK_FUNCS([cpuset_setaffinity]) + AC_SEARCH_LIBS([pthread_getthrds_np], [pthread], + AC_DEFINE([HWLOC_HAVE_PTHREAD_GETTHRDS_NP], 1, `Define to 1 if you have pthread_getthrds_np') + ) + AC_CHECK_FUNCS([cpuset_setid]) + + # Linux libudev support + if test "x$enable_libudev" != xno; then + AC_CHECK_HEADERS([libudev.h], [ + AC_CHECK_LIB([udev], [udev_device_new_from_subsystem_sysname], [ + HWLOC_LIBS="$HWLOC_LIBS -ludev" + AC_DEFINE([HWLOC_HAVE_LIBUDEV], [1], [Define to 1 if you have libudev.]) + ]) + ]) + fi + + # PCI support via libpciaccess. NOTE: we do not support + # libpci/pciutils because that library is GPL and is incompatible + # with our BSD license. + hwloc_pciaccess_happy=no + if test "x$enable_io" != xno && test "x$enable_pci" != xno; then + hwloc_pciaccess_happy=yes + HWLOC_PKG_CHECK_MODULES([PCIACCESS], [pciaccess], [pci_slot_match_iterator_create], [pciaccess.h], [:], [hwloc_pciaccess_happy=no]) + + # Only add the REQUIRES if we got pciaccess through pkg-config. + # Otherwise we don't know if pciaccess.pc is installed + AS_IF([test "$hwloc_pciaccess_happy" = "yes"], [HWLOC_PCIACCESS_REQUIRES=pciaccess]) + + # Just for giggles, if we didn't find a pciaccess pkg-config, + # just try looking for its header file and library. + AS_IF([test "$hwloc_pciaccess_happy" != "yes"], + [AC_CHECK_HEADER([pciaccess.h], + [AC_CHECK_LIB([pciaccess], [pci_slot_match_iterator_create], + [hwloc_pciaccess_happy=yes + HWLOC_PCIACCESS_LIBS="-lpciaccess"]) + ]) + ]) + + AS_IF([test "$hwloc_pciaccess_happy" = "yes"], + [hwloc_components="$hwloc_components pci" + hwloc_pci_component_maybeplugin=1]) + fi + # If we asked for pci support but couldn't deliver, fail + AS_IF([test "$enable_pci" = "yes" -a "$hwloc_pciaccess_happy" = "no"], + [AC_MSG_WARN([Specified --enable-pci switch, but could not]) + AC_MSG_WARN([find appropriate support]) + AC_MSG_ERROR([Cannot continue])]) + # don't add LIBS/CFLAGS/REQUIRES yet, depends on plugins + + # OpenCL support + hwloc_opencl_happy=no + if test "x$enable_io" != xno && test "x$enable_opencl" != "xno"; then + hwloc_opencl_happy=yes + AC_CHECK_HEADERS([CL/cl_ext.h], [ + AC_CHECK_LIB([OpenCL], [clGetDeviceIDs], [HWLOC_OPENCL_LIBS="-lOpenCL"], [hwloc_opencl_happy=no]) + ], [hwloc_opencl_happy=no]) + fi + AC_SUBST(HWLOC_OPENCL_LIBS) + # Check if required extensions are available + if test "x$hwloc_opencl_happy" = "xyes"; then + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $HWLOC_OPENCL_CFLAGS" + tmp_save_LIBS="$LIBS" + LIBS="$LIBS $HWLOC_OPENCL_LIBS" + AC_CHECK_DECLS([CL_DEVICE_TOPOLOGY_AMD],[hwloc_opencl_amd_happy=yes],[:],[[#include ]]) + CFLAGS="$tmp_save_CFLAGS" + LIBS="$tmp_save_LIBS" + # We can't do anything without CL_DEVICE_TOPOLOGY_AMD so far, so disable OpenCL entirely if not found + test "x$hwloc_opencl_amd_happy" != "xyes" && hwloc_opencl_happy=no + fi + # If we asked for opencl support but couldn't deliver, fail + AS_IF([test "$enable_opencl" = "yes" -a "$hwloc_opencl_happy" = "no"], + [AC_MSG_WARN([Specified --enable-opencl switch, but could not]) + AC_MSG_WARN([find appropriate support]) + AC_MSG_ERROR([Cannot continue])]) + if test "x$hwloc_opencl_happy" = "xyes"; then + AC_DEFINE([HWLOC_HAVE_OPENCL], [1], [Define to 1 if you have the `OpenCL' library.]) + AC_SUBST([HWLOC_HAVE_OPENCL], [1]) + hwloc_components="$hwloc_components opencl" + hwloc_opencl_component_maybeplugin=1 + else + AC_SUBST([HWLOC_HAVE_OPENCL], [0]) + fi + # don't add LIBS/CFLAGS/REQUIRES yet, depends on plugins + + # CUDA support + hwloc_have_cuda=no + hwloc_have_cudart=no + if test "x$enable_io" != xno && test "x$enable_cuda" != "xno"; then + AC_CHECK_HEADERS([cuda.h], [ + AC_MSG_CHECKING(if CUDA_VERSION >= 3020) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#ifndef CUDA_VERSION +#error CUDA_VERSION undefined +#elif CUDA_VERSION < 3020 +#error CUDA_VERSION too old +#endif]], [[int i = 3;]])], + [AC_MSG_RESULT(yes) + AC_CHECK_LIB([cuda], [cuInit], + [AC_DEFINE([HAVE_CUDA], 1, [Define to 1 if we have -lcuda]) + hwloc_have_cuda=yes])], + [AC_MSG_RESULT(no)])]) + + AC_CHECK_HEADERS([cuda_runtime_api.h], [ + AC_MSG_CHECKING(if CUDART_VERSION >= 3020) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#ifndef CUDART_VERSION +#error CUDART_VERSION undefined +#elif CUDART_VERSION < 3020 +#error CUDART_VERSION too old +#endif]], [[int i = 3;]])], + [AC_MSG_RESULT(yes) + AC_CHECK_LIB([cudart], [cudaGetDeviceProperties], [ + HWLOC_CUDA_LIBS="-lcudart" + AC_SUBST(HWLOC_CUDA_LIBS) + hwloc_have_cudart=yes + AC_DEFINE([HWLOC_HAVE_CUDART], [1], [Define to 1 if you have the `cudart' SDK.]) + ]) + ]) + ]) + + AS_IF([test "$enable_cuda" = "yes" -a "$hwloc_have_cudart" = "no"], + [AC_MSG_WARN([Specified --enable-cuda switch, but could not]) + AC_MSG_WARN([find appropriate support]) + AC_MSG_ERROR([Cannot continue])]) + + if test "x$hwloc_have_cudart" = "xyes"; then + hwloc_components="$hwloc_components cuda" + hwloc_cuda_component_maybeplugin=1 + fi + fi + # don't add LIBS/CFLAGS yet, depends on plugins + + # NVML support + hwloc_nvml_happy=no + if test "x$enable_io" != xno && test "x$enable_nvml" != "xno"; then + hwloc_nvml_happy=yes + AC_CHECK_HEADERS([nvml.h], [ + AC_CHECK_LIB([nvidia-ml], [nvmlInit], [HWLOC_NVML_LIBS="-lnvidia-ml"], [hwloc_nvml_happy=no]) + ], [hwloc_nvml_happy=no]) + fi + if test "x$hwloc_nvml_happy" = "xyes"; then + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $HWLOC_NVML_CFLAGS" + tmp_save_LIBS="$LIBS" + LIBS="$LIBS $HWLOC_NVML_LIBS" + AC_CHECK_DECLS([nvmlDeviceGetMaxPcieLinkGeneration],,[:],[[#include ]]) + CFLAGS="$tmp_save_CFLAGS" + LIBS="$tmp_save_LIBS" + fi + AC_SUBST(HWLOC_NVML_LIBS) + # If we asked for nvml support but couldn't deliver, fail + AS_IF([test "$enable_nvml" = "yes" -a "$hwloc_nvml_happy" = "no"], + [AC_MSG_WARN([Specified --enable-nvml switch, but could not]) + AC_MSG_WARN([find appropriate support]) + AC_MSG_ERROR([Cannot continue])]) + if test "x$hwloc_nvml_happy" = "xyes"; then + AC_DEFINE([HWLOC_HAVE_NVML], [1], [Define to 1 if you have the `NVML' library.]) + AC_SUBST([HWLOC_HAVE_NVML], [1]) + hwloc_components="$hwloc_components nvml" + hwloc_nvml_component_maybeplugin=1 + else + AC_SUBST([HWLOC_HAVE_NVML], [0]) + fi + # don't add LIBS/CFLAGS/REQUIRES yet, depends on plugins + + # X11 support + AC_PATH_XTRA + + CPPFLAGS_save=$CPPFLAGS + LIBS_save=$LIBS + + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" + AC_CHECK_HEADERS([X11/Xlib.h], + [AC_CHECK_LIB([X11], [XOpenDisplay], + [ + # the GL backend just needs XOpenDisplay + hwloc_enable_X11=yes + # lstopo needs more + AC_CHECK_HEADERS([X11/Xutil.h], + [AC_CHECK_HEADERS([X11/keysym.h], + [AC_DEFINE([HWLOC_HAVE_X11_KEYSYM], [1], [Define to 1 if X11 headers including Xutil.h and keysym.h are available.]) + HWLOC_X11_CPPFLAGS="$X_CFLAGS" + AC_SUBST([HWLOC_X11_CPPFLAGS]) + HWLOC_X11_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" + AC_SUBST([HWLOC_X11_LIBS])]) + ], [], [#include ]) + ]) + ]) + CPPFLAGS=$CPPFLAGS_save + LIBS=$LIBS_save + + # GL Support + hwloc_gl_happy=no + if test "x$enable_io" != xno && test "x$enable_gl" != "xno"; then + hwloc_gl_happy=yes + + AS_IF([test "$hwloc_enable_X11" != "yes"], + [AC_MSG_WARN([X11 not found; GL disabled]) + hwloc_gl_happy=no]) + + AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [ + AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryTargetAttribute], [:], [hwloc_gl_happy=no], [-lXext]) + ], [hwloc_gl_happy=no]) + + if test "x$hwloc_gl_happy" = "xyes"; then + AC_DEFINE([HWLOC_HAVE_GL], [1], [Define to 1 if you have the GL module components.]) + HWLOC_GL_LIBS="-lXNVCtrl -lXext -lX11" + AC_SUBST(HWLOC_GL_LIBS) + # FIXME we actually don't know if xext.pc and x11.pc are installed + # since we didn't look for Xext and X11 using pkg-config + HWLOC_GL_REQUIRES="xext x11" + hwloc_have_gl=yes + hwloc_components="$hwloc_components gl" + hwloc_gl_component_maybeplugin=1 + else + AS_IF([test "$enable_gl" = "yes"], [ + AC_MSG_WARN([Specified --enable-gl switch, but could not]) + AC_MSG_WARN([find appropriate support]) + AC_MSG_ERROR([Cannot continue]) + ]) + fi + fi + # don't add LIBS/CFLAGS yet, depends on plugins + + # libxml2 support + hwloc_libxml2_happy= + if test "x$enable_libxml2" != "xno"; then + HWLOC_PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], [xmlNewDoc], [libxml/parser.h], + [hwloc_libxml2_happy=yes], + [hwloc_libxml2_happy=no]) + fi + if test "x$hwloc_libxml2_happy" = "xyes"; then + HWLOC_LIBXML2_REQUIRES="libxml-2.0" + AC_DEFINE([HWLOC_HAVE_LIBXML2], [1], [Define to 1 if you have the `libxml2' library.]) + AC_SUBST([HWLOC_HAVE_LIBXML2], [1]) + + hwloc_components="$hwloc_components xml_libxml" + hwloc_xml_libxml_component_maybeplugin=1 + else + AC_SUBST([HWLOC_HAVE_LIBXML2], [0]) + AS_IF([test "$enable_libxml2" = "yes"], + [AC_MSG_WARN([--enable-libxml2 requested, but libxml2 was not found]) + AC_MSG_ERROR([Cannot continue])]) + fi + # don't add LIBS/CFLAGS/REQUIRES yet, depends on plugins + + # Try to compile the x86 cpuid inlines + if test "x$enable_cpuid" != "xno"; then + AC_MSG_CHECKING([for x86 cpuid]) + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$HWLOC_top_srcdir/include" + # We need hwloc_uint64_t but we can't use autogen/config.h before configure ends. + # So pass #include/#define manually here for now. + CPUID_CHECK_HEADERS= + CPUID_CHECK_DEFINE= + if test "x$hwloc_windows" = xyes; then + X86_CPUID_CHECK_HEADERS="#include " + X86_CPUID_CHECK_DEFINE="#define hwloc_uint64_t DWORDLONG" + else + X86_CPUID_CHECK_DEFINE="#define hwloc_uint64_t uint64_t" + if test "x$ac_cv_header_stdint_h" = xyes; then + X86_CPUID_CHECK_HEADERS="#include " + fi + fi + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + $X86_CPUID_CHECK_HEADERS + $X86_CPUID_CHECK_DEFINE + #define __hwloc_inline + #include + ]], [[ + if (hwloc_have_x86_cpuid()) { + unsigned eax = 0, ebx, ecx = 0, edx; + hwloc_x86_cpuid(&eax, &ebx, &ecx, &edx); + printf("highest x86 cpuid %x\n", eax); + return 0; + } + ]])], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HWLOC_HAVE_X86_CPUID, 1, [Define to 1 if you have x86 cpuid]) + hwloc_have_x86_cpuid=yes], + [AC_MSG_RESULT([no])]) + if test "x$hwloc_have_x86_cpuid" = xyes; then + hwloc_components="$hwloc_components x86" + fi + CPPFLAGS="$old_CPPFLAGS" + fi + + # Components require pthread_mutex, see if it needs -lpthread + hwloc_pthread_mutex_happy=no + # Try without explicit -lpthread first + AC_CHECK_FUNC([pthread_mutex_lock], + [hwloc_pthread_mutex_happy=yes + HWLOC_LIBS_PRIVATE="$HWLOC_LIBS_PRIVATE -lpthread" + ], + [AC_MSG_CHECKING([for pthread_mutex_lock with -lpthread]) + # Try again with explicit -lpthread, but don't use AC_CHECK_FUNC to avoid the cache + tmp_save_LIBS=$LIBS + LIBS="$LIBS -lpthread" + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_mutex_lock])], + [hwloc_pthread_mutex_happy=yes + HWLOC_LIBS="$HWLOC_LIBS -lpthread" + ]) + AC_MSG_RESULT([$hwloc_pthread_mutex_happy]) + LIBS="$tmp_save_LIBS" + ]) + AS_IF([test "x$hwloc_pthread_mutex_happy" = "xyes"], + [AC_DEFINE([HWLOC_HAVE_PTHREAD_MUTEX], 1, [Define to 1 if pthread mutexes are available])]) + + AS_IF([test "x$hwloc_pthread_mutex_happy" != xyes -a "x$hwloc_windows" != xyes], + [AC_MSG_WARN([pthread_mutex_lock not available, required for thread-safe initialization on non-Windows platforms.]) + AC_MSG_WARN([Please report this to the hwloc-devel mailing list.]) + AC_MSG_ERROR([Cannot continue])]) + + # + # Now enable registration of listed components + # + + # Plugin support + AC_MSG_CHECKING([if plugin support is enabled]) + # Plugins (even core support) are totally disabled by default + AS_IF([test "x$enable_plugins" = "x"], [enable_plugins=no]) + AS_IF([test "x$enable_plugins" != "xno"], [hwloc_have_plugins=yes], [hwloc_have_plugins=no]) + AC_MSG_RESULT([$hwloc_have_plugins]) + AS_IF([test "x$hwloc_have_plugins" = "xyes"], + [AC_DEFINE([HWLOC_HAVE_PLUGINS], 1, [Define to 1 if the hwloc library should support dynamically-loaded plugins])]) + + # Some sanity checks about plugins + # libltdl doesn't work on AIX as of 2.4.2 + AS_IF([test "x$enable_plugins" = "xyes" -a "x$hwloc_aix" = "xyes"], + [AC_MSG_WARN([libltdl does not work on AIX, plugins support cannot be enabled.]) + AC_MSG_ERROR([Cannot continue])]) + # posix linkers don't work well with plugins and windows dll constraints + AS_IF([test "x$enable_plugins" = "xyes" -a "x$hwloc_windows" = "xyes"], + [AC_MSG_WARN([Plugins not supported on non-native Windows build, plugins support cannot be enabled.]) + AC_MSG_ERROR([Cannot continue])]) + + # If we want plugins, look for ltdl.h and libltdl + if test "x$hwloc_have_plugins" = xyes; then + AC_CHECK_HEADER([ltdl.h], [], + [AC_MSG_WARN([Plugin support requested, but could not find ltdl.h]) + AC_MSG_ERROR([Cannot continue])]) + AC_CHECK_LIB([ltdl], [lt_dlopenext], + [HWLOC_LIBS="$HWLOC_LIBS -lltdl"], + [AC_MSG_WARN([Plugin support requested, but could not find libltdl]) + AC_MSG_ERROR([Cannot continue])]) + # Add libltdl static-build dependencies to hwloc.pc + HWLOC_CHECK_LTDL_DEPS + fi + + AC_ARG_WITH([hwloc-plugins-path], + AC_HELP_STRING([--with-hwloc-plugins-path=dir:...], + [Colon-separated list of plugin directories. Default: "$prefix/lib/hwloc". Plugins will be installed in the first directory. They will be loaded from all of them, in order.]), + [HWLOC_PLUGINS_PATH="$with_hwloc_plugins_path"], + [HWLOC_PLUGINS_PATH="\$(libdir)/hwloc"]) + AC_SUBST(HWLOC_PLUGINS_PATH) + HWLOC_PLUGINS_DIR=`echo "$HWLOC_PLUGINS_PATH" | cut -d: -f1` + AC_SUBST(HWLOC_PLUGINS_DIR) + + # Static components output file + hwloc_static_components_dir=${HWLOC_top_builddir}/hwloc + mkdir -p ${hwloc_static_components_dir} + hwloc_static_components_file=${hwloc_static_components_dir}/static-components.h + rm -f ${hwloc_static_components_file} + + # Make $enable_plugins easier to use (it contains either "yes" (all) or a list of ) + HWLOC_PREPARE_FILTER_COMPONENTS([$enable_plugins]) + # Now we have some hwloc__component_wantplugin=1 + + # See which core components want plugin and support it + HWLOC_FILTER_COMPONENTS + # Now we have some hwloc__component=plugin/static + # and hwloc_static/plugin_components + AC_MSG_CHECKING([components to build statically]) + AC_MSG_RESULT($hwloc_static_components) + HWLOC_LIST_STATIC_COMPONENTS([$hwloc_static_components_file], [$hwloc_static_components]) + AC_MSG_CHECKING([components to build as plugins]) + AC_MSG_RESULT([$hwloc_plugin_components]) + + AS_IF([test "$hwloc_pci_component" = "static"], + [HWLOC_LIBS="$HWLOC_LIBS $HWLOC_PCIACCESS_LIBS" + HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_PCIACCESS_CFLAGS" + HWLOC_REQUIRES="$HWLOC_PCIACCESS_REQUIRES $HWLOC_REQUIRES"]) + AS_IF([test "$hwloc_opencl_component" = "static"], + [HWLOC_LIBS="$HWLOC_LIBS $HWLOC_OPENCL_LIBS" + HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_OPENCL_CFLAGS" + HWLOC_REQUIRES="$HWLOC_OPENCL_REQUIRES $HWLOC_REQUIRES"]) + AS_IF([test "$hwloc_cuda_component" = "static"], + [HWLOC_LIBS="$HWLOC_LIBS $HWLOC_CUDA_LIBS" + HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_CUDA_CFLAGS" + HWLOC_REQUIRES="$HWLOC_CUDA_REQUIRES $HWLOC_REQUIRES"]) + AS_IF([test "$hwloc_nvml_component" = "static"], + [HWLOC_LIBS="$HWLOC_LIBS $HWLOC_NVML_LIBS" + HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_NVML_CFLAGS" + HWLOC_REQUIRES="$HWLOC_NVML_REQUIRES $HWLOC_REQUIRES"]) + AS_IF([test "$hwloc_gl_component" = "static"], + [HWLOC_LIBS="$HWLOC_LIBS $HWLOC_GL_LIBS" + HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_GL_CFLAGS" + HWLOC_REQUIRES="$HWLOC_GL_REQUIRES $HWLOC_REQUIRES"]) + AS_IF([test "$hwloc_xml_libxml_component" = "static"], + [HWLOC_LIBS="$HWLOC_LIBS $HWLOC_LIBXML2_LIBS" + HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_LIBXML2_CFLAGS" + HWLOC_REQUIRES="$HWLOC_LIBXML2_REQUIRES $HWLOC_REQUIRES"]) + + # + # Setup HWLOC's C, CPP, and LD flags, and LIBS + # + AC_SUBST(HWLOC_REQUIRES) + AC_SUBST(HWLOC_CFLAGS) + HWLOC_CPPFLAGS='-I$(HWLOC_top_builddir)/include -I$(HWLOC_top_srcdir)/include' + AC_SUBST(HWLOC_CPPFLAGS) + AC_SUBST(HWLOC_LDFLAGS) + AC_SUBST(HWLOC_LIBS) + AC_SUBST(HWLOC_LIBS_PRIVATE) + + # Set these values explicitly for embedded builds. Exporting + # these values through *_EMBEDDED_* values gives us the freedom to + # do something different someday if we ever need to. There's no + # need to fill these values in unless we're in embedded mode. + # Indeed, if we're building in embedded mode, we want HWLOC_LIBS + # to be empty so that nothing is linked into libhwloc_embedded.la + # itself -- only the upper-layer will link in anything required. + + AS_IF([test "$hwloc_mode" = "embedded"], + [HWLOC_EMBEDDED_CFLAGS=$HWLOC_CFLAGS + HWLOC_EMBEDDED_CPPFLAGS=$HWLOC_CPPFLAGS + HWLOC_EMBEDDED_LDADD='$(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la' + HWLOC_EMBEDDED_LIBS=$HWLOC_LIBS + HWLOC_LIBS=]) + AC_SUBST(HWLOC_EMBEDDED_CFLAGS) + AC_SUBST(HWLOC_EMBEDDED_CPPFLAGS) + AC_SUBST(HWLOC_EMBEDDED_LDADD) + AC_SUBST(HWLOC_EMBEDDED_LIBS) + + # Always generate these files + AC_CONFIG_FILES( + hwloc_config_prefix[Makefile] + hwloc_config_prefix[include/Makefile] + hwloc_config_prefix[hwloc/Makefile ] + ) + + # Cleanup + AC_LANG_POP + + # Success + $2 +])dnl + +#----------------------------------------------------------------------- + +# Specify the symbol prefix +AC_DEFUN([HWLOC_SET_SYMBOL_PREFIX],[ + hwloc_symbol_prefix_value=$1 +])dnl + +#----------------------------------------------------------------------- + +# This must be a standalone routine so that it can be called both by +# HWLOC_INIT and an external caller (if HWLOC_INIT is not invoked). +AC_DEFUN([HWLOC_DO_AM_CONDITIONALS],[ + AS_IF([test "$hwloc_did_am_conditionals" != "yes"],[ + AM_CONDITIONAL([HWLOC_BUILD_STANDALONE], [test "$hwloc_mode" = "standalone"]) + + AM_CONDITIONAL([HWLOC_HAVE_GCC], [test "x$GCC" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_MS_LIB], [test "x$HWLOC_MS_LIB" != "x"]) + AM_CONDITIONAL([HWLOC_HAVE_OPENAT], [test "x$hwloc_have_openat" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_SCHED_SETAFFINITY], + [test "x$hwloc_have_sched_setaffinity" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_PTHREAD], + [test "x$hwloc_have_pthread" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_LINUX_LIBNUMA], + [test "x$hwloc_have_linux_libnuma" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_LIBIBVERBS], + [test "x$hwloc_have_libibverbs" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_CUDA], + [test "x$hwloc_have_cuda" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_GL], + [test "x$hwloc_have_gl" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_MYRIEXPRESS], + [test "x$hwloc_have_myriexpress" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_CUDART], + [test "x$hwloc_have_cudart" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_LIBXML2], [test "$hwloc_libxml2_happy" = "yes"]) + AM_CONDITIONAL([HWLOC_HAVE_CAIRO], [test "$hwloc_cairo_happy" = "yes"]) + AM_CONDITIONAL([HWLOC_HAVE_PCIACCESS], [test "$hwloc_pciaccess_happy" = "yes"]) + AM_CONDITIONAL([HWLOC_HAVE_OPENCL], [test "$hwloc_opencl_happy" = "yes"]) + AM_CONDITIONAL([HWLOC_HAVE_NVML], [test "$hwloc_nvml_happy" = "yes"]) + AM_CONDITIONAL([HWLOC_HAVE_BUNZIPP], [test "x$BUNZIPP" != "xfalse"]) + AM_CONDITIONAL([HWLOC_HAVE_USER32], [test "x$hwloc_have_user32" = "xyes"]) + + AM_CONDITIONAL([HWLOC_BUILD_DOXYGEN], + [test "x$hwloc_generate_doxs" = "xyes"]) + AM_CONDITIONAL([HWLOC_BUILD_README], + [test "x$hwloc_generate_readme" = "xyes" -a \( "x$hwloc_install_doxs" = "xyes" -o "x$hwloc_generate_doxs" = "xyes" \) ]) + AM_CONDITIONAL([HWLOC_INSTALL_DOXYGEN], + [test "x$hwloc_install_doxs" = "xyes"]) + + AM_CONDITIONAL([HWLOC_HAVE_LINUX], [test "x$hwloc_linux" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_BGQ], [test "x$hwloc_bgq" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_IRIX], [test "x$hwloc_irix" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_DARWIN], [test "x$hwloc_darwin" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_FREEBSD], [test "x$hwloc_freebsd" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_NETBSD], [test "x$hwloc_netbsd" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_SOLARIS], [test "x$hwloc_solaris" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_AIX], [test "x$hwloc_aix" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_HPUX], [test "x$hwloc_hpux" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_WINDOWS], [test "x$hwloc_windows" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_MINGW32], [test "x$target_os" = "xmingw32"]) + + AM_CONDITIONAL([HWLOC_HAVE_X86], [test "x$hwloc_x86_32" = "xyes" -o "x$hwloc_x86_64" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_X86_32], [test "x$hwloc_x86_32" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_X86_64], [test "x$hwloc_x86_64" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_X86_CPUID], [test "x$hwloc_have_x86_cpuid" = "xyes"]) + + AM_CONDITIONAL([HWLOC_HAVE_PLUGINS], [test "x$hwloc_have_plugins" = "xyes"]) + AM_CONDITIONAL([HWLOC_PCI_BUILD_STATIC], [test "x$hwloc_pci_component" = "xstatic"]) + AM_CONDITIONAL([HWLOC_OPENCL_BUILD_STATIC], [test "x$hwloc_opencl_component" = "xstatic"]) + AM_CONDITIONAL([HWLOC_CUDA_BUILD_STATIC], [test "x$hwloc_cuda_component" = "xstatic"]) + AM_CONDITIONAL([HWLOC_NVML_BUILD_STATIC], [test "x$hwloc_nvml_component" = "xstatic"]) + AM_CONDITIONAL([HWLOC_GL_BUILD_STATIC], [test "x$hwloc_gl_component" = "xstatic"]) + AM_CONDITIONAL([HWLOC_XML_LIBXML_BUILD_STATIC], [test "x$hwloc_xml_libxml_component" = "xstatic"]) + + AM_CONDITIONAL([HWLOC_HAVE_CXX], [test "x$hwloc_have_cxx" = "xyes"]) + ]) + hwloc_did_am_conditionals=yes + + # For backwards compatibility (i.e., packages that only call + # HWLOC_DO_AM_CONDITIONS, not NETLOC DO_AM_CONDITIONALS), we also have to + # do the netloc AM conditionals here + NETLOC_DO_AM_CONDITIONALS +])dnl + +#----------------------------------------------------------------------- + +AC_DEFUN([_HWLOC_CHECK_DIFF_U], [ + AC_MSG_CHECKING([whether diff accepts -u]) + if diff -u /dev/null /dev/null 2> /dev/null + then + HWLOC_DIFF_U="-u" + else + HWLOC_DIFF_U="" + fi + AC_SUBST([HWLOC_DIFF_U]) + AC_MSG_RESULT([$HWLOC_DIFF_U]) +]) + +AC_DEFUN([_HWLOC_CHECK_DIFF_W], [ + AC_MSG_CHECKING([whether diff accepts -w]) + if diff -w /dev/null /dev/null 2> /dev/null + then + HWLOC_DIFF_W="-w" + else + HWLOC_DIFF_W="" + fi + AC_SUBST([HWLOC_DIFF_W]) + AC_MSG_RESULT([$HWLOC_DIFF_W]) +]) + +#----------------------------------------------------------------------- + +dnl HWLOC_CHECK_DECL +dnl +dnl Check that the declaration of the given function has a complete prototype +dnl with argument list by trying to call it with an insane dnl number of +dnl arguments (10). Success means the compiler couldn't really check. +AC_DEFUN([_HWLOC_CHECK_DECL], [ + AC_CHECK_DECL([$1], [ + AC_MSG_CHECKING([whether function $1 has a complete prototype]) + AC_REQUIRE([AC_PROG_CC]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT([$4])], + [$1(1,2,3,4,5,6,7,8,9,10);] + )], + [AC_MSG_RESULT([no]) + $3], + [AC_MSG_RESULT([yes]) + $2] + )], [$3], $4 + ) +]) + +#----------------------------------------------------------------------- + +dnl HWLOC_CHECK_DECLS +dnl +dnl Same as HWLOCK_CHECK_DECL, but defines HAVE_DECL_foo to 1 or 0 depending on +dnl the result. +AC_DEFUN([_HWLOC_CHECK_DECLS], [ + HWLOC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4]) + AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_$1]), [$ac_have_decl], + [Define to 1 if you have the declaration of `$1', and to 0 if you don't]) +]) + +#----------------------------------------------------------------------- + +dnl HWLOC_CHECK_LTDL_DEPS +dnl +dnl Add ltdl dependencies to HWLOC_LIBS_PRIVATE +AC_DEFUN([HWLOC_CHECK_LTDL_DEPS], [ + # save variables that we'll modify below + save_lt_cv_dlopen="$lt_cv_dlopen" + save_lt_cv_dlopen_libs="$lt_cv_dlopen_libs" + save_lt_cv_dlopen_self="$lt_cv_dlopen_self" + ########################################################### + # code stolen from LT_SYS_DLOPEN_SELF in libtool.m4 + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + # end of code stolen from LT_SYS_DLOPEN_SELF in libtool.m4 + ########################################################### + + HWLOC_LIBS_PRIVATE="$HWLOC_LIBS_PRIVATE $lt_cv_dlopen_libs" + + # restore modified variable in case the actual libtool code uses them + lt_cv_dlopen="$save_lt_cv_dlopen" + lt_cv_dlopen_libs="$save_lt_cv_dlopen_libs" + lt_cv_dlopen_self="$save_lt_cv_dlopen_self" +]) diff --git a/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_attributes.m4 b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_attributes.m4 new file mode 100644 index 00000000000..96348e819ee --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_attributes.m4 @@ -0,0 +1,534 @@ +# This macro set originally copied from Open MPI: +# Copyright © 2004-2007 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright © 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright © 2004-2007 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright © 2004-2005 The Regents of the University of California. +# All rights reserved. +# and renamed for hwloc: +# Copyright © 2009 Inria. All rights reserved. +# Copyright © 2009 Université Bordeaux +# Copyright © 2010 Cisco Systems, Inc. All rights reserved. +# See COPYING in top-level directory. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer listed +# in this license in the documentation and/or other materials +# provided with the distribution. +# +# - Neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# The copyright holders provide no reassurances that the source code +# provided does not infringe any patent, copyright, or any other +# intellectual property rights of third parties. The copyright holders +# disclaim any liability to any recipient for claims brought against +# recipient by any third party for infringement of that parties +# intellectual property rights. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# Search the generated warnings for +# keywords regarding skipping or ignoring certain attributes +# Intel: ignore +# Sun C++: skip +# +AC_DEFUN([_HWLOC_ATTRIBUTE_FAIL_SEARCH],[ + # Be safe for systems that have ancient Autoconf's (e.g., RHEL5) + m4_ifdef([AC_PROG_GREP], + [AC_REQUIRE([AC_PROG_GREP])], + [GREP=grep]) + + if test -s conftest.err ; then + for i in ignore skip ; do + $GREP -iq $i conftest.err + if test "$?" = "0" ; then + hwloc_cv___attribute__[$1]=0 + break; + fi + done + fi +]) + +# +# HWLOC: Remove C++ compiler check. It can result in a circular +# dependency in embedded situations. +# +# Check for one specific attribute by compiling with C +# and possibly using a cross-check. +# +# If the cross-check is defined, a static function "usage" should be +# defined, which is to be called from main (to circumvent warnings +# regarding unused function in main file) +# static int usage (int * argument); +# +# The last argument is for specific CFLAGS, that need to be set +# for the compiler to generate a warning on the cross-check. +# This may need adaption for future compilers / CFLAG-settings. +# +AC_DEFUN([_HWLOC_CHECK_SPECIFIC_ATTRIBUTE], [ + AC_MSG_CHECKING([for __attribute__([$1])]) + AC_CACHE_VAL(hwloc_cv___attribute__[$1], [ + # + # Try to compile using the C compiler + # + AC_TRY_COMPILE([$2],[], + [ + # + # In case we did succeed: Fine, but was this due to the + # attribute being ignored/skipped? Grep for IgNoRe/skip in conftest.err + # and if found, reset the hwloc_cv__attribute__var=0 + # + hwloc_cv___attribute__[$1]=1 + _HWLOC_ATTRIBUTE_FAIL_SEARCH([$1]) + ], + [hwloc_cv___attribute__[$1]=0]) + + # + # If the attribute is supported by both compilers, + # try to recompile a *cross-check*, IFF defined. + # + if test '(' "$hwloc_cv___attribute__[$1]" = "1" -a "[$3]" != "" ')' ; then + ac_c_werror_flag_safe=$ac_c_werror_flag + ac_c_werror_flag="yes" + CFLAGS_safe=$CFLAGS + CFLAGS="$CFLAGS [$4]" + + AC_TRY_COMPILE([$3], + [ + int i=4711; + i=usage(&i); + ], + [hwloc_cv___attribute__[$1]=0], + [ + # + # In case we did NOT succeed: Fine, but was this due to the + # attribute being ignored? Grep for IgNoRe in conftest.err + # and if found, reset the hwloc_cv__attribute__var=0 + # + hwloc_cv___attribute__[$1]=1 + _HWLOC_ATTRIBUTE_FAIL_SEARCH([$1]) + ]) + + ac_c_werror_flag=$ac_c_werror_flag_safe + CFLAGS=$CFLAGS_safe + fi + ]) + + if test "$hwloc_cv___attribute__[$1]" = "1" ; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi +]) + + +# +# Test the availability of __attribute__ and with the help +# of _HWLOC_CHECK_SPECIFIC_ATTRIBUTE for the support of +# particular attributes. Compilers, that do not support an +# attribute most often fail with a warning (when the warning +# level is set). +# The compilers output is parsed in _HWLOC_ATTRIBUTE_FAIL_SEARCH +# +# To add a new attributes __NAME__ add the +# hwloc_cv___attribute__NAME +# add a new check with _HWLOC_CHECK_SPECIFIC_ATTRIBUTE (possibly with a cross-check) +# _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([name], [int foo (int arg) __attribute__ ((__name__));], [], []) +# and define the corresponding +# AC_DEFINE_UNQUOTED(_HWLOC_HAVE_ATTRIBUTE_NAME, [$hwloc_cv___attribute__NAME], +# [Whether your compiler has __attribute__ NAME or not]) +# and decide on a correct macro (in opal/include/opal_config_bottom.h): +# # define __opal_attribute_NAME(x) __attribute__(__NAME__) +# +# Please use the "__"-notation of the attribute in order not to +# clash with predefined names or macros (e.g. const, which some compilers +# do not like..) +# + + +AC_DEFUN([_HWLOC_CHECK_ATTRIBUTES], [ + AC_MSG_CHECKING(for __attribute__) + + AC_CACHE_VAL(hwloc_cv___attribute__, [ + AC_TRY_COMPILE( + [#include + /* Check for the longest available __attribute__ (since gcc-2.3) */ + struct foo { + char a; + int x[2] __attribute__ ((__packed__)); + }; + ], + [], + [hwloc_cv___attribute__=1], + [hwloc_cv___attribute__=0], + ) + + if test "$hwloc_cv___attribute__" = "1" ; then + AC_TRY_COMPILE( + [#include + /* Check for the longest available __attribute__ (since gcc-2.3) */ + struct foo { + char a; + int x[2] __attribute__ ((__packed__)); + }; + ], + [], + [hwloc_cv___attribute__=1], + [hwloc_cv___attribute__=0], + ) + fi + ]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE, [$hwloc_cv___attribute__], + [Whether your compiler has __attribute__ or not]) + +# +# Now that we know the compiler support __attribute__ let's check which kind of +# attributed are supported. +# + if test "$hwloc_cv___attribute__" = "0" ; then + AC_MSG_RESULT([no]) + hwloc_cv___attribute__aligned=0 + hwloc_cv___attribute__always_inline=0 + hwloc_cv___attribute__cold=0 + hwloc_cv___attribute__const=0 + hwloc_cv___attribute__deprecated=0 + hwloc_cv___attribute__format=0 + hwloc_cv___attribute__hot=0 + hwloc_cv___attribute__malloc=0 + hwloc_cv___attribute__may_alias=0 + hwloc_cv___attribute__no_instrument_function=0 + hwloc_cv___attribute__nonnull=0 + hwloc_cv___attribute__noreturn=0 + hwloc_cv___attribute__packed=0 + hwloc_cv___attribute__pure=0 + hwloc_cv___attribute__sentinel=0 + hwloc_cv___attribute__unused=0 + hwloc_cv___attribute__warn_unused_result=0 + hwloc_cv___attribute__weak_alias=0 + else + AC_MSG_RESULT([yes]) + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([aligned], + [struct foo { char text[4]; } __attribute__ ((__aligned__(8)));], + [], + []) + + # + # Ignored by PGI-6.2.5; -- recognized by output-parser + # + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([always_inline], + [int foo (int arg) __attribute__ ((__always_inline__));], + [], + []) + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([cold], + [ + int foo(int arg1, int arg2) __attribute__ ((__cold__)); + int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } + ], + [], + []) + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([const], + [ + int foo(int arg1, int arg2) __attribute__ ((__const__)); + int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } + ], + [], + []) + + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([deprecated], + [ + int foo(int arg1, int arg2) __attribute__ ((__deprecated__)); + int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } + ], + [], + []) + + + HWLOC_ATTRIBUTE_CFLAGS= + case "$hwloc_c_vendor" in + gnu) + HWLOC_ATTRIBUTE_CFLAGS="-Wall" + ;; + intel) + # we want specifically the warning on format string conversion + HWLOC_ATTRIBUTE_CFLAGS="-we181" + ;; + esac + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([format], + [ + int this_printf (void *my_object, const char *my_format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); + ], + [ + static int usage (int * argument); + extern int this_printf (int arg1, const char *my_format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); + + static int usage (int * argument) { + return this_printf (*argument, "%d", argument); /* This should produce a format warning */ + } + /* The autoconf-generated main-function is int main(), which produces a warning by itself */ + int main(void); + ], + [$HWLOC_ATTRIBUTE_CFLAGS]) + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([hot], + [ + int foo(int arg1, int arg2) __attribute__ ((__hot__)); + int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } + ], + [], + []) + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([malloc], + [ +#ifdef HAVE_STDLIB_H +# include +#endif + int * foo(int arg1) __attribute__ ((__malloc__)); + int * foo(int arg1) { return (int*) malloc(arg1); } + ], + [], + []) + + + # + # Attribute may_alias: No suitable cross-check available, that works for non-supporting compilers + # Ignored by intel-9.1.045 -- turn off with -wd1292 + # Ignored by PGI-6.2.5; ignore not detected due to missing cross-check + # The test case is chosen to match our only use in topology-xml-*.c, and reproduces an xlc-13.1.0 bug. + # + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([may_alias], + [struct { int i; } __attribute__ ((__may_alias__)) * p_value;], + [], + []) + + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([no_instrument_function], + [int * foo(int arg1) __attribute__ ((__no_instrument_function__));], + [], + []) + + + # + # Attribute nonnull: + # Ignored by intel-compiler 9.1.045 -- recognized by cross-check + # Ignored by PGI-6.2.5 (pgCC) -- recognized by cross-check + # + HWLOC_ATTRIBUTE_CFLAGS= + case "$hwloc_c_vendor" in + gnu) + HWLOC_ATTRIBUTE_CFLAGS="-Wall" + ;; + intel) + # we do not want to get ignored attributes warnings, but rather real warnings + HWLOC_ATTRIBUTE_CFLAGS="-wd1292" + ;; + esac + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([nonnull], + [ + int square(int *arg) __attribute__ ((__nonnull__)); + int square(int *arg) { return *arg; } + ], + [ + static int usage(int * argument); + int square(int * argument) __attribute__ ((__nonnull__)); + int square(int * argument) { return (*argument) * (*argument); } + + static int usage(int * argument) { + return square( ((void*)0) ); /* This should produce an argument must be nonnull warning */ + } + /* The autoconf-generated main-function is int main(), which produces a warning by itself */ + int main(void); + ], + [$HWLOC_ATTRIBUTE_CFLAGS]) + + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([noreturn], + [ +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif + void fatal(int arg1) __attribute__ ((__noreturn__)); + void fatal(int arg1) { exit(arg1); } + ], + [], + []) + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([packed], + [ + struct foo { + char a; + int x[2] __attribute__ ((__packed__)); + }; + ], + [], + []) + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([pure], + [ + int square(int arg) __attribute__ ((__pure__)); + int square(int arg) { return arg * arg; } + ], + [], + []) + + # + # Attribute sentinel: + # Ignored by the intel-9.1.045 -- recognized by cross-check + # intel-10.0beta works fine + # Ignored by PGI-6.2.5 (pgCC) -- recognized by output-parser and cross-check + # Ignored by pathcc-2.2.1 -- recognized by cross-check (through grep ignore) + # + HWLOC_ATTRIBUTE_CFLAGS= + case "$hwloc_c_vendor" in + gnu) + HWLOC_ATTRIBUTE_CFLAGS="-Wall" + ;; + intel) + # we do not want to get ignored attributes warnings + HWLOC_ATTRIBUTE_CFLAGS="-wd1292" + ;; + esac + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([sentinel], + [ + int my_execlp(const char * file, const char *arg, ...) __attribute__ ((__sentinel__)); + ], + [ + static int usage(int * argument); + int my_execlp(const char * file, const char *arg, ...) __attribute__ ((__sentinel__)); + + static int usage(int * argument) { + void * last_arg_should_be_null = argument; + return my_execlp ("lala", "/home/there", last_arg_should_be_null); /* This should produce a warning */ + } + /* The autoconf-generated main-function is int main(), which produces a warning by itself */ + int main(void); + ], + [$HWLOC_ATTRIBUTE_CFLAGS]) + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([unused], + [ + int square(int arg1 __attribute__ ((__unused__)), int arg2); + int square(int arg1, int arg2) { return arg2; } + ], + [], + []) + + + # + # Attribute warn_unused_result: + # Ignored by the intel-compiler 9.1.045 -- recognized by cross-check + # Ignored by pathcc-2.2.1 -- recognized by cross-check (through grep ignore) + # + HWLOC_ATTRIBUTE_CFLAGS= + case "$hwloc_c_vendor" in + gnu) + HWLOC_ATTRIBUTE_CFLAGS="-Wall" + ;; + intel) + # we do not want to get ignored attributes warnings + HWLOC_ATTRIBUTE_CFLAGS="-wd1292" + ;; + esac + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([warn_unused_result], + [ + int foo(int arg) __attribute__ ((__warn_unused_result__)); + int foo(int arg) { return arg + 3; } + ], + [ + static int usage(int * argument); + int foo(int arg) __attribute__ ((__warn_unused_result__)); + + int foo(int arg) { return arg + 3; } + static int usage(int * argument) { + foo (*argument); /* Should produce an unused result warning */ + return 0; + } + + /* The autoconf-generated main-function is int main(), which produces a warning by itself */ + int main(void); + ], + [$HWLOC_ATTRIBUTE_CFLAGS]) + + + _HWLOC_CHECK_SPECIFIC_ATTRIBUTE([weak_alias], + [ + int foo(int arg); + int foo(int arg) { return arg + 3; } + int foo2(int arg) __attribute__ ((__weak__, __alias__("foo"))); + ], + [], + []) + + fi + + # Now that all the values are set, define them + + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_ALIGNED, [$hwloc_cv___attribute__aligned], + [Whether your compiler has __attribute__ aligned or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_ALWAYS_INLINE, [$hwloc_cv___attribute__always_inline], + [Whether your compiler has __attribute__ always_inline or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_COLD, [$hwloc_cv___attribute__cold], + [Whether your compiler has __attribute__ cold or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_CONST, [$hwloc_cv___attribute__const], + [Whether your compiler has __attribute__ const or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_DEPRECATED, [$hwloc_cv___attribute__deprecated], + [Whether your compiler has __attribute__ deprecated or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_FORMAT, [$hwloc_cv___attribute__format], + [Whether your compiler has __attribute__ format or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_HOT, [$hwloc_cv___attribute__hot], + [Whether your compiler has __attribute__ hot or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_MALLOC, [$hwloc_cv___attribute__malloc], + [Whether your compiler has __attribute__ malloc or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS, [$hwloc_cv___attribute__may_alias], + [Whether your compiler has __attribute__ may_alias or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION, [$hwloc_cv___attribute__no_instrument_function], + [Whether your compiler has __attribute__ no_instrument_function or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_NONNULL, [$hwloc_cv___attribute__nonnull], + [Whether your compiler has __attribute__ nonnull or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_NORETURN, [$hwloc_cv___attribute__noreturn], + [Whether your compiler has __attribute__ noreturn or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_PACKED, [$hwloc_cv___attribute__packed], + [Whether your compiler has __attribute__ packed or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_PURE, [$hwloc_cv___attribute__pure], + [Whether your compiler has __attribute__ pure or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_SENTINEL, [$hwloc_cv___attribute__sentinel], + [Whether your compiler has __attribute__ sentinel or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_UNUSED, [$hwloc_cv___attribute__unused], + [Whether your compiler has __attribute__ unused or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT, [$hwloc_cv___attribute__warn_unused_result], + [Whether your compiler has __attribute__ warn unused result or not]) + AC_DEFINE_UNQUOTED(HWLOC_HAVE_ATTRIBUTE_WEAK_ALIAS, [$hwloc_cv___attribute__weak_alias], + [Whether your compiler has __attribute__ weak alias or not]) +]) + diff --git a/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_vendor.m4 b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_vendor.m4 new file mode 100644 index 00000000000..2281113bc64 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_vendor.m4 @@ -0,0 +1,246 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana +dnl University Research and Technology +dnl Corporation. All rights reserved. +dnl Copyright © 2004-2005 The University of Tennessee and The University +dnl of Tennessee Research Foundation. All rights +dnl reserved. +dnl Copyright © 2004-2005 High Performance Computing Center Stuttgart, +dnl University of Stuttgart. All rights reserved. +dnl Copyright © 2004-2005 The Regents of the University of California. +dnl All rights reserved. +dnl Copyright © 2011 Cisco Systems, Inc. All rights reserved. +dnl Copyright © 2015 Inria. All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +dnl ------------------------------------------------------------------ +dnl This m4 file originally copied from Open MPI +dnl config/ompi_check_vendor.m4. +dnl ------------------------------------------------------------------ + + +# HWLOC_C_COMPILER_VENDOR(VENDOR_VARIABLE) +# --------------------------------------- +# Set shell variable VENDOR_VARIABLE to the name of the compiler +# vendor for the current C compiler. +# +# See comment for _HWLOC_CHECK_COMPILER_VENDOR for a complete +# list of currently detected compilers. +AC_DEFUN([_HWLOC_C_COMPILER_VENDOR], [ + AC_REQUIRE([AC_PROG_CC]) + + AC_CACHE_CHECK([for the C compiler vendor], + [hwloc_cv_c_compiler_vendor], + [AC_LANG_PUSH(C) + _HWLOC_CHECK_COMPILER_VENDOR([hwloc_cv_c_compiler_vendor]) + AC_LANG_POP(C)]) + + $1="$hwloc_cv_c_compiler_vendor" +]) + + +# workaround to avoid syntax error with Autoconf < 2.68: +m4_ifndef([AC_LANG_DEFINES_PROVIDED], + [m4_define([AC_LANG_DEFINES_PROVIDED])]) + +# HWLOC_IFDEF_IFELSE(symbol, [action-if-defined], +# [action-if-not-defined]) +# ---------------------------------------------- +# Run compiler to determine if preprocessor symbol "symbol" is +# defined by the compiler. +AC_DEFUN([HWLOC_IFDEF_IFELSE], [ + AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED +#ifndef $1 +#error "symbol $1 not defined" +choke me +#endif], [$2], [$3])]) + + +# HWLOC_IF_IFELSE(symbol, [action-if-defined], +# [action-if-not-defined]) +# ---------------------------------------------- +# Run compiler to determine if preprocessor symbol "symbol" is +# defined by the compiler. +AC_DEFUN([HWLOC_IF_IFELSE], [ + AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED +#if !( $1 ) +#error "condition $1 not met" +choke me +#endif], [$2], [$3])]) + + +# _HWLOC_CHECK_COMPILER_VENDOR(VENDOR_VARIABLE) +# -------------------------------------------- +# Set shell variable VENDOR_VARIABLE to the name of the compiler +# vendor for the compiler for the current language. Language must be +# one of C, OBJC, or C++. +# +# thanks to http://predef.sourceforge.net/precomp.html for the list +# of defines to check. +AC_DEFUN([_HWLOC_CHECK_COMPILER_VENDOR], [ + hwloc_check_compiler_vendor_result="unknown" + + # GNU is probably the most common, so check that one as soon as + # possible. Intel and Android pretend to be GNU, so need to + # check Intel and Android before checking for GNU. + + # Android + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__ANDROID__], + [hwloc_check_compiler_vendor_result="android"])]) + + # Intel + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(__INTEL_COMPILER) || defined(__ICC)], + [hwloc_check_compiler_vendor_result="intel"])]) + + # GNU + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__GNUC__], + [hwloc_check_compiler_vendor_result="gnu"])]) + + # Borland Turbo C + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__TURBOC__], + [hwloc_check_compiler_vendor_result="borland"])]) + + # Borland C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__BORLANDC__], + [hwloc_check_compiler_vendor_result="borland"])]) + + # Comeau C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__COMO__], + [hwloc_check_compiler_vendor_result="comeau"])]) + + # Compaq C/C++ + # OSF part actually not needed anymore but doesn't hurt + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(__DECC) || defined(VAXC) || defined(__VAXC)], + [hwloc_check_compiler_vendor_result="compaq"], + [HWLOC_IF_IFELSE([defined(__osf__) && defined(__LANGUAGE_C__)], + [hwloc_check_compiler_vendor_result="compaq"], + [HWLOC_IFDEF_IFELSE([__DECCXX], + [hwloc_check_compiler_vendor_result="compaq"])])])]) + + # Cray C/C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([_CRAYC], + [hwloc_check_compiler_vendor_result="cray"])]) + + # Diab C/C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__DCC__], + [hwloc_check_compiler_vendor_result="diab"])]) + + # Digital Mars + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(__DMC__) || defined(__SC__) || defined(__ZTC__)], + [hwloc_check_compiler_vendor_result="digital mars"])]) + + # HP ANSI C / aC++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(__HP_cc) || defined(__HP_aCC)], + [hwloc_check_compiler_vendor_result="hp"])]) + + # IBM XL C/C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)], + [hwloc_check_compiler_vendor_result="ibm"], + [HWLOC_IF_IFELSE([defined(_AIX) && !defined(__GNUC__)], + [hwloc_check_compiler_vendor_result="ibm"])])]) + + # KAI C++ (rest in peace) + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__KCC], + [hwloc_check_compiler_vendor_result="kai"])]) + + # LCC + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__LCC__], + [hwloc_check_compiler_vendor_result="lcc"])]) + + # MetaWare High C/C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__HIGHC__], + [hwloc_check_compiler_vendor_result="metaware high"])]) + + # Metrowerks Codewarrior + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__MWERKS__], + [hwloc_check_compiler_vendor_result="metrowerks"])]) + + # MIPSpro (SGI) + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(sgi) || defined(__sgi)], + [hwloc_check_compiler_vendor_result="sgi"])]) + + # MPW C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS)], + [hwloc_check_compiler_vendor_result="mpw"])]) + + # Microsoft + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [# Always use C compiler when checking for Microsoft, as + # Visual C++ doesn't recognize .cc as a C++ file. + AC_LANG_PUSH(C) + HWLOC_IF_IFELSE([defined(_MSC_VER) || defined(__MSC_VER)], + [hwloc_check_compiler_vendor_result="microsoft"]) + AC_LANG_POP(C)]) + + # Norcroft C + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__CC_NORCROFT], + [hwloc_check_compiler_vendor_result="norcroft"])]) + + # Pelles C + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__POCC__], + [hwloc_check_compiler_vendor_result="pelles"])]) + + # Portland Group + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__PGI], + [hwloc_check_compiler_vendor_result="portland group"])]) + + # SAS/C + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(SASC) || defined(__SASC) || defined(__SASC__)], + [hwloc_check_compiler_vendor_result="sas"])]) + + # Sun Workshop C/C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IF_IFELSE([defined(__SUNPRO_C) || defined(__SUNPRO_CC)], + [hwloc_check_compiler_vendor_result="sun"])]) + + # TenDRA C/C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__TenDRA__], + [hwloc_check_compiler_vendor_result="tendra"])]) + + # Tiny C + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__TINYC__], + [hwloc_check_compiler_vendor_result="tiny"])]) + + # USL C + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__USLC__], + [hwloc_check_compiler_vendor_result="usl"])]) + + # Watcom C++ + AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"], + [HWLOC_IFDEF_IFELSE([__WATCOMC__], + [hwloc_check_compiler_vendor_result="watcom"])]) + + $1="$hwloc_check_compiler_vendor_result" + unset hwloc_check_compiler_vendor_result +]) diff --git a/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_visibility.m4 b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_visibility.m4 new file mode 100644 index 00000000000..885fe3d8df6 --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_check_visibility.m4 @@ -0,0 +1,131 @@ +# This macro set originally copied from Open MPI: +# Copyright © 2004-2005 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright © 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright © 2004-2007 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright © 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright © 2006-2007 Cisco Systems, Inc. All rights reserved. +# and renamed/modified for hwloc: +# Copyright © 2009 Inria. All rights reserved. +# Copyright © 2009-2010 Université Bordeaux +# Copyright © 2010-2012 Cisco Systems, Inc. All rights reserved. +# See COPYING in top-level directory. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer listed +# in this license in the documentation and/or other materials +# provided with the distribution. +# +# - Neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# The copyright holders provide no reassurances that the source code +# provided does not infringe any patent, copyright, or any other +# intellectual property rights of third parties. The copyright holders +# disclaim any liability to any recipient for claims brought against +# recipient by any third party for infringement of that parties +# intellectual property rights. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# _HWLOC_CHECK_VISIBILITY +# -------------------------------------------------------- +AC_DEFUN([_HWLOC_CHECK_VISIBILITY],[ + # Be safe for systems that have ancient Autoconf's (e.g., RHEL5) + m4_ifdef([AC_PROG_GREP], + [AC_REQUIRE([AC_PROG_GREP])], + [GREP=grep]) + + # Check if the compiler has support for visibility, like some + # versions of gcc, icc, Sun Studio cc. + AC_ARG_ENABLE(visibility, + AC_HELP_STRING([--enable-visibility], + [enable visibility feature of certain compilers/linkers (default: enabled on platforms that support it)])) + + case ${target} in + *-*-aix*|*-*-mingw*|*-*-cygwin*|*-*-hpux*) + enable_visibility=no + ;; + esac + + hwloc_visibility_define=0 + hwloc_msg="whether to enable symbol visibility" + if test "$enable_visibility" = "no"; then + AC_MSG_CHECKING([$hwloc_msg]) + AC_MSG_RESULT([no (disabled)]) + else + CFLAGS_orig=$CFLAGS + + hwloc_add= + case "$hwloc_c_vendor" in + sun) + # Check using Sun Studio -xldscope=hidden flag + hwloc_add=-xldscope=hidden + CFLAGS="$CFLAGS_orig $hwloc_add -errwarn=%all" + ;; + + *) + # Check using -fvisibility=hidden + hwloc_add=-fvisibility=hidden + CFLAGS="$CFLAGS_orig $hwloc_add -Werror" + ;; + esac + + AC_MSG_CHECKING([if $CC supports $hwloc_add]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + __attribute__((visibility("default"))) int foo; + ]],[[fprintf(stderr, "Hello, world\n");]])], + [AS_IF([test -s conftest.err], + [$GREP -iq visibility conftest.err + # If we find "visibility" in the stderr, then + # assume it doesn't work + AS_IF([test "$?" = "0"], [hwloc_add=])]) + ], [hwloc_add=]) + AS_IF([test "$hwloc_add" = ""], + [AC_MSG_RESULT([no])], + [AC_MSG_RESULT([yes])]) + + CFLAGS=$CFLAGS_orig + HWLOC_VISIBILITY_CFLAGS=$hwloc_add + + if test "$hwloc_add" != "" ; then + hwloc_visibility_define=1 + AC_MSG_CHECKING([$hwloc_msg]) + AC_MSG_RESULT([yes (via $hwloc_add)]) + elif test "$enable_visibility" = "yes"; then + AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting]) + else + AC_MSG_CHECKING([$hwloc_msg]) + AC_MSG_RESULT([no (unsupported)]) + fi + unset hwloc_add + fi + + AC_DEFINE_UNQUOTED([HWLOC_C_HAVE_VISIBILITY], [$hwloc_visibility_define], + [Whether C compiler supports symbol visibility or not]) +]) diff --git a/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_components.m4 b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_components.m4 new file mode 100644 index 00000000000..7d5c1fa194d --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_components.m4 @@ -0,0 +1,66 @@ +# Copyright © 2012 Inria. All rights reserved. +# See COPYING in top-level directory. + + +# HWLOC_PREPARE_FILTER_COMPONENTS +# +# Given a comma-separated list of names, define hwloc__component_maybeplugin=1. +# +# $1 = command-line given list of components to build as plugins +# +AC_DEFUN([HWLOC_PREPARE_FILTER_COMPONENTS], [ + for name in `echo [$1] | sed -e 's/,/ /g'` ; do + str="hwloc_${name}_component_wantplugin=1" + eval $str + done +]) + + +# HWLOC_FILTER_COMPONENTS +# +# For each component in hwloc_components, +# check if hwloc__component_wantplugin=1 or enable_plugin=yes, +# and check if hwloc__component_maybeplugin=1. +# Add to hwloc_[static|plugin]_components accordingly. +# And set hwloc__component=[static|plugin] accordingly. +# +AC_DEFUN([HWLOC_FILTER_COMPONENTS], [ +for name in $hwloc_components ; do + str="maybeplugin=\$hwloc_${name}_component_maybeplugin" + eval $str + str="wantplugin=\$hwloc_${name}_component_wantplugin" + eval $str + if test x$hwloc_have_plugins = xyes && test x$maybeplugin = x1 && test x$wantplugin = x1 -o x$enable_plugins = xyes; then + hwloc_plugin_components="$hwloc_plugin_components $name" + str="hwloc_${name}_component=plugin" + else + hwloc_static_components="$hwloc_static_components $name" + str="hwloc_${name}_component=static" + fi + eval $str +done +]) + + +# HWLOC_LIST_STATIC_COMPONENTS +# +# Append to file $1 an array of components by listing component names in $2. +# +# $1 = filename +# $2 = list of component names +# +AC_DEFUN([HWLOC_LIST_STATIC_COMPONENTS], [ +for comp in [$2]; do + echo "HWLOC_DECLSPEC extern const struct hwloc_component hwloc_${comp}_component;" >>[$1] +done +cat <>[$1] +static const struct hwloc_component * hwloc_static_components[[]] = { +EOF +for comp in [$2]; do + echo " &hwloc_${comp}_component," >>[$1] +done +cat <>[$1] + NULL +}; +EOF +]) diff --git a/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_get_version.sh b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_get_version.sh new file mode 100755 index 00000000000..74bca537cef --- /dev/null +++ b/opal/mca/hwloc/hwloc2x/hwloc/config/hwloc_get_version.sh @@ -0,0 +1,98 @@ +#!/bin/sh +# +# Copyright © 2004-2006 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright © 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright © 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright © 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright © 2008-2014 Cisco Systems, Inc. All rights reserved. +# Copyright © 2014 Inria. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +srcfile="$1" +option="$2" + +if test -z "$srcfile"; then + option="--help" +else + : ${srcdir=.} + + if test -f "$srcfile"; then + ompi_vers=`sed -n " + t clear + : clear + s/^major/HWLOC_MAJOR_VERSION/ + s/^minor/HWLOC_MINOR_VERSION/ + s/^release/HWLOC_RELEASE_VERSION/ + s/^greek/HWLOC_GREEK_VERSION/ + s/\\\${major}/\\\${HWLOC_MAJOR_VERSION}/ + s/\\\${minor}/\\\${HWLOC_MINOR_VERSION}/ + s/\\\${release}/\\\${HWLOC_RELEASE_VERSION}/ + s/\\\${greek}/\\\${HWLOC_GREEK_VERSION}/ + s/^date/HWLOC_RELEASE_DATE/ + s/^snapshot_version/HWLOC_SNAPSHOT_VERSION/ + s/^snapshot/HWLOC_SNAPSHOT/ + t print + b + : print + p" < "$srcfile"` + eval "$ompi_vers" + + HWLOC_VERSION="$HWLOC_MAJOR_VERSION.$HWLOC_MINOR_VERSION.$HWLOC_RELEASE_VERSION${HWLOC_GREEK_VERSION}" + + # If HWLOC_SNAPSHOT=1, then use HWLOC_SNAPSHOT_VERSION + if test "$HWLOC_SNAPSHOT" = "1"; then + # First, verify that HWLOC_SNAPSHOT_VERSION isn't empty. + if test -z "$HWLOC_SNAPSHOT_VERSION"; then + echo "*** ERROR: $1 contains snapshot=1, but an empty value for snapshot_version" 1>&2 + exit 1 + fi + HWLOC_VERSION=$HWLOC_SNAPSHOT_VERSION + fi + fi + + if test "$option" = ""; then + option="--version" + fi +fi + +case "$option" in + --version) + echo $HWLOC_VERSION + ;; + --release-date) + echo $HWLOC_RELEASE_DATE + ;; + --snapshot) + echo $HWLOC_SNAPSHOT + ;; + -h|--help) + cat <