1
1

Add some post-v1.5.1 release hwloc bug fixes

This commit was SVN r27805.
Этот коммит содержится в:
Jeff Squyres 2013-01-14 16:25:21 +00:00
родитель df0616ecfb
Коммит c17ec83de3
6 изменённых файлов: 49 добавлений и 18 удалений

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

@ -1,4 +1,10 @@
Applied the following patches from the upstream hwloc 1.5 branch after
the v1.5.1 release:
(none so far)
https://svn.open-mpi.org/trac/hwloc/changeset/5054
https://svn.open-mpi.org/trac/hwloc/changeset/4999
https://svn.open-mpi.org/trac/hwloc/changeset/4973
https://svn.open-mpi.org/trac/hwloc/changeset/4915
https://svn.open-mpi.org/trac/hwloc/changeset/4912

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

@ -17,6 +17,15 @@ bug fixes (and other actions) for each version of hwloc since version
in v0.9.1).
Version 1.5.2
-------------
* Fix some DIR descriptor leaks on Linux.
* Fix I/O device lists when some were filtered out after a XML import.
* Add missing Backend string info on Solaris in most cases.
* Fix the removal of I/O objects when importing a I/O-enabled XML topology
without any I/O topology flag.
Version 1.5.1
-------------
* Fix block OS device detection on Linux kernel 3.3 and later.

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

@ -51,28 +51,25 @@ static __hwloc_inline int hwloc_have_cpuid(void) { return 1; }
static __hwloc_inline void hwloc_cpuid(unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx)
{
/* Note: gcc might want to use bx or the stack for %1 addressing, so we can't
* use them :/ */
#ifdef HWLOC_X86_64_ARCH
unsigned long sav_ebx;
unsigned long sav_rbx;
asm(
/* Note: can't easily use stack since the compiler assumes we don't touch the redzone */
"mov %%rbx,%2\n\t"
"cpuid\n\t"
"xchg %2,%%rbx\n\t"
"movl %k2,%1\n\t"
: "+a" (*eax), "=m" (*ebx), "=&r"(sav_ebx),
: "+a" (*eax), "=m" (*ebx), "=&r"(sav_rbx),
"+c" (*ecx), "=&d" (*edx));
#elif defined(HWLOC_X86_32_ARCH)
unsigned long sav_ebx;
asm(
/* Note: gcc might want to use ebx for %1 addressing :/ */
"push %%ebx\n\t"
"mov %%ebx,%2\n\t"
"cpuid\n\t"
"push %%eax\n\t"
"mov %%ebx,%%eax\n\t"
"mov 4(%%esp),%%ebx\n\t"
"mov %%eax,%1\n\t"
"pop %%eax\n\t"
"add $4,%%esp\n\t"
: "+a" (*eax), "=m" (*ebx),
"xchg %2,%%ebx\n\t"
"movl %k2,%1\n\t"
: "+a" (*eax), "=m" (*ebx), "=&r"(sav_ebx),
"+c" (*ecx), "=&d" (*edx));
#else
#error unknown architecture

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

@ -3642,6 +3642,7 @@ hwloc_linux_lookup_block_class(struct hwloc_topology *topology, struct hwloc_obj
path[pathlen] = '\0';
}
}
closedir(hostdir);
/* restore parent path */
pathlen -= 1+strlen(devicedirent->d_name);
path[pathlen] = '\0';
@ -3675,6 +3676,7 @@ hwloc_linux_lookup_block_class(struct hwloc_topology *topology, struct hwloc_obj
path[pathlen] = '\0';
}
}
closedir(hostdir);
/* restore parent path */
pathlen -= 1+strlen(devicedirent->d_name);
path[pathlen] = '\0';

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

@ -712,15 +712,18 @@ void
hwloc_look_solaris(struct hwloc_topology *topology)
{
unsigned nbprocs = hwloc_fallback_nbprocessors (topology);
int alreadypus = 0;
#ifdef HAVE_LIBLGRP
hwloc_look_lgrp(topology);
#endif /* HAVE_LIBLGRP */
#ifdef HAVE_LIBKSTAT
nbprocs = 0;
if (hwloc_look_kstat(topology))
return;
alreadypus = 1;
#endif /* HAVE_LIBKSTAT */
hwloc_setup_pu_level(topology, nbprocs);
if (!alreadypus)
hwloc_setup_pu_level(topology, nbprocs);
hwloc_obj_add_info(topology->levels[0][0], "Backend", "Solaris");
}

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

@ -965,6 +965,10 @@ append_iodevs(hwloc_topology_t topology, hwloc_obj_t obj)
{
hwloc_obj_t child, *temp;
/* make sure we don't have remaining stale pointers from a previous load */
obj->next_cousin = NULL;
obj->prev_cousin = NULL;
if (obj->type == HWLOC_OBJ_BRIDGE) {
obj->depth = HWLOC_TYPE_DEPTH_BRIDGE;
/* Insert in the main bridge list */
@ -1532,6 +1536,18 @@ merge_useless_child(hwloc_topology_t topology, hwloc_obj_t *pparent)
}
}
static void
hwloc_drop_all_io(hwloc_topology_t topology, hwloc_obj_t root)
{
hwloc_obj_t child, *pchild;
for_each_child_safe(child, root, pchild) {
if (hwloc_obj_type_is_io(child->type))
unlink_and_free_object_and_children(pchild);
else
hwloc_drop_all_io(topology, child);
}
}
/*
* If IO_DEVICES and WHOLE_IO are not set, we drop everything.
* If WHOLE_IO is not set, we drop non-interesting devices,
@ -1546,9 +1562,7 @@ hwloc_drop_useless_io(hwloc_topology_t topology, hwloc_obj_t root)
if (!(topology->flags & (HWLOC_TOPOLOGY_FLAG_IO_DEVICES|HWLOC_TOPOLOGY_FLAG_WHOLE_IO))) {
/* drop all I/O children */
for_each_child_safe(child, root, pchild)
if (hwloc_obj_type_is_io(child->type))
unlink_and_free_object_and_children(pchild);
hwloc_drop_all_io(topology, root);
return;
}