1
1

Modify the paffinity test module to take a param indicating whether or not to mimic being externally bound

This commit was SVN r21908.
Этот коммит содержится в:
Ralph Castain 2009-08-28 02:31:01 +00:00
родитель fb777134cf
Коммит 3c4f28b22c
3 изменённых файлов: 24 добавлений и 6 удалений

Просмотреть файл

@ -36,6 +36,9 @@ OPAL_DECLSPEC extern const opal_paffinity_base_component_2_0_0_t mca_paffinity_t
/* query function */
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
#endif /* MCA_PAFFINITY_TEST_EXPORT_H */

Просмотреть файл

@ -45,6 +45,8 @@ static int test_open(void);
* 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 = {
/* 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)
{
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;
}

Просмотреть файл

@ -98,12 +98,18 @@ static int get(opal_paffinity_base_cpu_set_t *cpumask)
int i;
OPAL_PAFFINITY_CPU_ZERO(*cpumask);
for (i=0; i < NUM_SOCKETS*NUM_CORES; i+=2) {
OPAL_PAFFINITY_CPU_SET(i, *cpumask);
}
/* assign all cores in the 2nd socket */
for (i=NUM_CORES; i < 2*NUM_CORES; i++) {
OPAL_PAFFINITY_CPU_SET(i, *cpumask);
if (opal_paffinity_test_bound) {
for (i=0; i < NUM_SOCKETS*NUM_CORES; i+=2) {
OPAL_PAFFINITY_CPU_SET(i, *cpumask);
}
/* assign all cores in the 2nd socket */
for (i=NUM_CORES; i < 2*NUM_CORES; i++) {
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;
}