diff --git a/opal/include/opal/constants.h b/opal/include/opal/constants.h index f7fc7e27e5..32f054b639 100644 --- a/opal/include/opal/constants.h +++ b/opal/include/opal/constants.h @@ -9,7 +9,7 @@ * 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 (c) 2010-2012 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -69,7 +69,8 @@ enum { OPAL_ERR_MULTIPLE_AFFINITIES = (OPAL_ERR_BASE - 40), OPAL_ERR_SLOT_LIST_RANGE = (OPAL_ERR_BASE - 41), OPAL_ERR_NETWORK_NOT_PARSEABLE = (OPAL_ERR_BASE - 42), - OPAL_ERR_SILENT = (OPAL_ERR_BASE - 43) + OPAL_ERR_SILENT = (OPAL_ERR_BASE - 43), + OPAL_ERR_NOT_INITIALIZED = (OPAL_ERR_BASE - 44) }; #define OPAL_ERR_MAX (OPAL_ERR_BASE - 100) diff --git a/opal/mca/paffinity/hwloc/paffinity_hwloc_module.c b/opal/mca/paffinity/hwloc/paffinity_hwloc_module.c index 9c0744d4e4..e5c7930065 100644 --- a/opal/mca/paffinity/hwloc/paffinity_hwloc_module.c +++ b/opal/mca/paffinity/hwloc/paffinity_hwloc_module.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * * $COPYRIGHT$ * @@ -173,7 +173,7 @@ static int module_set(opal_paffinity_base_cpu_set_t mask) /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -202,7 +202,7 @@ static int module_get(opal_paffinity_base_cpu_set_t *mask) /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -248,7 +248,7 @@ static int module_map_to_processor_id(int socket, int core, int *processor_id) /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -305,7 +305,7 @@ static int module_map_to_socket_core(int processor_id, int *socket, int *core) /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -363,7 +363,7 @@ static int module_get_processor_info(int *num_processors) /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -396,7 +396,7 @@ static int module_get_socket_info(int *num_sockets) /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -430,7 +430,7 @@ static int module_get_core_info(int socket, int *num_cores) /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -469,7 +469,7 @@ static int module_get_physical_processor_id(int logical_processor_id, /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -521,7 +521,7 @@ static int module_get_physical_socket_id(int logical_socket_id, /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; @@ -547,7 +547,7 @@ static int module_get_physical_core_id(int physical_socket_id, /* bozo check */ if (NULL == opal_hwloc_topology) { - return OPAL_ERR_NOT_SUPPORTED; + return OPAL_ERR_NOT_INITIALIZED; } t = &opal_hwloc_topology; diff --git a/opal/mca/paffinity/paffinity.h b/opal/mca/paffinity/paffinity.h index 3109485e27..90780575bc 100644 --- a/opal/mca/paffinity/paffinity.h +++ b/opal/mca/paffinity/paffinity.h @@ -9,7 +9,7 @@ * 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) 2007-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved. * $COPYRIGHT$ @@ -67,6 +67,14 @@ * priority (for the unlikely event where there are multiple * components available on a given platform). * + * Note that the only real paffinity module that matters these days is + * hwloc. Its module functions will return OPAL_ERR_NOT_INITIALIZED + * if the underlying hwloc system has not yet been initialized (which + * may not have occured yet since we tend to only initialize hwloc + * if/when necessary -- it's not nice to have N processes on a server + * all initialize hwloc simultaneously, because they might all + * simultaneously bang on /proc and /syst, etc.). + * * The module has the following functions: * * - module_init: initialze the module diff --git a/opal/runtime/opal_init.c b/opal/runtime/opal_init.c index 98b2cf4d6f..af9e3e67a7 100644 --- a/opal/runtime/opal_init.c +++ b/opal/runtime/opal_init.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2010 Los Alamos National Security, LLC. @@ -208,6 +208,9 @@ opal_err2str(int errnum, const char **errmsg) case OPAL_ERR_SILENT: retval = NULL; break; + case OPAL_ERR_NOT_INITIALIZED: + retval = "Not initialized"; + break; default: retval = NULL; }