Modify the paffinity test module to take a param indicating whether or not to mimic being externally bound
This commit was SVN r21908.
Этот коммит содержится в:
родитель
fb777134cf
Коммит
3c4f28b22c
@ -36,6 +36,9 @@ OPAL_DECLSPEC extern const opal_paffinity_base_component_2_0_0_t mca_paffinity_t
|
|||||||
/* query function */
|
/* query function */
|
||||||
int opal_paffinity_test_component_query(mca_base_module_t **module, int *priority);
|
int opal_paffinity_test_component_query(mca_base_module_t **module, int *priority);
|
||||||
|
|
||||||
|
/* local value */
|
||||||
|
OPAL_DECLSPEC extern bool opal_paffinity_test_bound;
|
||||||
|
|
||||||
END_C_DECLS
|
END_C_DECLS
|
||||||
|
|
||||||
#endif /* MCA_PAFFINITY_TEST_EXPORT_H */
|
#endif /* MCA_PAFFINITY_TEST_EXPORT_H */
|
||||||
|
@ -45,6 +45,8 @@ static int test_open(void);
|
|||||||
* and pointers to our public functions in it
|
* and pointers to our public functions in it
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
bool opal_paffinity_test_bound;
|
||||||
|
|
||||||
const opal_paffinity_base_component_2_0_0_t mca_paffinity_test_component = {
|
const opal_paffinity_base_component_2_0_0_t mca_paffinity_test_component = {
|
||||||
|
|
||||||
/* First, the mca_component_t struct containing meta information
|
/* First, the mca_component_t struct containing meta information
|
||||||
@ -79,5 +81,12 @@ const opal_paffinity_base_component_2_0_0_t mca_paffinity_test_component = {
|
|||||||
|
|
||||||
static int test_open(void)
|
static int test_open(void)
|
||||||
{
|
{
|
||||||
|
int tmp;
|
||||||
|
|
||||||
|
mca_base_param_reg_int(&mca_paffinity_test_component.base_version, "bound",
|
||||||
|
"Whether or not to test as if externally bound (default=0: no)",
|
||||||
|
false, false, (int)false, &tmp);
|
||||||
|
opal_paffinity_test_bound = OPAL_INT_TO_BOOL(tmp);
|
||||||
|
|
||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,7 @@ static int get(opal_paffinity_base_cpu_set_t *cpumask)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
OPAL_PAFFINITY_CPU_ZERO(*cpumask);
|
OPAL_PAFFINITY_CPU_ZERO(*cpumask);
|
||||||
|
if (opal_paffinity_test_bound) {
|
||||||
for (i=0; i < NUM_SOCKETS*NUM_CORES; i+=2) {
|
for (i=0; i < NUM_SOCKETS*NUM_CORES; i+=2) {
|
||||||
OPAL_PAFFINITY_CPU_SET(i, *cpumask);
|
OPAL_PAFFINITY_CPU_SET(i, *cpumask);
|
||||||
}
|
}
|
||||||
@ -105,6 +106,11 @@ static int get(opal_paffinity_base_cpu_set_t *cpumask)
|
|||||||
for (i=NUM_CORES; i < 2*NUM_CORES; i++) {
|
for (i=NUM_CORES; i < 2*NUM_CORES; i++) {
|
||||||
OPAL_PAFFINITY_CPU_SET(i, *cpumask);
|
OPAL_PAFFINITY_CPU_SET(i, *cpumask);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (i=0; i < NUM_SOCKETS*NUM_CORES; i++) {
|
||||||
|
OPAL_PAFFINITY_CPU_SET(i, *cpumask);
|
||||||
|
}
|
||||||
|
}
|
||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user