Fix a few bugs in the hwloc integration code. The "set binding policy" macro should flag that the policy was indeed set. Some systems don't report sockets, so the print functions need to check for that condition.
cmr:v1.7 This commit was SVN r28209.
Этот коммит содержится в:
родитель
ab2ae0835a
Коммит
8a79d37ac2
@ -157,10 +157,8 @@ int opal_hwloc_base_open(void)
|
||||
/* mark that no binding policy was specified */
|
||||
opal_hwloc_binding_policy &= ~OPAL_BIND_GIVEN;
|
||||
} else if (0 == strncasecmp(str_value, "none", strlen("none"))) {
|
||||
opal_hwloc_binding_policy = OPAL_BIND_TO_NONE;
|
||||
opal_hwloc_binding_policy |= OPAL_BIND_GIVEN;
|
||||
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_NONE);
|
||||
} else {
|
||||
opal_hwloc_binding_policy |= OPAL_BIND_GIVEN;
|
||||
tmpvals = opal_argv_split(str_value, ':');
|
||||
if (1 < opal_argv_count(tmpvals)) {
|
||||
quals = opal_argv_split(tmpvals[1], ',');
|
||||
@ -217,7 +215,6 @@ int opal_hwloc_base_open(void)
|
||||
return OPAL_ERR_BAD_PARAM;
|
||||
}
|
||||
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CORE);
|
||||
opal_hwloc_binding_policy |= OPAL_BIND_GIVEN;
|
||||
}
|
||||
|
||||
mca_base_param_reg_int_name("hwloc", "base_bind_to_socket",
|
||||
@ -233,7 +230,6 @@ int opal_hwloc_base_open(void)
|
||||
return OPAL_ERR_SILENT;
|
||||
}
|
||||
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_SOCKET);
|
||||
opal_hwloc_binding_policy |= OPAL_BIND_GIVEN;
|
||||
}
|
||||
|
||||
mca_base_param_reg_int_name("hwloc", "base_report_bindings",
|
||||
@ -253,7 +249,6 @@ int opal_hwloc_base_open(void)
|
||||
return OPAL_ERR_SILENT;
|
||||
}
|
||||
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CPUSET);
|
||||
opal_hwloc_binding_policy |= OPAL_BIND_GIVEN;
|
||||
}
|
||||
|
||||
/* cpu allocation specification */
|
||||
@ -267,7 +262,6 @@ int opal_hwloc_base_open(void)
|
||||
* ignored if someone didn't also specify a binding policy
|
||||
*/
|
||||
OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CPUSET);
|
||||
opal_hwloc_binding_policy |= OPAL_BIND_GIVEN;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1697,7 +1697,12 @@ static int build_map(int *num_sockets_arg, int *num_cores_arg,
|
||||
to look this up every time) */
|
||||
if (num_sockets < 0) {
|
||||
num_sockets = hwloc_get_nbobjs_by_type(opal_hwloc_topology, HWLOC_OBJ_SOCKET);
|
||||
|
||||
/* some systems (like the iMac) only have one
|
||||
* socket and so don't report a socket
|
||||
*/
|
||||
if (0 == num_sockets) {
|
||||
num_sockets = 1;
|
||||
}
|
||||
/* Lazy: take the total number of cores that we have in the
|
||||
topology; that'll be more than the max number of cores
|
||||
under any given socket */
|
||||
|
@ -204,7 +204,7 @@ typedef uint16_t opal_binding_policy_t;
|
||||
#define OPAL_GET_BINDING_POLICY(pol) \
|
||||
((pol) & 0x0fff)
|
||||
#define OPAL_SET_BINDING_POLICY(target, pol) \
|
||||
(target) = (pol) | ((target) & 0xf000)
|
||||
(target) = (pol) | (((target) & 0xf000) | OPAL_BIND_GIVEN)
|
||||
/* check if policy is set */
|
||||
#define OPAL_BINDING_POLICY_IS_SET(pol) \
|
||||
((pol) & 0x4000)
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user