Rename the osx paffinity component the "posix" component since it really has nothing osx specific in it - it is just a generic posix call to determine #processors. Set the priority low so that both linux and solaris components override it if they build. It shouldn't build in Windows at all.
Modify the odls to remove a (size_t) typecast in front of the num_processors variable just in case it is returned negative. This usually is accompanied by an opal_error, so this shouldn't make any difference - but it is more technically correct. This commit was SVN r19008.
Этот коммит содержится в:
родитель
d880d6282a
Коммит
fdb2408bf2
@ -1 +0,0 @@
|
||||
rhc
|
@ -17,27 +17,27 @@
|
||||
#
|
||||
|
||||
sources = \
|
||||
paffinity_osx.h \
|
||||
paffinity_osx_component.c \
|
||||
paffinity_osx_module.c
|
||||
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_osx_DSO
|
||||
if OMPI_BUILD_paffinity_posix_DSO
|
||||
component_noinst =
|
||||
component_install = mca_paffinity_osx.la
|
||||
component_install = mca_paffinity_posix.la
|
||||
else
|
||||
component_noinst = libmca_paffinity_osx.la
|
||||
component_noinst = libmca_paffinity_posix.la
|
||||
component_install =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(pkglibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_paffinity_osx_la_SOURCES = $(sources)
|
||||
mca_paffinity_osx_la_LDFLAGS = -module -avoid-version
|
||||
mca_paffinity_posix_la_SOURCES = $(sources)
|
||||
mca_paffinity_posix_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_paffinity_osx_la_SOURCES =$(sources)
|
||||
libmca_paffinity_osx_la_LDFLAGS = -module -avoid-version
|
||||
libmca_paffinity_posix_la_SOURCES =$(sources)
|
||||
libmca_paffinity_posix_la_LDFLAGS = -module -avoid-version
|
@ -19,9 +19,9 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# MCA_paffinity_osx_CONFIG([action-if-found], [action-if-not-found])
|
||||
# MCA_paffinity_posix_CONFIG([action-if-found], [action-if-not-found])
|
||||
# -----------------------------------------------------------
|
||||
AC_DEFUN([MCA_paffinity_osx_CONFIG],[
|
||||
AC_DEFUN([MCA_paffinity_posix_CONFIG],[
|
||||
#check to see if we have <unistd.h>
|
||||
AC_CHECK_HEADER([unistd.h], [happy=yes], [happy=no])
|
||||
|
@ -17,8 +17,8 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef MCA_PAFFINITY_OSX_EXPORT_H
|
||||
#define MCA_PAFFINITY_OSX_EXPORT_H
|
||||
#ifndef MCA_PAFFINITY_POSIX_EXPORT_H
|
||||
#define MCA_PAFFINITY_POSIX_EXPORT_H
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
@ -31,11 +31,11 @@ BEGIN_C_DECLS
|
||||
* Globally exported variable
|
||||
*/
|
||||
|
||||
OPAL_DECLSPEC extern const opal_paffinity_base_component_1_1_0_t mca_paffinity_osx_component;
|
||||
OPAL_DECLSPEC extern const opal_paffinity_base_component_1_1_0_t mca_paffinity_posix_component;
|
||||
|
||||
/* query function */
|
||||
int opal_paffinity_osx_component_query(mca_base_module_t **module, int *priority);
|
||||
int opal_paffinity_posix_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* MCA_PAFFINITY_OSX_EXPORT_H */
|
||||
#endif /* MCA_PAFFINITY_POSIX_EXPORT_H */
|
@ -27,25 +27,25 @@
|
||||
|
||||
#include "opal/constants.h"
|
||||
#include "opal/mca/paffinity/paffinity.h"
|
||||
#include "paffinity_osx.h"
|
||||
#include "paffinity_posix.h"
|
||||
|
||||
/*
|
||||
* Public string showing the paffinity ompi_osx component version number
|
||||
* Public string showing the paffinity ompi_posix component version number
|
||||
*/
|
||||
const char *opal_paffinity_osx_component_version_string =
|
||||
"OPAL osx paffinity MCA component version " OPAL_VERSION;
|
||||
const char *opal_paffinity_posix_component_version_string =
|
||||
"OPAL posix paffinity MCA component version " OPAL_VERSION;
|
||||
|
||||
/*
|
||||
* Local function
|
||||
*/
|
||||
static int osx_open(void);
|
||||
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_1_1_0_t mca_paffinity_osx_component = {
|
||||
const opal_paffinity_base_component_1_1_0_t mca_paffinity_posix_component = {
|
||||
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
about the component itself */
|
||||
@ -58,16 +58,16 @@ const opal_paffinity_base_component_1_1_0_t mca_paffinity_osx_component = {
|
||||
|
||||
/* Component name and version */
|
||||
|
||||
"osx",
|
||||
"posix",
|
||||
OPAL_MAJOR_VERSION,
|
||||
OPAL_MINOR_VERSION,
|
||||
OPAL_RELEASE_VERSION,
|
||||
|
||||
/* Component open and close functions */
|
||||
|
||||
osx_open,
|
||||
posix_open,
|
||||
NULL,
|
||||
opal_paffinity_osx_component_query
|
||||
opal_paffinity_posix_component_query
|
||||
},
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
@ -77,7 +77,7 @@ const opal_paffinity_base_component_1_1_0_t mca_paffinity_osx_component = {
|
||||
};
|
||||
|
||||
|
||||
static int osx_open(void)
|
||||
static int posix_open(void)
|
||||
{
|
||||
return OPAL_SUCCESS;
|
||||
}
|
@ -33,41 +33,44 @@
|
||||
#include "opal/mca/paffinity/base/base.h"
|
||||
#include "opal/util/output.h"
|
||||
|
||||
#include "paffinity_osx.h"
|
||||
#include "paffinity_posix.h"
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
static int osx_module_init(void);
|
||||
static int osx_module_set(opal_paffinity_base_cpu_set_t cpumask);
|
||||
static int osx_module_get(opal_paffinity_base_cpu_set_t *cpumask);
|
||||
static int osx_module_finalize(void);
|
||||
static int osx_module_map_to_processor_id(int socket, int core, int *processor_id);
|
||||
static int osx_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
||||
static int osx_module_get_processor_info(int *num_processors, int *max_processor_id);
|
||||
static int osx_module_get_socket_info(int *num_sockets, int *max_socket_num);
|
||||
static int osx_module_get_core_info(int socket, int *num_cores, int *max_core_num);
|
||||
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, int *max_processor_id);
|
||||
static int posix_module_get_socket_info(int *num_sockets, int *max_socket_num);
|
||||
static int posix_module_get_core_info(int socket, int *num_cores, int *max_core_num);
|
||||
|
||||
/*
|
||||
* Solaris paffinity module
|
||||
*/
|
||||
static const opal_paffinity_base_module_1_1_0_t loc_module = {
|
||||
/* Initialization function */
|
||||
osx_module_init,
|
||||
posix_module_init,
|
||||
|
||||
/* Module function pointers */
|
||||
osx_module_set,
|
||||
osx_module_get,
|
||||
osx_module_map_to_processor_id,
|
||||
osx_module_map_to_socket_core,
|
||||
osx_module_get_processor_info,
|
||||
osx_module_get_socket_info,
|
||||
osx_module_get_core_info,
|
||||
osx_module_finalize
|
||||
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,
|
||||
posix_module_finalize
|
||||
};
|
||||
|
||||
int opal_paffinity_osx_component_query(mca_base_module_t **module, int *priority)
|
||||
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;
|
||||
|
||||
@ -75,36 +78,36 @@ int opal_paffinity_osx_component_query(mca_base_module_t **module, int *priority
|
||||
}
|
||||
|
||||
/* do nothing here. both mpirun and processes would run init(), but
|
||||
* only processes would run the osx_module_set function */
|
||||
static int osx_module_init(void)
|
||||
* 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 osx_module_set(opal_paffinity_base_cpu_set_t cpumask)
|
||||
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 osx_module_get(opal_paffinity_base_cpu_set_t *cpumask)
|
||||
static int posix_module_get(opal_paffinity_base_cpu_set_t *cpumask)
|
||||
{
|
||||
return OPAL_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static int osx_module_map_to_processor_id(int socket, int core, int *processor_id)
|
||||
static int posix_module_map_to_processor_id(int socket, int core, int *processor_id)
|
||||
{
|
||||
return OPAL_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static int osx_module_map_to_socket_core(int processor_id, int *socket, int *core)
|
||||
static int posix_module_map_to_socket_core(int processor_id, int *socket, int *core)
|
||||
{
|
||||
return OPAL_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static int osx_module_get_processor_info(int *num_processors, int *max_processor_id)
|
||||
static int posix_module_get_processor_info(int *num_processors, int *max_processor_id)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -124,18 +127,18 @@ static int osx_module_get_processor_info(int *num_processors, int *max_processor
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int osx_module_get_socket_info(int *num_sockets, int *max_socket_num)
|
||||
static int posix_module_get_socket_info(int *num_sockets, int *max_socket_num)
|
||||
{
|
||||
return OPAL_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static int osx_module_get_core_info(int socket, int *num_cores, int *max_core_num)
|
||||
static int posix_module_get_core_info(int socket, int *num_cores, int *max_core_num)
|
||||
{
|
||||
return OPAL_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
static int osx_module_finalize(void)
|
||||
static int posix_module_finalize(void)
|
||||
{
|
||||
return OPAL_SUCCESS;
|
||||
}
|
@ -811,7 +811,11 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
|
||||
*/
|
||||
oversubscribed = true;
|
||||
} else {
|
||||
if (opal_list_get_size(&orte_odls_globals.children) > (size_t)num_processors) {
|
||||
/* don't typecast the num_processors to a size_t as the value could be < 0!
|
||||
* Instead, force the opal_list_get_size value to be an int as we surely
|
||||
* won't have a #children bigger than that!
|
||||
*/
|
||||
if ((int)opal_list_get_size(&orte_odls_globals.children) > num_processors) {
|
||||
/* if the #procs > #processors, declare us oversubscribed. This
|
||||
* covers the case where the user didn't tell us anything about the
|
||||
* number of available slots, so we defaulted to a value of 1
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user