1
1

hwloc: updates for hwloc 2.0.x API

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
Jeff Squyres 2018-01-04 09:58:50 -08:00 коммит произвёл Brice Goglin
родитель 77cc3fcda5
Коммит af4299ebc5
4 изменённых файлов: 25 добавлений и 7 удалений

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

@ -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 */

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

@ -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-2017 Intel, Inc. All rights reserved.
@ -54,6 +54,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;
/*
@ -149,7 +154,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"));
@ -173,7 +178,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);
@ -195,7 +200,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);

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

@ -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$
*
@ -48,6 +48,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);

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

@ -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-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Mellanox Technologies, Inc.
@ -270,7 +270,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);
}