This commit fixes 2370, by having the solaris paffinity module return error codes for get_physical_processor_id and having odls_default_fork_local_proc check get_physical_processor_id for OPAL_ERROR
This commit was SVN r22948.
Этот коммит содержится в:
родитель
101b896f2e
Коммит
282a537cf7
@ -10,7 +10,7 @@
|
|||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved.
|
||||||
*
|
*
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -197,13 +197,17 @@ static int solaris_module_get_core_info(int socket, int *num_cores)
|
|||||||
|
|
||||||
static int solaris_module_get_physical_processor_id(int logical_processor_id)
|
static int solaris_module_get_physical_processor_id(int logical_processor_id)
|
||||||
{
|
{
|
||||||
processorid_t currid, cpuid_max, cpuid_log=0;
|
processorid_t currid, retid, cpuid_max, cpuid_log=0;
|
||||||
processor_info_t pinfo;
|
processor_info_t pinfo;
|
||||||
|
|
||||||
/* cpuid_max is the max number available for a system arch. It is
|
/* 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 */
|
* an inclusive list. e.g. If cpuid_max=31, cpuid would be 0-31 */
|
||||||
cpuid_max = sysconf(_SC_CPUID_MAX);
|
if ( 0 > (cpuid_max = sysconf(_SC_CPUID_MAX))) {
|
||||||
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* set retid to OPAL_ERROR to reflect no processor found to match logical proc */
|
||||||
|
retid = OPAL_ERROR;
|
||||||
/* Because not all CPU ID in cpuid_max are actually valid,
|
/* Because not all CPU ID in cpuid_max are actually valid,
|
||||||
* and CPU ID may also not be contiguous. Therefore we
|
* and CPU ID may also not be contiguous. Therefore we
|
||||||
* need to run through processor_info to ensure the validity.
|
* need to run through processor_info to ensure the validity.
|
||||||
@ -212,13 +216,15 @@ static int solaris_module_get_physical_processor_id(int logical_processor_id)
|
|||||||
if (0 == processor_info(currid, &pinfo)) {
|
if (0 == processor_info(currid, &pinfo)) {
|
||||||
if (P_ONLINE == pinfo.pi_state || P_NOINTR == pinfo.pi_state) {
|
if (P_ONLINE == pinfo.pi_state || P_NOINTR == pinfo.pi_state) {
|
||||||
if (cpuid_log == logical_processor_id) {
|
if (cpuid_log == logical_processor_id) {
|
||||||
|
retid = currid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cpuid_log++;
|
cpuid_log++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return currid;
|
|
||||||
|
return retid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int solaris_module_get_physical_socket_id(int logical_socket_id)
|
static int solaris_module_get_physical_socket_id(int logical_socket_id)
|
||||||
|
@ -527,22 +527,20 @@ static int odls_default_fork_local_proc(orte_app_context_t* context,
|
|||||||
* to us, so index into the node's array to get the
|
* to us, so index into the node's array to get the
|
||||||
* physical cpu
|
* physical cpu
|
||||||
*/
|
*/
|
||||||
if (logical_cpu < orte_odls_globals.num_processors) {
|
phys_cpu = opal_paffinity_base_get_physical_processor_id(logical_cpu);
|
||||||
/* We have a processor to bind to */
|
if (OPAL_ERROR == phys_cpu){
|
||||||
phys_cpu = opal_paffinity_base_get_physical_processor_id(logical_cpu);
|
|
||||||
if (0 > phys_cpu) {
|
|
||||||
ORTE_ODLS_IF_BIND_NOT_REQD("bind-to-core");
|
|
||||||
orte_show_help("help-odls-default.txt",
|
|
||||||
"odls-default:invalid-phys-cpu", true);
|
|
||||||
ORTE_ODLS_ERROR_OUT(ORTE_ERR_FATAL);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* No processor to bind to so error out */
|
/* No processor to bind to so error out */
|
||||||
|
ORTE_ODLS_IF_BIND_NOT_REQD("bind-to-core");
|
||||||
orte_show_help("help-odls-default.txt",
|
orte_show_help("help-odls-default.txt",
|
||||||
"odls-default:not-enough-resources", true,
|
"odls-default:not-enough-resources", true,
|
||||||
"processors", orte_process_info.nodename,
|
"processors", orte_process_info.nodename,
|
||||||
"bind-to-core", context->app);
|
"bind-to-core", context->app);
|
||||||
ORTE_ODLS_ERROR_OUT(ORTE_ERR_FATAL);
|
ORTE_ODLS_ERROR_OUT(ORTE_ERR_FATAL);
|
||||||
|
} else if (0 > phys_cpu) {
|
||||||
|
ORTE_ODLS_IF_BIND_NOT_REQD("bind-to-core");
|
||||||
|
orte_show_help("help-odls-default.txt",
|
||||||
|
"odls-default:invalid-phys-cpu", true);
|
||||||
|
ORTE_ODLS_ERROR_OUT(ORTE_ERR_FATAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OPAL_PAFFINITY_CPU_SET(phys_cpu, mask);
|
OPAL_PAFFINITY_CPU_SET(phys_cpu, mask);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user