~ubuntu-branches/ubuntu/vivid/mpich/vivid-proposed

« back to all changes in this revision

Viewing changes to src/pm/hydra/tools/topo/hwloc/hwloc/src/traversal.c

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-04-01 20:24:20 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20140401202420-t5ey1ia2klt5dkq3
Tags: 3.1-4
* [c3e3398] Disable test_primitives, which is unreliable on some platforms.
            (Closes: #743047)
* [265a699] Add minimal autotest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include <private/private.h>
12
12
#include <private/misc.h>
13
13
#include <private/debug.h>
 
14
#ifdef HAVE_STRINGS_H
 
15
#include <strings.h>
 
16
#endif /* HAVE_STRINGS_H */
14
17
 
15
18
int
16
19
hwloc_get_type_depth (struct hwloc_topology *topology, hwloc_obj_type_t type)
402
405
                          verbose ? hwloc_obj_type_string(type): "");
403
406
  case HWLOC_OBJ_GROUP:
404
407
          /* TODO: more pretty presentation? */
405
 
    return hwloc_snprintf(string, size, "%s%u", hwloc_obj_type_string(type), obj->attr->group.depth);
 
408
    if (obj->attr->group.depth != (unsigned) -1)
 
409
      return hwloc_snprintf(string, size, "%s%u", hwloc_obj_type_string(type), obj->attr->group.depth);
 
410
    else
 
411
      return hwloc_snprintf(string, size, "%s", hwloc_obj_type_string(type));
406
412
  case HWLOC_OBJ_BRIDGE:
407
413
    if (verbose)
408
414
      return snprintf(string, size, "Bridge %s->%s",
416
422
  case HWLOC_OBJ_OS_DEVICE:
417
423
    switch (obj->attr->osdev.type) {
418
424
    case HWLOC_OBJ_OSDEV_BLOCK: return hwloc_snprintf(string, size, "Block");
419
 
    case HWLOC_OBJ_OSDEV_NETWORK: return hwloc_snprintf(string, size, "Net");
 
425
    case HWLOC_OBJ_OSDEV_NETWORK: return hwloc_snprintf(string, size, verbose ? "Network" : "Net");
420
426
    case HWLOC_OBJ_OSDEV_OPENFABRICS: return hwloc_snprintf(string, size, "OpenFabrics");
421
427
    case HWLOC_OBJ_OSDEV_DMA: return hwloc_snprintf(string, size, "DMA");
422
428
    case HWLOC_OBJ_OSDEV_GPU: return hwloc_snprintf(string, size, "GPU");
 
429
    case HWLOC_OBJ_OSDEV_COPROC: return hwloc_snprintf(string, size, verbose ? "Co-Processor" : "CoProc");
423
430
    default:
424
431
      *string = '\0';
425
432
      return 0;