diff --git a/opal/mca/paffinity/darwin/Makefile.am b/opal/mca/paffinity/darwin/Makefile.am deleted file mode 100644 index fca762d00e..0000000000 --- a/opal/mca/paffinity/darwin/Makefile.am +++ /dev/null @@ -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__.la (for DSO builds) or libmca__.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 diff --git a/opal/mca/paffinity/darwin/configure.m4 b/opal/mca/paffinity/darwin/configure.m4 deleted file mode 100644 index 238e94d5f9..0000000000 --- a/opal/mca/paffinity/darwin/configure.m4 +++ /dev/null @@ -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 - # 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 - diff --git a/opal/mca/paffinity/darwin/configure.params b/opal/mca/paffinity/darwin/configure.params deleted file mode 100644 index 2ca216f1b2..0000000000 --- a/opal/mca/paffinity/darwin/configure.params +++ /dev/null @@ -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" diff --git a/opal/mca/paffinity/darwin/paffinity_darwin.h b/opal/mca/paffinity/darwin/paffinity_darwin.h deleted file mode 100644 index 5f610119c2..0000000000 --- a/opal/mca/paffinity/darwin/paffinity_darwin.h +++ /dev/null @@ -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 */ diff --git a/opal/mca/paffinity/darwin/paffinity_darwin_component.c b/opal/mca/paffinity/darwin/paffinity_darwin_component.c deleted file mode 100644 index 6226f1ce52..0000000000 --- a/opal/mca/paffinity/darwin/paffinity_darwin_component.c +++ /dev/null @@ -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; -} diff --git a/opal/mca/paffinity/darwin/paffinity_darwin_module.c b/opal/mca/paffinity/darwin/paffinity_darwin_module.c deleted file mode 100644 index 66a6cc8ad4..0000000000 --- a/opal/mca/paffinity/darwin/paffinity_darwin_module.c +++ /dev/null @@ -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 -#include -#include - -#include -#include -#include - -#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; -} - diff --git a/opal/mca/paffinity/posix/Makefile.am b/opal/mca/paffinity/posix/Makefile.am deleted file mode 100644 index 87f9c8b7d0..0000000000 --- a/opal/mca/paffinity/posix/Makefile.am +++ /dev/null @@ -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__.la (for DSO builds) or libmca__.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 diff --git a/opal/mca/paffinity/posix/configure.m4 b/opal/mca/paffinity/posix/configure.m4 deleted file mode 100644 index f196570365..0000000000 --- a/opal/mca/paffinity/posix/configure.m4 +++ /dev/null @@ -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 - 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 - diff --git a/opal/mca/paffinity/posix/configure.params b/opal/mca/paffinity/posix/configure.params deleted file mode 100644 index 2ca216f1b2..0000000000 --- a/opal/mca/paffinity/posix/configure.params +++ /dev/null @@ -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" diff --git a/opal/mca/paffinity/posix/paffinity_posix.h b/opal/mca/paffinity/posix/paffinity_posix.h deleted file mode 100644 index 32c9c36ad4..0000000000 --- a/opal/mca/paffinity/posix/paffinity_posix.h +++ /dev/null @@ -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 */ diff --git a/opal/mca/paffinity/posix/paffinity_posix_component.c b/opal/mca/paffinity/posix/paffinity_posix_component.c deleted file mode 100644 index a342d31f46..0000000000 --- a/opal/mca/paffinity/posix/paffinity_posix_component.c +++ /dev/null @@ -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; -} diff --git a/opal/mca/paffinity/posix/paffinity_posix_module.c b/opal/mca/paffinity/posix/paffinity_posix_module.c deleted file mode 100644 index b34c246781..0000000000 --- a/opal/mca/paffinity/posix/paffinity_posix_module.c +++ /dev/null @@ -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 -#include -#include - -#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; -} - diff --git a/opal/mca/paffinity/solaris/Makefile.am b/opal/mca/paffinity/solaris/Makefile.am deleted file mode 100644 index a632e7bfc1..0000000000 --- a/opal/mca/paffinity/solaris/Makefile.am +++ /dev/null @@ -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__.la (for DSO builds) or libmca__.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 diff --git a/opal/mca/paffinity/solaris/configure.m4 b/opal/mca/paffinity/solaris/configure.m4 deleted file mode 100644 index cfd29df574..0000000000 --- a/opal/mca/paffinity/solaris/configure.m4 +++ /dev/null @@ -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 - 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 ]], [[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 - diff --git a/opal/mca/paffinity/solaris/configure.params b/opal/mca/paffinity/solaris/configure.params deleted file mode 100644 index 2ca216f1b2..0000000000 --- a/opal/mca/paffinity/solaris/configure.params +++ /dev/null @@ -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" diff --git a/opal/mca/paffinity/solaris/paffinity_solaris.h b/opal/mca/paffinity/solaris/paffinity_solaris.h deleted file mode 100644 index 831f603d45..0000000000 --- a/opal/mca/paffinity/solaris/paffinity_solaris.h +++ /dev/null @@ -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 */ diff --git a/opal/mca/paffinity/solaris/paffinity_solaris_component.c b/opal/mca/paffinity/solaris/paffinity_solaris_component.c deleted file mode 100644 index 8d746d5dfb..0000000000 --- a/opal/mca/paffinity/solaris/paffinity_solaris_component.c +++ /dev/null @@ -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; -} diff --git a/opal/mca/paffinity/solaris/paffinity_solaris_module.c b/opal/mca/paffinity/solaris/paffinity_solaris_module.c deleted file mode 100644 index 93ba033f0a..0000000000 --- a/opal/mca/paffinity/solaris/paffinity_solaris_module.c +++ /dev/null @@ -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 -#include -#include -#include -#include - -#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 (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; -} - diff --git a/opal/mca/paffinity/windows/.windows b/opal/mca/paffinity/windows/.windows deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/opal/mca/paffinity/windows/Makefile.am b/opal/mca/paffinity/windows/Makefile.am deleted file mode 100644 index 7650fa78f7..0000000000 --- a/opal/mca/paffinity/windows/Makefile.am +++ /dev/null @@ -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__.la (for DSO builds) or libmca__.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 diff --git a/opal/mca/paffinity/windows/configure.m4 b/opal/mca/paffinity/windows/configure.m4 deleted file mode 100644 index 9abaa16bb5..0000000000 --- a/opal/mca/paffinity/windows/configure.m4 +++ /dev/null @@ -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 -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 -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 diff --git a/opal/mca/paffinity/windows/configure.params b/opal/mca/paffinity/windows/configure.params deleted file mode 100644 index 2ca216f1b2..0000000000 --- a/opal/mca/paffinity/windows/configure.params +++ /dev/null @@ -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" diff --git a/opal/mca/paffinity/windows/paffinity_windows.h b/opal/mca/paffinity/windows/paffinity_windows.h deleted file mode 100644 index 46538e6a55..0000000000 --- a/opal/mca/paffinity/windows/paffinity_windows.h +++ /dev/null @@ -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 -#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 */ diff --git a/opal/mca/paffinity/windows/paffinity_windows_component.c b/opal/mca/paffinity/windows/paffinity_windows_component.c deleted file mode 100644 index 33b2d184b3..0000000000 --- a/opal/mca/paffinity/windows/paffinity_windows_component.c +++ /dev/null @@ -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; -} diff --git a/opal/mca/paffinity/windows/paffinity_windows_module.c b/opal/mca/paffinity/windows/paffinity_windows_module.c deleted file mode 100644 index 69756926d6..0000000000 --- a/opal/mca/paffinity/windows/paffinity_windows_module.c +++ /dev/null @@ -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; -} -