Per long-ago RFC, now that the odsl default module reports errors nicely, remove all paffinity components except for hwloc and test.
This commit was SVN r23666.
Этот коммит содержится в:
родитель
7acb18f3d4
Коммит
97fb426325
@ -1,43 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
sources = \
|
|
||||||
paffinity_darwin.h \
|
|
||||||
paffinity_darwin_component.c \
|
|
||||||
paffinity_darwin_module.c
|
|
||||||
|
|
||||||
# Make the output library in this directory, and name it either
|
|
||||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
|
||||||
# (for static builds).
|
|
||||||
|
|
||||||
if OMPI_BUILD_paffinity_darwin_DSO
|
|
||||||
component_noinst =
|
|
||||||
component_install = mca_paffinity_darwin.la
|
|
||||||
else
|
|
||||||
component_noinst = libmca_paffinity_darwin.la
|
|
||||||
component_install =
|
|
||||||
endif
|
|
||||||
|
|
||||||
mcacomponentdir = $(pkglibdir)
|
|
||||||
mcacomponent_LTLIBRARIES = $(component_install)
|
|
||||||
mca_paffinity_darwin_la_SOURCES = $(sources)
|
|
||||||
mca_paffinity_darwin_la_LDFLAGS = -module -avoid-version
|
|
||||||
|
|
||||||
noinst_LTLIBRARIES = $(component_noinst)
|
|
||||||
libmca_paffinity_darwin_la_SOURCES =$(sources)
|
|
||||||
libmca_paffinity_darwin_la_LDFLAGS = -module -avoid-version
|
|
@ -1,33 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
|
|
||||||
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
# MCA_paffinity_darwin_CONFIG([action-if-found], [action-if-not-found])
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
AC_DEFUN([MCA_paffinity_darwin_CONFIG],[
|
|
||||||
OMPI_VAR_SCOPE_PUSH([paff_darwin_happy])
|
|
||||||
# check to see if we have <mach/mach_host.h>
|
|
||||||
# as this is a Darwin-specific thing
|
|
||||||
AC_CHECK_HEADER([mach/mach_host.h], [paff_darwin_happy=yes], [paff_darwin_happy=no])
|
|
||||||
|
|
||||||
AS_IF([test "$paff_darwin_happy" = "yes"], [$1], [$2])
|
|
||||||
OMPI_VAR_SCOPE_POP
|
|
||||||
])dnl
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
PARAM_CONFIG_FILES="Makefile"
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MCA_PAFFINITY_DARWIN_EXPORT_H
|
|
||||||
#define MCA_PAFFINITY_DARWIN_EXPORT_H
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/mca/mca.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
|
|
||||||
BEGIN_C_DECLS
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Globally exported variable
|
|
||||||
*/
|
|
||||||
|
|
||||||
OPAL_DECLSPEC extern const opal_paffinity_base_component_2_0_1_t mca_paffinity_darwin_component;
|
|
||||||
|
|
||||||
/* query function */
|
|
||||||
int opal_paffinity_darwin_component_query(mca_base_module_t **module, int *priority);
|
|
||||||
|
|
||||||
END_C_DECLS
|
|
||||||
|
|
||||||
#endif /* MCA_PAFFINITY_DARWIN_EXPORT_H */
|
|
@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*
|
|
||||||
* These symbols are in a file by themselves to provide nice linker
|
|
||||||
* semantics. Since linkers generally pull in symbols by object
|
|
||||||
* files, keeping these symbols as the only symbols in this file
|
|
||||||
* prevents utility programs such as "ompi_info" from having to import
|
|
||||||
* entire components just to query their version and parameters.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/constants.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
#include "paffinity_darwin.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Public string showing the paffinity ompi_darwin component version number
|
|
||||||
*/
|
|
||||||
const char *opal_paffinity_darwin_component_version_string =
|
|
||||||
"OPAL darwin paffinity MCA component version " OPAL_VERSION;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local function
|
|
||||||
*/
|
|
||||||
static int darwin_open(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Instantiate the public struct with all of our public information
|
|
||||||
* and pointers to our public functions in it
|
|
||||||
*/
|
|
||||||
|
|
||||||
const opal_paffinity_base_component_2_0_1_t mca_paffinity_darwin_component = {
|
|
||||||
|
|
||||||
/* First, the mca_component_t struct containing meta information
|
|
||||||
about the component itself */
|
|
||||||
|
|
||||||
{
|
|
||||||
/* Indicate that we are a paffinity v1.1.0 component (which also
|
|
||||||
implies a specific MCA version) */
|
|
||||||
|
|
||||||
OPAL_PAFFINITY_BASE_VERSION_2_0_1,
|
|
||||||
|
|
||||||
/* Component name and version */
|
|
||||||
|
|
||||||
"darwin",
|
|
||||||
OPAL_MAJOR_VERSION,
|
|
||||||
OPAL_MINOR_VERSION,
|
|
||||||
OPAL_RELEASE_VERSION,
|
|
||||||
|
|
||||||
/* Component open and close functions */
|
|
||||||
|
|
||||||
darwin_open,
|
|
||||||
NULL,
|
|
||||||
opal_paffinity_darwin_component_query
|
|
||||||
},
|
|
||||||
/* Next the MCA v1.0.0 component meta data */
|
|
||||||
{
|
|
||||||
/* The component is checkpoint ready */
|
|
||||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static int darwin_open(void)
|
|
||||||
{
|
|
||||||
mca_base_param_reg_int(&mca_paffinity_darwin_component.base_version,
|
|
||||||
"priority",
|
|
||||||
"Priority of the darwin paffinity component",
|
|
||||||
false, false, 20, NULL);
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
@ -1,192 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
/* This component will only be compiled on Solaris, where we are
|
|
||||||
guaranteed to have these headers */
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include <mach/mach_host.h>
|
|
||||||
#include <mach/host_info.h>
|
|
||||||
#include <mach/mach_init.h>
|
|
||||||
|
|
||||||
#include "opal/constants.h"
|
|
||||||
#include "opal/mca/base/mca_base_param.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
#include "opal/mca/paffinity/base/base.h"
|
|
||||||
|
|
||||||
#include "paffinity_darwin.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local functions
|
|
||||||
*/
|
|
||||||
static int init(void);
|
|
||||||
static int set(opal_paffinity_base_cpu_set_t cpumask);
|
|
||||||
static int get(opal_paffinity_base_cpu_set_t *cpumask);
|
|
||||||
static int finalize(void);
|
|
||||||
static int map_to_processor_id(int socket, int core, int *processor_id);
|
|
||||||
static int map_to_socket_core(int processor_id, int *socket, int *core);
|
|
||||||
static int get_processor_info(int *num_processors);
|
|
||||||
static int get_socket_info(int *num_sockets);
|
|
||||||
static int get_core_info(int socket, int *num_cores);
|
|
||||||
static int get_physical_processor_id(int logical_processor_id,
|
|
||||||
int *physical_processor_id);
|
|
||||||
static int get_physical_socket_id(int logical_socket_id,
|
|
||||||
int *physical_socket_id);
|
|
||||||
static int get_physical_core_id(int physical_socket_id, int logical_core_id,
|
|
||||||
int *physical_core_id);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Solaris paffinity module
|
|
||||||
*/
|
|
||||||
static const opal_paffinity_base_module_1_1_0_t loc_module = {
|
|
||||||
/* Initialization function */
|
|
||||||
init,
|
|
||||||
|
|
||||||
/* Module function pointers */
|
|
||||||
set,
|
|
||||||
get,
|
|
||||||
map_to_processor_id,
|
|
||||||
map_to_socket_core,
|
|
||||||
get_processor_info,
|
|
||||||
get_socket_info,
|
|
||||||
get_core_info,
|
|
||||||
get_physical_processor_id,
|
|
||||||
get_physical_socket_id,
|
|
||||||
get_physical_core_id,
|
|
||||||
finalize
|
|
||||||
};
|
|
||||||
|
|
||||||
int opal_paffinity_darwin_component_query(mca_base_module_t **module, int *priority)
|
|
||||||
{
|
|
||||||
/* set this priority high enough to override posix */
|
|
||||||
*priority = 30;
|
|
||||||
*module = (mca_base_module_t *)&loc_module;
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do nothing here. both mpirun and processes would run init(), but
|
|
||||||
* only processes would run the set function */
|
|
||||||
static int init(void)
|
|
||||||
{
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this gives us a cpumask which tells which CPU to bind */
|
|
||||||
static int set(opal_paffinity_base_cpu_set_t cpumask)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This get function returns the CPU id that's currently binded,
|
|
||||||
* and then sets the cpumask. */
|
|
||||||
static int get(opal_paffinity_base_cpu_set_t *cpumask)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int map_to_processor_id(int socket, int core, int *processor_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int map_to_socket_core(int processor_id, int *socket, int *core)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_processor_info(int *num_processors)
|
|
||||||
{
|
|
||||||
int rc=OPAL_SUCCESS, num_cores;
|
|
||||||
#if !OPAL_HAVE__SC_NPROCESSORS_ONLN
|
|
||||||
host_basic_info_data_t hostInfo;
|
|
||||||
mach_msg_type_number_t infoCount;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if OPAL_HAVE__SC_NPROCESSORS_ONLN
|
|
||||||
/* this must be Leopard - get the number of active processors */
|
|
||||||
if (0 > (num_cores = sysconf(_SC_NPROCESSORS_ONLN))) {
|
|
||||||
/* system was unable to provide a number, so return
|
|
||||||
* an error and set the values to something negative
|
|
||||||
*/
|
|
||||||
num_cores = -1;
|
|
||||||
rc = OPAL_ERR_NOT_FOUND;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* this must be Tiger - unlike Leopard, Tiger doesn't allow
|
|
||||||
* users to turn processors on/off on-the-fly. So we have
|
|
||||||
* to query the #processors in a different way
|
|
||||||
*/
|
|
||||||
infoCount = HOST_BASIC_INFO_COUNT;
|
|
||||||
if (KERN_SUCCESS != (host_info(mach_host_self(), HOST_BASIC_INFO,
|
|
||||||
(host_info_t)&hostInfo, &infoCount))) {
|
|
||||||
num_cores = -1;
|
|
||||||
rc = OPAL_ERR_NOT_FOUND;
|
|
||||||
} else {
|
|
||||||
num_cores = hostInfo.max_cpus;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* rc will contain the number of processors
|
|
||||||
* that are currently online - return that value
|
|
||||||
*/
|
|
||||||
*num_processors = num_cores;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_socket_info(int *num_sockets)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_core_info(int socket, int *num_cores)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_processor_id(int logical_processor_id,
|
|
||||||
int *physical_processor_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_socket_id(int logical_socket_id,
|
|
||||||
int *physical_socket_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_core_id(int physical_socket_id, int logical_core_id,
|
|
||||||
int *physical_core_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finalize(void)
|
|
||||||
{
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
sources = \
|
|
||||||
paffinity_posix.h \
|
|
||||||
paffinity_posix_component.c \
|
|
||||||
paffinity_posix_module.c
|
|
||||||
|
|
||||||
# Make the output library in this directory, and name it either
|
|
||||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
|
||||||
# (for static builds).
|
|
||||||
|
|
||||||
if OMPI_BUILD_paffinity_posix_DSO
|
|
||||||
component_noinst =
|
|
||||||
component_install = mca_paffinity_posix.la
|
|
||||||
else
|
|
||||||
component_noinst = libmca_paffinity_posix.la
|
|
||||||
component_install =
|
|
||||||
endif
|
|
||||||
|
|
||||||
mcacomponentdir = $(pkglibdir)
|
|
||||||
mcacomponent_LTLIBRARIES = $(component_install)
|
|
||||||
mca_paffinity_posix_la_SOURCES = $(sources)
|
|
||||||
mca_paffinity_posix_la_LDFLAGS = -module -avoid-version
|
|
||||||
|
|
||||||
noinst_LTLIBRARIES = $(component_noinst)
|
|
||||||
libmca_paffinity_posix_la_SOURCES =$(sources)
|
|
||||||
libmca_paffinity_posix_la_LDFLAGS = -module -avoid-version
|
|
@ -1,41 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
|
|
||||||
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
# MCA_paffinity_posix_CONFIG([action-if-found], [action-if-not-found])
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
AC_DEFUN([MCA_paffinity_posix_CONFIG],[
|
|
||||||
OMPI_VAR_SCOPE_PUSH([paff_posix_happy])
|
|
||||||
# Check to see if we have <unistd.h>
|
|
||||||
AC_CHECK_HEADER([unistd.h], [paff_posix_happy=yes], [paff_posix_happy=no])
|
|
||||||
|
|
||||||
# Check to see if we have _SC_NPROCESSORS_ONLN (this was already
|
|
||||||
# checked up in the main configure.ac; just do a cache check
|
|
||||||
# here).
|
|
||||||
AS_IF([test "$paff_posix_happy" = "yes"],
|
|
||||||
[AC_MSG_CHECKING([for _SC_NPROCESSORS_ONLN])
|
|
||||||
AS_IF([test "$ompi_cv_have__SC_NPROCESSORS_ONLN" = "yes"],
|
|
||||||
[paff_posix_happy=yes], [paff_posix_happy=no])
|
|
||||||
AC_MSG_RESULT([(cached) $paff_posix_happy])])
|
|
||||||
|
|
||||||
AS_IF([test "$paff_posix_happy" = "yes"], [$1], [$2])
|
|
||||||
OMPI_VAR_SCOPE_POP
|
|
||||||
])dnl
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
PARAM_CONFIG_FILES="Makefile"
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MCA_PAFFINITY_POSIX_EXPORT_H
|
|
||||||
#define MCA_PAFFINITY_POSIX_EXPORT_H
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/mca/mca.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
|
|
||||||
BEGIN_C_DECLS
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Globally exported variable
|
|
||||||
*/
|
|
||||||
|
|
||||||
OPAL_DECLSPEC extern const opal_paffinity_base_component_2_0_1_t mca_paffinity_posix_component;
|
|
||||||
|
|
||||||
/* query function */
|
|
||||||
int opal_paffinity_posix_component_query(mca_base_module_t **module, int *priority);
|
|
||||||
|
|
||||||
END_C_DECLS
|
|
||||||
|
|
||||||
#endif /* MCA_PAFFINITY_POSIX_EXPORT_H */
|
|
@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*
|
|
||||||
* These symbols are in a file by themselves to provide nice linker
|
|
||||||
* semantics. Since linkers generally pull in symbols by object
|
|
||||||
* files, keeping these symbols as the only symbols in this file
|
|
||||||
* prevents utility programs such as "ompi_info" from having to import
|
|
||||||
* entire components just to query their version and parameters.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/constants.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
#include "paffinity_posix.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Public string showing the paffinity ompi_posix component version number
|
|
||||||
*/
|
|
||||||
const char *opal_paffinity_posix_component_version_string =
|
|
||||||
"OPAL posix paffinity MCA component version " OPAL_VERSION;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local function
|
|
||||||
*/
|
|
||||||
static int posix_open(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Instantiate the public struct with all of our public information
|
|
||||||
* and pointers to our public functions in it
|
|
||||||
*/
|
|
||||||
|
|
||||||
const opal_paffinity_base_component_2_0_1_t mca_paffinity_posix_component = {
|
|
||||||
|
|
||||||
/* First, the mca_component_t struct containing meta information
|
|
||||||
about the component itself */
|
|
||||||
|
|
||||||
{
|
|
||||||
/* Indicate that we are a paffinity v1.1.0 component (which also
|
|
||||||
implies a specific MCA version) */
|
|
||||||
|
|
||||||
OPAL_PAFFINITY_BASE_VERSION_2_0_1,
|
|
||||||
|
|
||||||
/* Component name and version */
|
|
||||||
|
|
||||||
"posix",
|
|
||||||
OPAL_MAJOR_VERSION,
|
|
||||||
OPAL_MINOR_VERSION,
|
|
||||||
OPAL_RELEASE_VERSION,
|
|
||||||
|
|
||||||
/* Component open and close functions */
|
|
||||||
|
|
||||||
posix_open,
|
|
||||||
NULL,
|
|
||||||
opal_paffinity_posix_component_query
|
|
||||||
},
|
|
||||||
/* Next the MCA v1.0.0 component meta data */
|
|
||||||
{
|
|
||||||
/* The component is checkpoint ready */
|
|
||||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static int posix_open(void)
|
|
||||||
{
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
@ -1,171 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
/* This component will only be compiled on Solaris, where we are
|
|
||||||
guaranteed to have these headers */
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "opal/constants.h"
|
|
||||||
#include "opal/mca/base/mca_base_param.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
#include "opal/mca/paffinity/base/base.h"
|
|
||||||
|
|
||||||
#include "paffinity_posix.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local functions
|
|
||||||
*/
|
|
||||||
static int posix_module_init(void);
|
|
||||||
static int posix_module_set(opal_paffinity_base_cpu_set_t cpumask);
|
|
||||||
static int posix_module_get(opal_paffinity_base_cpu_set_t *cpumask);
|
|
||||||
static int posix_module_finalize(void);
|
|
||||||
static int posix_module_map_to_processor_id(int socket, int core, int *processor_id);
|
|
||||||
static int posix_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
|
||||||
static int posix_module_get_processor_info(int *num_processors);
|
|
||||||
static int posix_module_get_socket_info(int *num_sockets);
|
|
||||||
static int posix_module_get_core_info(int socket, int *num_cores);
|
|
||||||
static int get_physical_processor_id(int logical_processor_id,
|
|
||||||
int *physical_processor_id);
|
|
||||||
static int get_physical_socket_id(int logical_socket_id,
|
|
||||||
int *physical_socket_id);
|
|
||||||
static int get_physical_core_id(int physical_socket_id, int logical_core_id,
|
|
||||||
int *physical_core_id);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Solaris paffinity module
|
|
||||||
*/
|
|
||||||
static const opal_paffinity_base_module_1_1_0_t loc_module = {
|
|
||||||
/* Initialization function */
|
|
||||||
posix_module_init,
|
|
||||||
|
|
||||||
/* Module function pointers */
|
|
||||||
posix_module_set,
|
|
||||||
posix_module_get,
|
|
||||||
posix_module_map_to_processor_id,
|
|
||||||
posix_module_map_to_socket_core,
|
|
||||||
posix_module_get_processor_info,
|
|
||||||
posix_module_get_socket_info,
|
|
||||||
posix_module_get_core_info,
|
|
||||||
get_physical_processor_id,
|
|
||||||
get_physical_socket_id,
|
|
||||||
get_physical_core_id,
|
|
||||||
posix_module_finalize
|
|
||||||
};
|
|
||||||
|
|
||||||
int opal_paffinity_posix_component_query(mca_base_module_t **module, int *priority)
|
|
||||||
{
|
|
||||||
/* set this priority really low so we will be overridden by any
|
|
||||||
* other component such as linux or solaris if they can build
|
|
||||||
*/
|
|
||||||
*priority = 2;
|
|
||||||
*module = (mca_base_module_t *)&loc_module;
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do nothing here. both mpirun and processes would run init(), but
|
|
||||||
* only processes would run the posix_module_set function */
|
|
||||||
static int posix_module_init(void)
|
|
||||||
{
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this gives us a cpumask which tells which CPU to bind */
|
|
||||||
static int posix_module_set(opal_paffinity_base_cpu_set_t cpumask)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This get function returns the CPU id that's currently binded,
|
|
||||||
* and then sets the cpumask. */
|
|
||||||
static int posix_module_get(opal_paffinity_base_cpu_set_t *cpumask)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int posix_module_map_to_processor_id(int socket, int core, int *processor_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int posix_module_map_to_socket_core(int processor_id, int *socket, int *core)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int posix_module_get_processor_info(int *num_processors)
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
/* get the number of active processors */
|
|
||||||
if (0 > (rc = sysconf(_SC_NPROCESSORS_ONLN))) {
|
|
||||||
/* system was unable to provide a number, so return
|
|
||||||
* an error and set the values to something negative
|
|
||||||
*/
|
|
||||||
*num_processors = -1;
|
|
||||||
return OPAL_ERR_NOT_FOUND;
|
|
||||||
}
|
|
||||||
/* rc will contain the number of processors
|
|
||||||
* that are currently online - return that value
|
|
||||||
*/
|
|
||||||
*num_processors = rc;
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int posix_module_get_socket_info(int *num_sockets)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int posix_module_get_core_info(int socket, int *num_cores)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_processor_id(int logical_processor_id,
|
|
||||||
int *physical_processor_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_socket_id(int logical_socket_id,
|
|
||||||
int *physical_socket_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_core_id(int physical_socket_id, int logical_core_id,
|
|
||||||
int *physical_core_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int posix_module_finalize(void)
|
|
||||||
{
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
sources = \
|
|
||||||
paffinity_solaris.h \
|
|
||||||
paffinity_solaris_component.c \
|
|
||||||
paffinity_solaris_module.c
|
|
||||||
|
|
||||||
# Make the output library in this directory, and name it either
|
|
||||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
|
||||||
# (for static builds).
|
|
||||||
|
|
||||||
if OMPI_BUILD_paffinity_solaris_DSO
|
|
||||||
component_noinst =
|
|
||||||
component_install = mca_paffinity_solaris.la
|
|
||||||
else
|
|
||||||
component_noinst = libmca_paffinity_solaris.la
|
|
||||||
component_install =
|
|
||||||
endif
|
|
||||||
|
|
||||||
mcacomponentdir = $(pkglibdir)
|
|
||||||
mcacomponent_LTLIBRARIES = $(component_install)
|
|
||||||
mca_paffinity_solaris_la_SOURCES = $(sources)
|
|
||||||
mca_paffinity_solaris_la_LDFLAGS = -module -avoid-version
|
|
||||||
|
|
||||||
noinst_LTLIBRARIES = $(component_noinst)
|
|
||||||
libmca_paffinity_solaris_la_SOURCES =$(sources)
|
|
||||||
libmca_paffinity_solaris_la_LDFLAGS = -module -avoid-version
|
|
@ -1,45 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
|
||||||
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
# MCA_paffinity_solaris_CONFIG([action-if-found], [action-if-not-found])
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
AC_DEFUN([MCA_paffinity_solaris_CONFIG],[
|
|
||||||
OMPI_VAR_SCOPE_PUSH([paff_solaris_happy])
|
|
||||||
#check to see if we have <sys/procset.h>
|
|
||||||
AC_CHECK_HEADER([sys/procset.h], [paff_solaris_happy=yes], [paff_solaris_happy=no])
|
|
||||||
|
|
||||||
if test "$paff_solaris_happy" = "yes"; then
|
|
||||||
# check for processor_bind()
|
|
||||||
AC_CHECK_FUNC([processor_bind],[paff_solaris_happy=yes],[paff_solaris_happy=no])
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$paff_solaris_happy" = "yes"; then
|
|
||||||
# check for whether header has P_PID defined
|
|
||||||
AC_MSG_CHECKING([if P_PID is defined])
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/procset.h>]], [[int i = P_PID;]])],
|
|
||||||
[paff_solaris_happy=yes],[paff_solaris_happy=no])
|
|
||||||
AC_MSG_RESULT([$paff_solaris_happy ])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AS_IF([test "$paff_solaris_happy" = "yes"], [$1], [$2])
|
|
||||||
OMPI_VAR_SCOPE_POP
|
|
||||||
])dnl
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
PARAM_CONFIG_FILES="Makefile"
|
|
@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MCA_PAFFINITY_SOLARIS_EXPORT_H
|
|
||||||
#define MCA_PAFFINITY_SOLARIS_EXPORT_H
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/mca/mca.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
|
|
||||||
BEGIN_C_DECLS
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Globally exported variable
|
|
||||||
*/
|
|
||||||
|
|
||||||
OPAL_DECLSPEC extern const opal_paffinity_base_component_2_0_1_t
|
|
||||||
mca_paffinity_solaris_component;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* paffinity API functions
|
|
||||||
*/
|
|
||||||
int opal_paffinity_solaris_component_query(mca_base_module_t **module, int *priority);
|
|
||||||
|
|
||||||
END_C_DECLS
|
|
||||||
#endif /* MCA_PAFFINITY_SOLARIS_EXPORT_H */
|
|
@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*
|
|
||||||
* These symbols are in a file by themselves to provide nice linker
|
|
||||||
* semantics. Since linkers generally pull in symbols by object
|
|
||||||
* files, keeping these symbols as the only symbols in this file
|
|
||||||
* prevents utility programs such as "ompi_info" from having to import
|
|
||||||
* entire components just to query their version and parameters.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/constants.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
#include "paffinity_solaris.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Public string showing the paffinity ompi_solaris component version number
|
|
||||||
*/
|
|
||||||
const char *opal_paffinity_solaris_component_version_string =
|
|
||||||
"OPAL solaris paffinity MCA component version " OPAL_VERSION;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local function
|
|
||||||
*/
|
|
||||||
static int solaris_register(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Instantiate the public struct with all of our public information
|
|
||||||
* and pointers to our public functions in it
|
|
||||||
*/
|
|
||||||
|
|
||||||
const opal_paffinity_base_component_2_0_1_t mca_paffinity_solaris_component = {
|
|
||||||
|
|
||||||
/* First, the mca_component_t struct containing meta information
|
|
||||||
about the component itself */
|
|
||||||
|
|
||||||
{
|
|
||||||
OPAL_PAFFINITY_BASE_VERSION_2_0_1,
|
|
||||||
|
|
||||||
/* Component name and version */
|
|
||||||
"solaris",
|
|
||||||
OPAL_MAJOR_VERSION,
|
|
||||||
OPAL_MINOR_VERSION,
|
|
||||||
OPAL_RELEASE_VERSION,
|
|
||||||
|
|
||||||
/* Component open and close functions */
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
opal_paffinity_solaris_component_query,
|
|
||||||
solaris_register,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
/* The component is checkpoint ready */
|
|
||||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static int solaris_register(void)
|
|
||||||
{
|
|
||||||
mca_base_param_reg_int(&mca_paffinity_solaris_component.base_version,
|
|
||||||
"priority",
|
|
||||||
"Priority of the solaris paffinity component",
|
|
||||||
false, false, 30, NULL);
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
@ -1,251 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved.
|
|
||||||
*
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
/* This component will only be compiled on Solaris, where we are
|
|
||||||
guaranteed to have these headers */
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/processor.h>
|
|
||||||
#include <sys/procset.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "opal/constants.h"
|
|
||||||
#include "opal/mca/base/mca_base_param.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
#include "opal/mca/paffinity/base/base.h"
|
|
||||||
#include "paffinity_solaris.h"
|
|
||||||
#include "opal/util/output.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local functions
|
|
||||||
*/
|
|
||||||
static int solaris_module_init(void);
|
|
||||||
static int solaris_module_set(opal_paffinity_base_cpu_set_t cpumask);
|
|
||||||
static int solaris_module_get(opal_paffinity_base_cpu_set_t *cpumask);
|
|
||||||
static int solaris_module_finalize(void);
|
|
||||||
static int cpumask_to_id(opal_paffinity_base_cpu_set_t cpumask);
|
|
||||||
static int solaris_module_map_to_processor_id(int socket, int core, int *processor_id);
|
|
||||||
static int solaris_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
|
||||||
static int solaris_module_get_processor_info(int *num_processors);
|
|
||||||
static int solaris_module_get_socket_info(int *num_sockets);
|
|
||||||
static int solaris_module_get_core_info(int socket, int *num_cores);
|
|
||||||
static int solaris_module_get_physical_processor_id(int logical_processor_id,
|
|
||||||
int *physical_processor_id);
|
|
||||||
static int solaris_module_get_physical_socket_id(int logical_socket_id,
|
|
||||||
int *physical_socket_id);
|
|
||||||
static int solaris_module_get_physical_core_id(int physical_socket_id,
|
|
||||||
int logical_core_id,
|
|
||||||
int *physical_core_id);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Solaris paffinity module
|
|
||||||
*/
|
|
||||||
static const opal_paffinity_base_module_1_1_0_t loc_module = {
|
|
||||||
/* Initialization function */
|
|
||||||
solaris_module_init,
|
|
||||||
|
|
||||||
/* Module function pointers */
|
|
||||||
solaris_module_set,
|
|
||||||
solaris_module_get,
|
|
||||||
solaris_module_map_to_processor_id,
|
|
||||||
solaris_module_map_to_socket_core,
|
|
||||||
solaris_module_get_processor_info,
|
|
||||||
solaris_module_get_socket_info,
|
|
||||||
solaris_module_get_core_info,
|
|
||||||
solaris_module_get_physical_processor_id,
|
|
||||||
solaris_module_get_physical_socket_id,
|
|
||||||
solaris_module_get_physical_core_id,
|
|
||||||
solaris_module_finalize
|
|
||||||
};
|
|
||||||
|
|
||||||
int opal_paffinity_solaris_component_query(mca_base_module_t **module, int *priority)
|
|
||||||
{
|
|
||||||
int param;
|
|
||||||
|
|
||||||
param = mca_base_param_find("paffinity", "solaris", "priority");
|
|
||||||
mca_base_param_lookup_int(param, priority);
|
|
||||||
|
|
||||||
*module = (mca_base_module_t *)&loc_module;
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do nothing here. both mpirun and processes would run init(), but
|
|
||||||
* only processes would run the solaris_module_set function */
|
|
||||||
static int solaris_module_init(void)
|
|
||||||
{
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this gives us a cpumask which tells which CPU to bind */
|
|
||||||
static int solaris_module_set(opal_paffinity_base_cpu_set_t cpumask)
|
|
||||||
{
|
|
||||||
processorid_t cpuid;
|
|
||||||
|
|
||||||
|
|
||||||
/* Find out where in the cpumask is the location of the current CPU. */
|
|
||||||
cpuid = cpumask_to_id(cpumask);
|
|
||||||
if (-1 == cpuid) {
|
|
||||||
opal_output(0, "paffinity:solaris: Error when coverting cpumask to id");
|
|
||||||
return OPAL_ERR_IN_ERRNO;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (0 != processor_bind(P_PID, P_MYID, cpuid, NULL)) {
|
|
||||||
opal_output(0, "paffinity:solaris: Error when binding to CPU #%d: %s",
|
|
||||||
cpuid, strerror(errno));
|
|
||||||
return OPAL_ERR_IN_ERRNO;
|
|
||||||
}
|
|
||||||
|
|
||||||
opal_output_verbose(5, opal_paffinity_base_output,
|
|
||||||
"paffinity:solaris: Successfully bind to CPU #%d", cpuid);
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this takes a cpumask and converts it to CPU id on a node */
|
|
||||||
static int cpumask_to_id(opal_paffinity_base_cpu_set_t cpumask)
|
|
||||||
{
|
|
||||||
int currid;
|
|
||||||
|
|
||||||
for(currid=0; currid<OPAL_PAFFINITY_BITMASK_CPU_MAX; currid++) {
|
|
||||||
if (OPAL_PAFFINITY_CPU_ISSET(currid, cpumask))
|
|
||||||
return currid;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This get function returns the CPU id that's currently binded,
|
|
||||||
* and then sets the cpumask. */
|
|
||||||
static int solaris_module_get(opal_paffinity_base_cpu_set_t *cpumask)
|
|
||||||
{
|
|
||||||
processorid_t obind;
|
|
||||||
if (0 != processor_bind(P_PID, P_MYID, PBIND_QUERY, &obind)) {
|
|
||||||
return OPAL_ERR_IN_ERRNO;
|
|
||||||
}
|
|
||||||
|
|
||||||
opal_output_verbose(5, opal_paffinity_base_output,
|
|
||||||
"paffinity:solaris: obind=%d", obind);
|
|
||||||
|
|
||||||
/* if there isn't any processor binded, just zero out and return */
|
|
||||||
OPAL_PAFFINITY_CPU_ZERO(*cpumask);
|
|
||||||
if (PBIND_NONE != obind) {
|
|
||||||
OPAL_PAFFINITY_CPU_SET(obind, *cpumask);
|
|
||||||
}
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int solaris_module_map_to_processor_id(int socket, int core, int *processor_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int solaris_module_map_to_socket_core(int processor_id, int *socket, int *core)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int solaris_module_get_processor_info(int *num_processors)
|
|
||||||
{
|
|
||||||
processorid_t currid, cpuid_max;
|
|
||||||
processor_info_t pinfo;
|
|
||||||
|
|
||||||
/* cpuid_max is the max number available for a system arch. It is
|
|
||||||
* an inclusive list. e.g. If cpuid_max=31, cpuid would be 0-31 */
|
|
||||||
cpuid_max = sysconf(_SC_CPUID_MAX);
|
|
||||||
|
|
||||||
/* clear out num_processors to make sure we get the correct count */
|
|
||||||
*num_processors = 0;
|
|
||||||
|
|
||||||
/* Because not all CPU ID in cpuid_max are actually valid,
|
|
||||||
* and CPU ID may also not be contiguous. Therefore we
|
|
||||||
* need to run through processor_info to ensure the validity.
|
|
||||||
* Then find out which are actually online */
|
|
||||||
for (currid=0; currid<=cpuid_max; currid++) {
|
|
||||||
if (0 == processor_info(currid, &pinfo)) {
|
|
||||||
if (P_ONLINE == pinfo.pi_state || P_NOINTR == pinfo.pi_state) {
|
|
||||||
(*num_processors)++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int solaris_module_get_socket_info(int *num_sockets)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int solaris_module_get_core_info(int socket, int *num_cores)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int solaris_module_get_physical_processor_id(int logical_processor_id,
|
|
||||||
int *physical_processor_id)
|
|
||||||
{
|
|
||||||
processorid_t currid, cpuid_max, cpuid_log=0;
|
|
||||||
processor_info_t pinfo;
|
|
||||||
|
|
||||||
/* cpuid_max is the max number available for a system arch. It is
|
|
||||||
* an inclusive list. e.g. If cpuid_max=31, cpuid would be 0-31 */
|
|
||||||
if ( 0 > (cpuid_max = sysconf(_SC_CPUID_MAX))) {
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Because not all CPU ID in cpuid_max are actually valid,
|
|
||||||
* and CPU ID may also not be contiguous. Therefore we
|
|
||||||
* need to run through processor_info to ensure the validity.
|
|
||||||
* Then find out which are actually online */
|
|
||||||
for (currid=0; currid<=cpuid_max; currid++) {
|
|
||||||
if (0 == processor_info(currid, &pinfo)) {
|
|
||||||
if (P_ONLINE == pinfo.pi_state || P_NOINTR == pinfo.pi_state) {
|
|
||||||
if (cpuid_log == logical_processor_id) {
|
|
||||||
*physical_processor_id = currid;
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
cpuid_log++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return OPAL_ERR_NOT_FOUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int solaris_module_get_physical_socket_id(int logical_socket_id,
|
|
||||||
int *physical_socket_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int solaris_module_get_physical_core_id(int physical_socket_id,
|
|
||||||
int logical_core_id,
|
|
||||||
int *physical_core_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int solaris_module_finalize(void)
|
|
||||||
{
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2009 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
EXTRA_DIST = .windows
|
|
||||||
|
|
||||||
sources = \
|
|
||||||
paffinity_windows.h \
|
|
||||||
paffinity_windows_component.c \
|
|
||||||
paffinity_windows_module.c
|
|
||||||
|
|
||||||
# Make the output library in this directory, and name it either
|
|
||||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
|
||||||
# (for static builds).
|
|
||||||
|
|
||||||
if OMPI_BUILD_paffinity_windows_DSO
|
|
||||||
component_noinst =
|
|
||||||
component_install = mca_paffinity_windows.la
|
|
||||||
else
|
|
||||||
component_noinst = libmca_paffinity_windows.la
|
|
||||||
component_install =
|
|
||||||
endif
|
|
||||||
|
|
||||||
mcacomponentdir = $(pkglibdir)
|
|
||||||
mcacomponent_LTLIBRARIES = $(component_install)
|
|
||||||
mca_paffinity_windows_la_SOURCES = $(sources)
|
|
||||||
mca_paffinity_windows_la_LDFLAGS = -module -avoid-version
|
|
||||||
|
|
||||||
noinst_LTLIBRARIES = $(component_noinst)
|
|
||||||
libmca_paffinity_windows_la_SOURCES =$(sources)
|
|
||||||
libmca_paffinity_windows_la_LDFLAGS = -module -avoid-version
|
|
@ -1,45 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
# MCA_paffinity_windows_CONFIG([action-if-found], [action-if-not-found])
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
AC_DEFUN([MCA_paffinity_windows_CONFIG],[
|
|
||||||
# check for GetProcessAffinityMask, which is defined only for some
|
|
||||||
# flavors of Windows. We should first check that the function is defined,
|
|
||||||
# and then check for it's presence in the kernel32 library.
|
|
||||||
AC_MSG_CHECKING(for working GetProcessAffinityMask)
|
|
||||||
AC_TRY_RUN( [#include <windows.h>
|
|
||||||
int main( int argc, char** argv ) {
|
|
||||||
DWORD aff, mask;
|
|
||||||
GetProcessAffinityMask( NULL, &aff, &mask );
|
|
||||||
return 0; }],
|
|
||||||
[AC_MSG_RESULT([yes])
|
|
||||||
$1],
|
|
||||||
[AC_MSG_RESULT([no])
|
|
||||||
$2],
|
|
||||||
[AC_COMPILE_IFELSE([#include <windows.h>
|
|
||||||
int main( int argc, char** argv ) {
|
|
||||||
DWORD aff, mask;
|
|
||||||
GetProcessAffinityMask( NULL, &aff, &mask );
|
|
||||||
return 0; }],
|
|
||||||
[AC_MSG_RESULT([yes])
|
|
||||||
$1],
|
|
||||||
[AC_MSG_RESULT([no])
|
|
||||||
$2])])
|
|
||||||
])dnl
|
|
@ -1,23 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
PARAM_CONFIG_FILES="Makefile"
|
|
@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file
|
|
||||||
*
|
|
||||||
* Processor affinity for Microsoft Windows.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef MCA_PAFFINITY_WINDOWS_EXPORT_H
|
|
||||||
#define MCA_PAFFINITY_WINDOWS_EXPORT_H
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/mca/mca.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether we have a working CPU_ZERO() macro or not. If
|
|
||||||
* not, use memset().
|
|
||||||
*/
|
|
||||||
#ifdef HAVE_CPU_ZERO
|
|
||||||
#define OMPI_CPU_ZERO(foo) CPU_ZERO(foo)
|
|
||||||
#else
|
|
||||||
#include <string.h>
|
|
||||||
#define OMPI_CPU_ZERO(foo) memset(foo, 0, sizeof(*foo))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN_C_DECLS
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Globally exported variable
|
|
||||||
*/
|
|
||||||
OPAL_MODULE_DECLSPEC extern const opal_paffinity_base_component_2_0_1_t
|
|
||||||
mca_paffinity_windows_component;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* paffinity query API function
|
|
||||||
*/
|
|
||||||
int opal_paffinity_windows_component_query(mca_base_module_t **module, int *priority);
|
|
||||||
|
|
||||||
END_C_DECLS
|
|
||||||
#endif /* MCA_PAFFINITY_WINDOWS_EXPORT_H */
|
|
@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*
|
|
||||||
* These symbols are in a file by themselves to provide nice linker
|
|
||||||
* semantics. Since linkers generally pull in symbols by object
|
|
||||||
* files, keeping these symbols as the only symbols in this file
|
|
||||||
* prevents utility programs such as "ompi_info" from having to import
|
|
||||||
* entire components just to query their version and parameters.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/constants.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
#include "paffinity_windows.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Public string showing the paffinity ompi_windows component version number
|
|
||||||
*/
|
|
||||||
const char *opal_paffinity_windows_component_version_string =
|
|
||||||
"OPAL windows paffinity MCA component version " OPAL_VERSION;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local function
|
|
||||||
*/
|
|
||||||
static int windows_open(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Instantiate the public struct with all of our public information
|
|
||||||
* and pointers to our public functions in it
|
|
||||||
*/
|
|
||||||
|
|
||||||
const opal_paffinity_base_component_2_0_1_t mca_paffinity_windows_component = {
|
|
||||||
|
|
||||||
/* First, the mca_component_t struct containing meta information
|
|
||||||
about the component itself */
|
|
||||||
|
|
||||||
{
|
|
||||||
OPAL_PAFFINITY_BASE_VERSION_2_0_1,
|
|
||||||
|
|
||||||
/* Component name and version */
|
|
||||||
"windows",
|
|
||||||
OPAL_MAJOR_VERSION,
|
|
||||||
OPAL_MINOR_VERSION,
|
|
||||||
OPAL_RELEASE_VERSION,
|
|
||||||
|
|
||||||
/* Component open and close functions */
|
|
||||||
windows_open,
|
|
||||||
NULL,
|
|
||||||
opal_paffinity_windows_component_query
|
|
||||||
},
|
|
||||||
{
|
|
||||||
/* The component is checkpoint ready */
|
|
||||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static int windows_open(void)
|
|
||||||
{
|
|
||||||
mca_base_param_reg_int(&mca_paffinity_windows_component.base_version,
|
|
||||||
"priority",
|
|
||||||
"Priority of the windows paffinity component",
|
|
||||||
false, false, 20, NULL);
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
@ -1,178 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
|
||||||
* University Research and Technology
|
|
||||||
* Corporation. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
|
||||||
* of Tennessee Research Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opal_config.h"
|
|
||||||
|
|
||||||
#include "opal/constants.h"
|
|
||||||
#include "opal/mca/base/mca_base_param.h"
|
|
||||||
#include "opal/mca/paffinity/paffinity.h"
|
|
||||||
#include "opal/mca/paffinity/base/base.h"
|
|
||||||
#include "paffinity_windows.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local functions
|
|
||||||
*/
|
|
||||||
static int windows_module_init(void);
|
|
||||||
static int windows_module_finalize(void);
|
|
||||||
static int windows_module_get_num_procs(int *num_procs);
|
|
||||||
static int windows_module_set(opal_paffinity_base_cpu_set_t cpumask);
|
|
||||||
static int windows_module_get(opal_paffinity_base_cpu_set_t *cpumask);
|
|
||||||
static int windows_module_map_to_processor_id(int socket, int core, int *processor_id);
|
|
||||||
static int windows_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
|
||||||
static int windows_module_get_processor_info(int *num_processors);
|
|
||||||
static int windows_module_get_socket_info(int *num_sockets);
|
|
||||||
static int windows_module_get_core_info(int socket, int *num_cores);
|
|
||||||
static int get_physical_processor_id(int logical_processor_id,
|
|
||||||
int *physical_processor_id);
|
|
||||||
static int get_physical_socket_id(int logical_socket_id,
|
|
||||||
int *physical_socket_id);
|
|
||||||
static int get_physical_core_id(int physical_socket_id, int logical_core_id,
|
|
||||||
int *physical_core_id);
|
|
||||||
|
|
||||||
static SYSTEM_INFO sys_info;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Windows paffinity module
|
|
||||||
*/
|
|
||||||
static const opal_paffinity_base_module_1_1_0_t loc_module = {
|
|
||||||
/* Initialization function */
|
|
||||||
windows_module_init,
|
|
||||||
|
|
||||||
/* Module function pointers */
|
|
||||||
windows_module_set,
|
|
||||||
windows_module_get,
|
|
||||||
windows_module_map_to_processor_id,
|
|
||||||
windows_module_map_to_socket_core,
|
|
||||||
windows_module_get_processor_info,
|
|
||||||
windows_module_get_socket_info,
|
|
||||||
windows_module_get_core_info,
|
|
||||||
get_physical_processor_id,
|
|
||||||
get_physical_socket_id,
|
|
||||||
get_physical_core_id,
|
|
||||||
windows_module_finalize
|
|
||||||
};
|
|
||||||
|
|
||||||
int opal_paffinity_windows_component_query(mca_base_module_t **module, int *priority)
|
|
||||||
{
|
|
||||||
int param;
|
|
||||||
|
|
||||||
param = mca_base_param_find("paffinity", "windows", "priority");
|
|
||||||
mca_base_param_lookup_int(param, priority);
|
|
||||||
|
|
||||||
*module = (mca_base_module_t *)&loc_module;
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int windows_module_finalize(void)
|
|
||||||
{
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int windows_module_init(void)
|
|
||||||
{
|
|
||||||
GetSystemInfo( &sys_info );
|
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int windows_module_get_num_procs(int *num_procs)
|
|
||||||
{
|
|
||||||
*num_procs = sys_info.dwNumberOfProcessors;
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int windows_module_set(opal_paffinity_base_cpu_set_t cpumask)
|
|
||||||
{
|
|
||||||
HANDLE threadid = GetCurrentThread();
|
|
||||||
DWORD_PTR process_mask, system_mask;
|
|
||||||
|
|
||||||
if( !GetProcessAffinityMask( threadid, &process_mask, &system_mask ) ) {
|
|
||||||
return OPAL_ERR_NOT_FOUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( (int)(1 << cpumask.bitmask[0]) & (system_mask & 0xFFFFFFFF) ) {
|
|
||||||
process_mask = (int)(1 << cpumask.bitmask[0]);
|
|
||||||
if( SetThreadAffinityMask( threadid, process_mask ) )
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
/* otherwise something went wrong */
|
|
||||||
}
|
|
||||||
/* the specified processor is not enabled system wide */
|
|
||||||
return OPAL_ERR_NOT_FOUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int windows_module_get(opal_paffinity_base_cpu_set_t *cpumask)
|
|
||||||
{
|
|
||||||
HANDLE threadid = GetCurrentThread();
|
|
||||||
DWORD_PTR process_mask, system_mask;
|
|
||||||
|
|
||||||
if( GetProcessAffinityMask( threadid, &process_mask, &system_mask ) ) {
|
|
||||||
cpumask->bitmask[0] = (opal_paffinity_base_bitmask_t)process_mask;
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
cpumask->bitmask[0] = 1;
|
|
||||||
return OPAL_ERR_BAD_PARAM;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int windows_module_map_to_processor_id(int socket, int core, int *processor_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int windows_module_map_to_socket_core(int processor_id, int *socket, int *core)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int windows_module_get_processor_info(int *num_processors)
|
|
||||||
{
|
|
||||||
*num_processors = sys_info.dwNumberOfProcessors;
|
|
||||||
return OPAL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int windows_module_get_socket_info(int *num_sockets)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int windows_module_get_core_info(int socket, int *num_cores)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_processor_id(int logical_processor_id,
|
|
||||||
int *physical_processor_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_socket_id(int logical_socket_id,
|
|
||||||
int *physical_socket_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_physical_core_id(int physical_socket_id, int logical_core_id,
|
|
||||||
int *physical_core_id)
|
|
||||||
{
|
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче
Block a user