1
1
openmpi/opal/mca/hwloc/base/hwloc_base_close.c
Ralph Castain b44f8d4b28 Complete implementation of the ess.proc_get_locality API. Up to this point, the API was only capable of telling if the specified proc was sharing a node with you. However, the returned value was capable of telling you much more detailed info - e.g., if the proc shares a socket, a cache, or numa node. We just didn't have the data to provide that detail.
Use hwloc to obtain the cpuset for each process during mpi_init, and share that info in the modex. As it arrives, use a new opal_hwloc_base utility function to parse the value against the local proc's cpuset and determine where they overlap. Cache the value in the pmap object as it may be referenced multiple times.

Thus, the return value from orte_ess.proc_get_locality is a 16-bit bitmask that describes the resources being shared with you. This bitmask can be tested using the macros in opal/mca/paffinity/paffinity.h

Locality is available for all procs, whether launched via mpirun or directly with an external launcher such as slurm or aprun.

This commit was SVN r25331.
2011-10-19 20:18:14 +00:00

50 строки
1.1 KiB
C

/*
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include "opal/constants.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/hwloc/hwloc.h"
#include "opal/mca/hwloc/base/base.h"
int opal_hwloc_base_close(void)
{
if (!opal_hwloc_base_inited) {
return OPAL_SUCCESS;
}
#if OPAL_HAVE_HWLOC
{
opal_list_item_t *item;
/* no need to close the component as it was statically opened */
/* for support of tools such as ompi_info */
for (item = opal_list_remove_first(&opal_hwloc_base_components);
NULL != item;
item = opal_list_remove_first(&opal_hwloc_base_components)) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&opal_hwloc_base_components);
/* free memory */
if (NULL != opal_hwloc_my_cpuset) {
hwloc_bitmap_free(opal_hwloc_my_cpuset);
opal_hwloc_my_cpuset = NULL;
}
}
#endif
/* All done */
opal_hwloc_base_inited = false;
return OPAL_SUCCESS;
}