135 lines
5.6 KiB
Diff
135 lines
5.6 KiB
Diff
|
commit 287d7866d3bd70c1a8d412ffb8e6b12cd7e903d5
|
||
|
Author: Jeff Squyres <jsquyres@cisco.com>
|
||
|
Date: Thu Jan 4 09:58:50 2018 -0800
|
||
|
|
||
|
hwloc: updates for hwloc 2.0.x API
|
||
|
|
||
|
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
|
||
|
|
||
|
diff --git opal/mca/btl/openib/btl_openib_component.c opal/mca/btl/openib/btl_openib_component.c
|
||
|
index c482dcdbcda7..facf338a5373 100644
|
||
|
--- opal/mca/btl/openib/btl_openib_component.c
|
||
|
+++ opal/mca/btl/openib/btl_openib_component.c
|
||
|
@@ -10,7 +10,7 @@
|
||
|
* University of Stuttgart. All rights reserved.
|
||
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||
|
* All rights reserved.
|
||
|
- * Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
|
||
|
+ * Copyright (c) 2006-2018 Cisco Systems, Inc. All rights reserved
|
||
|
* Copyright (c) 2006-2015 Mellanox Technologies. All rights reserved.
|
||
|
* Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights
|
||
|
* reserved.
|
||
|
@@ -1524,7 +1524,11 @@ static uint64_t calculate_total_mem (void)
|
||
|
if (NULL == machine) {
|
||
|
return 0;
|
||
|
}
|
||
|
+#if HWLOC_API_VERSION < 0x20000
|
||
|
return machine->memory.total_memory;
|
||
|
+#else
|
||
|
+ return machine->total_memory;
|
||
|
+#endif
|
||
|
}
|
||
|
|
||
|
/* couldn't find it */
|
||
|
diff --git opal/mca/hwloc/base/hwloc_base_util.c opal/mca/hwloc/base/hwloc_base_util.c
|
||
|
index dd483a7dc1be..61d8b779888c 100644
|
||
|
--- opal/mca/hwloc/base/hwloc_base_util.c
|
||
|
+++ opal/mca/hwloc/base/hwloc_base_util.c
|
||
|
@@ -10,7 +10,7 @@
|
||
|
* University of Stuttgart. All rights reserved.
|
||
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||
|
* All rights reserved.
|
||
|
- * Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
|
||
|
+ * Copyright (c) 2011-2018 Cisco Systems, Inc. All rights reserved
|
||
|
* Copyright (c) 2012-2017 Los Alamos National Security, LLC.
|
||
|
* All rights reserved.
|
||
|
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||
|
@@ -59,6 +59,11 @@
|
||
|
#include "opal/mca/hwloc/hwloc-internal.h"
|
||
|
#include "opal/mca/hwloc/base/base.h"
|
||
|
|
||
|
+#if HWLOC_API_VERSION >= 0x20000
|
||
|
+// JMS Is this right?
|
||
|
+#include "hwloc/shmem.h"
|
||
|
+#endif
|
||
|
+
|
||
|
static bool topo_in_shmem = false;
|
||
|
|
||
|
/*
|
||
|
@@ -154,7 +159,7 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo)
|
||
|
avail = hwloc_bitmap_alloc();
|
||
|
hwloc_bitmap_and(avail, root->online_cpuset, root->allowed_cpuset);
|
||
|
#else
|
||
|
- avail = hwloc_bitmap_dup(root->allowed_cpuset);
|
||
|
+ avail = hwloc_bitmap_dup(root->cpuset);
|
||
|
#endif
|
||
|
OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
|
||
|
"hwloc:base: no cpus specified - using root available cpuset"));
|
||
|
@@ -178,7 +183,7 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo)
|
||
|
hwloc_bitmap_and(pucpus, pu->online_cpuset, pu->allowed_cpuset);
|
||
|
#else
|
||
|
hwloc_bitmap_free(pucpus);
|
||
|
- pucpus = hwloc_bitmap_dup(pu->allowed_cpuset);
|
||
|
+ pucpus = hwloc_bitmap_dup(pu->cpuset);
|
||
|
#endif
|
||
|
hwloc_bitmap_or(res, avail, pucpus);
|
||
|
hwloc_bitmap_copy(avail, res);
|
||
|
@@ -200,7 +205,7 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo)
|
||
|
hwloc_bitmap_and(pucpus, pu->online_cpuset, pu->allowed_cpuset);
|
||
|
#else
|
||
|
hwloc_bitmap_free(pucpus);
|
||
|
- pucpus = hwloc_bitmap_dup(pu->allowed_cpuset);
|
||
|
+ pucpus = hwloc_bitmap_dup(pu->cpuset);
|
||
|
#endif
|
||
|
hwloc_bitmap_or(res, avail, pucpus);
|
||
|
hwloc_bitmap_copy(avail, res);
|
||
|
diff --git orte/mca/rtc/hwloc/rtc_hwloc.c orte/mca/rtc/hwloc/rtc_hwloc.c
|
||
|
index 8acdf572b577..16d5b825e0c7 100644
|
||
|
--- orte/mca/rtc/hwloc/rtc_hwloc.c
|
||
|
+++ orte/mca/rtc/hwloc/rtc_hwloc.c
|
||
|
@@ -1,6 +1,6 @@
|
||
|
/*
|
||
|
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||
|
- * Copyright (c) 2017 Cisco Systems, Inc. All rights reserved
|
||
|
+ * Copyright (c) 2017-2018 Cisco Systems, Inc. All rights reserved
|
||
|
* Copyright (c) 2017 Inria. All rights reserved.
|
||
|
* $COPYRIGHT$
|
||
|
*
|
||
|
@@ -50,6 +50,11 @@
|
||
|
#include "orte/mca/rtc/base/base.h"
|
||
|
#include "rtc_hwloc.h"
|
||
|
|
||
|
+#if HWLOC_API_VERSION >= 0x20000
|
||
|
+// JMS Is this right?
|
||
|
+#include "hwloc/shmem.h"
|
||
|
+#endif
|
||
|
+
|
||
|
static int init(void);
|
||
|
static void finalize(void);
|
||
|
static void assign(orte_job_t *jdata);
|
||
|
diff --git orte/orted/pmix/pmix_server_register_fns.c orte/orted/pmix/pmix_server_register_fns.c
|
||
|
index 25fb26475918..ff98f6de59cb 100644
|
||
|
--- orte/orted/pmix/pmix_server_register_fns.c
|
||
|
+++ orte/orted/pmix/pmix_server_register_fns.c
|
||
|
@@ -11,7 +11,7 @@
|
||
|
* All rights reserved.
|
||
|
* Copyright (c) 2006-2013 Los Alamos National Security, LLC.
|
||
|
* All rights reserved.
|
||
|
- * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
||
|
+ * Copyright (c) 2009-2018 Cisco Systems, Inc. All rights reserved
|
||
|
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||
|
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||
|
* Copyright (c) 2014 Mellanox Technologies, Inc.
|
||
|
@@ -276,7 +276,11 @@ int orte_pmix_server_register_nspace(orte_job_t *jdata, bool force)
|
||
|
kv = OBJ_NEW(opal_value_t);
|
||
|
kv->key = strdup(OPAL_PMIX_AVAIL_PHYS_MEMORY);
|
||
|
kv->type = OPAL_UINT64;
|
||
|
+#if HWLOC_API_VERSION < 0x20000
|
||
|
kv->data.uint64 = machine->memory.total_memory;
|
||
|
+#else
|
||
|
+ kv->data.uint64 = machine->total_memory;
|
||
|
+#endif
|
||
|
opal_list_append(info, &kv->super);
|
||
|
}
|
||
|
|