1
1
1. If we don't have the topology information, don't bother trying to
    create cross-referencing information
 1. Ensure to only check for valid processor ID's

This commit was SVN r18462.
Этот коммит содержится в:
Jeff Squyres 2008-05-20 12:57:12 +00:00
родитель ef7ac86929
Коммит d45cb82ecc

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

@ -251,6 +251,13 @@ static void load_cache(const char *sysfs_mount)
}
}
/* If we didn't find any core_id/physical_package_id's, then we
don't have the topology info */
if (!found) {
clear_cache();
return;
}
/* Now that we know the max number of sockets, allocate some
arrays */
max_core_id = malloc(sizeof(int) * (max_socket_id + 1));
@ -270,6 +277,13 @@ static void load_cache(const char *sysfs_mount)
/* Find the max core number on each socket */
for (i = 0; i <= max_processor_num; ++i) {
/* If we don't have the core/socket for a given processor ID,
then skip it */
if (map_processor_id_to_tuple[i].core < 0 ||
map_processor_id_to_tuple[i].socket < 0) {
continue;
}
if (map_processor_id_to_tuple[i].core >
max_core_id[map_processor_id_to_tuple[i].socket]) {
max_core_id[map_processor_id_to_tuple[i].socket] =
@ -282,13 +296,6 @@ static void load_cache(const char *sysfs_mount)
}
}
/* If we didn't find any core_id/physical_package_id's, then we
don't have the topology info */
if (!found) {
clear_cache();
return;
}
/* Go through and count the number of unique sockets found. It
may not be the same as max_socket_id because there may be
"holes" -- e.g., sockets 0 and 3 are used, but sockets 1 and 2