diff --git a/NEWS b/NEWS index 7c305e8..83b577a 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,8 @@ Version 1.0.0 + Support binding of entire multithreaded process on Linux. + Cleanup XML export/import. * Objects + + HWLOC_OBJ_PROC is renamed into HWLOC_OBJ_PU for "Processing Unit", + its stringified type name is now "PU". + Rework memory attributes. + Add different cpusets in each object to specify processors that are offline, unavailable, ... diff --git a/doc/Makefile.am b/doc/Makefile.am index 0a3537d..fe521a0 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -233,7 +233,7 @@ man3_MANS = \ $(DOX_MAN_DIR)/man3/HWLOC_OBJ_MACHINE.3 \ $(DOX_MAN_DIR)/man3/HWLOC_OBJ_MISC.3 \ $(DOX_MAN_DIR)/man3/HWLOC_OBJ_NODE.3 \ - $(DOX_MAN_DIR)/man3/HWLOC_OBJ_PROC.3 \ + $(DOX_MAN_DIR)/man3/HWLOC_OBJ_PU.3 \ $(DOX_MAN_DIR)/man3/HWLOC_OBJ_SOCKET.3 \ $(DOX_MAN_DIR)/man3/HWLOC_OBJ_SYSTEM.3 \ $(DOX_MAN_DIR)/man3/HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM.3 \ diff --git a/doc/hwloc-hello.c b/doc/hwloc-hello.c index a86046d..95586a7 100644 --- a/doc/hwloc-hello.c +++ b/doc/hwloc-hello.c @@ -84,7 +84,7 @@ int main(void) */ levels = 0; size = 0; - for (obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PROC, 0); + for (obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PU, 0); obj; obj = obj->parent) if (obj->type == HWLOC_OBJ_CACHE) { diff --git a/doc/hwloc.doxy b/doc/hwloc.doxy index c2601b6..adbfff9 100644 --- a/doc/hwloc.doxy +++ b/doc/hwloc.doxy @@ -769,7 +769,7 @@ os_index field of objects, but such practice should be avoided as much as possible for the reasons described above (except perhaps for prettyprinting / debugging purposes). -::HWLOC_OBJ_PROC objects are supposed to have different physical/OS +::HWLOC_OBJ_PU objects are supposed to have different physical/OS indexes since the OS uses them for binding. The \p os_index field of these objects provides the identifier that may be used for such binding, and hwloc_get_proc_obj_by_os_index() finds the object diff --git a/include/hwloc.h b/include/hwloc.h index 1e519a5..fc8a278 100644 --- a/include/hwloc.h +++ b/include/hwloc.h @@ -94,7 +94,7 @@ typedef enum { * A computation unit (may be shared by several * logical processors). */ - HWLOC_OBJ_PROC, /**< \brief (Logical) Processor. + HWLOC_OBJ_PU, /**< \brief Processing Unit, or (Logical) Processor. * An execution unit (may share a core with some * other logical processors, e.g. in the case of * an SMT core). @@ -124,7 +124,7 @@ typedef enum { * contain sockets which contain caches, which contain cores, which contain * processors). * - * \note HWLOC_OBJ_PROC will always be the deepest. + * \note HWLOC_OBJ_PU will always be the deepest. * \note This does not mean that the actual topology will respect that order: * e.g. as of today cores may also contain caches, and sockets may also contain * nodes. This is thus just to be seen as a fallback comparison method. @@ -373,7 +373,7 @@ HWLOC_DECLSPEC void hwloc_topology_check(hwloc_topology_t topology); /** \brief Ignore an object type. * * Ignore all objects from the given type. - * The bottom-level type HWLOC_OBJ_PROC may not be ignored. + * The bottom-level type HWLOC_OBJ_PU may not be ignored. * The top-level object of the hierarchy will never be ignored, even if this function * succeeds. */ @@ -383,7 +383,7 @@ HWLOC_DECLSPEC int hwloc_topology_ignore_type(hwloc_topology_t topology, hwloc_o * * Ignore all objects from the given type as long as they do not bring any structure: * Each ignored object should have a single children or be the only child of its parent. - * The bottom-level type HWLOC_OBJ_PROC may not be ignored. + * The bottom-level type HWLOC_OBJ_PU may not be ignored. */ HWLOC_DECLSPEC int hwloc_topology_ignore_type_keep_structure(hwloc_topology_t topology, hwloc_obj_type_t type); @@ -573,7 +573,7 @@ HWLOC_DECLSPEC hwloc_obj_t hwloc_topology_insert_misc_object_by_parent(hwloc_top /** \brief Get the depth of the hierachical tree of objects. * - * This is the depth of HWLOC_OBJ_PROC objects plus one. + * This is the depth of HWLOC_OBJ_PU objects plus one. */ HWLOC_DECLSPEC unsigned hwloc_topology_get_depth(hwloc_topology_t __hwloc_restrict topology) __hwloc_attribute_pure; diff --git a/include/hwloc/helper.h b/include/hwloc/helper.h index 5826729..ce1357a 100644 --- a/include/hwloc/helper.h +++ b/include/hwloc/helper.h @@ -38,7 +38,7 @@ hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type) return depth; /* find the highest existing level with type order >= */ - for(depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PROC); ; depth--) + for(depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PU); ; depth--) if (hwloc_compare_types(hwloc_get_depth_type(topology, depth), type) < 0) return depth+1; @@ -143,10 +143,10 @@ hwloc_get_next_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, return hwloc_get_next_obj_by_depth (topology, depth, prev); } -/** \brief Returns the object of type ::HWLOC_OBJ_PROC with \p os_index. +/** \brief Returns the object of type ::HWLOC_OBJ_PU with \p os_index. * * \note The \p os_index field of object should most of the times only be - * used for pretty-printing purpose. Type ::HWLOC_OBJ_PROC is the only case + * used for pretty-printing purpose. Type ::HWLOC_OBJ_PU is the only case * where \p os_index could actually be useful, when manually binding to * processors. * However, using CPU sets to hide this complexity should often be preferred. @@ -155,7 +155,7 @@ static __inline hwloc_obj_t __hwloc_attribute_pure hwloc_get_proc_obj_by_os_index(hwloc_topology_t topology, unsigned os_index) { hwloc_obj_t obj = NULL; - while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_PROC, obj)) != NULL) + while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_PU, obj)) != NULL) if (obj->os_index == os_index) return obj; return NULL; diff --git a/include/hwloc/rename.h b/include/hwloc/rename.h index 2b13cef..3af6266 100644 --- a/include/hwloc/rename.h +++ b/include/hwloc/rename.h @@ -41,7 +41,7 @@ #define HWLOC_OBJ_SOCKET HWLOC_NAME_CAPS(OBJ_SOCKET) #define HWLOC_OBJ_CACHE HWLOC_NAME_CAPS(OBJ_CACHE) #define HWLOC_OBJ_CORE HWLOC_NAME_CAPS(OBJ_CORE) -#define HWLOC_OBJ_PROC HWLOC_NAME_CAPS(OBJ_PROC) +#define HWLOC_OBJ_PU HWLOC_NAME_CAPS(OBJ_PU) #define HWLOC_OBJ_MISC HWLOC_NAME_CAPS(OBJ_MISC) #define hwloc_obj_type_t HWLOC_NAME(obj_type_t) diff --git a/src/topology-aix.c b/src/topology-aix.c index 2f71587..0b0fb46 100644 --- a/src/topology-aix.c +++ b/src/topology-aix.c @@ -195,7 +195,7 @@ look_rset(int sdl, hwloc_obj_type_t type, struct hwloc_topology *topology, int l /* It seems logical processors are numbered from 1 here, while the * bindprocessor functions numbers them from 0... */ - obj = hwloc_alloc_setup_object(type, i - (type == HWLOC_OBJ_PROC)); + obj = hwloc_alloc_setup_object(type, i - (type == HWLOC_OBJ_PU)); obj->cpuset = hwloc_cpuset_alloc(); obj->os_level = sdl; switch(type) { @@ -282,7 +282,7 @@ hwloc_look_aix(struct hwloc_topology *topology) if (i == rs_getinfo(NULL, R_MAXSDL, 0)) { hwloc_debug("looking AIX max sdl %d\n", i); - look_rset(i, HWLOC_OBJ_PROC, topology, i); + look_rset(i, HWLOC_OBJ_PU, topology, i); known = 1; topology->support.discovery.proc = 1; } diff --git a/src/topology-hpux.c b/src/topology-hpux.c index ce91091..6e28cab 100644 --- a/src/topology-hpux.c +++ b/src/topology-hpux.c @@ -168,7 +168,7 @@ hwloc_look_hpux(struct hwloc_topology *topology) currentcpu = mpctl(topology->flags & HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM ? MPC_GETFIRSTSPU_SYS : MPC_GETFIRSTSPU, 0,0); while (currentcpu != -1) { - obj = hwloc_alloc_setup_object(HWLOC_OBJ_PROC, currentcpu); + obj = hwloc_alloc_setup_object(HWLOC_OBJ_PU, currentcpu); obj->cpuset = hwloc_cpuset_alloc(); hwloc_cpuset_set(obj->cpuset, currentcpu); diff --git a/src/topology-linux.c b/src/topology-linux.c index 674d73f..8ddc2ee 100644 --- a/src/topology-linux.c +++ b/src/topology-linux.c @@ -1329,7 +1329,7 @@ look_sysfscpu(struct hwloc_topology *topology, const char *path) hwloc_cpuset_cpu(threadset, i); /* add the thread */ - thread = hwloc_alloc_setup_object(HWLOC_OBJ_PROC, i); + thread = hwloc_alloc_setup_object(HWLOC_OBJ_PU, i); thread->cpuset = threadset; hwloc_debug_1arg_cpuset("thread %d has cpuset %s\n", i, threadset); @@ -1480,7 +1480,7 @@ look_cpuinfo(struct hwloc_topology *topology, const char *path, getprocnb_begin(PROCESSOR,processor); hwloc_cpuset_set(cpuset, processor); - obj = hwloc_alloc_setup_object(HWLOC_OBJ_PROC, processor); + obj = hwloc_alloc_setup_object(HWLOC_OBJ_PU, processor); obj->cpuset = hwloc_cpuset_alloc(); hwloc_cpuset_cpu(obj->cpuset, processor); diff --git a/src/topology-synthetic.c b/src/topology-synthetic.c index 435666d..9da702a 100644 --- a/src/topology-synthetic.c +++ b/src/topology-synthetic.c @@ -54,8 +54,8 @@ hwloc_backend_synthetic_init(struct hwloc_topology *topology, const char *descri type = HWLOC_OBJ_CORE; else if (!hwloc_namecoloncmp(pos, "caches", 2)) type = HWLOC_OBJ_CACHE; - else if (!hwloc_namecoloncmp(pos, "procs", 1)) - type = HWLOC_OBJ_PROC; + else if (!hwloc_namecoloncmp(pos, "pus", 1)) + type = HWLOC_OBJ_PU; else if (!hwloc_namecoloncmp(pos, "misc", 2)) type = HWLOC_OBJ_MISC; @@ -99,7 +99,7 @@ hwloc_backend_synthetic_init(struct hwloc_topology *topology, const char *descri if (type == HWLOC_OBJ_TYPE_UNKNOWN) { switch (count-1-i) { - case 0: type = HWLOC_OBJ_PROC; break; + case 0: type = HWLOC_OBJ_PU; break; case 1: type = HWLOC_OBJ_CORE; break; case 2: type = HWLOC_OBJ_CACHE; break; case 3: type = HWLOC_OBJ_SOCKET; break; @@ -149,8 +149,8 @@ hwloc_backend_synthetic_init(struct hwloc_topology *topology, const char *descri } /* last level must be PROC */ - if (topology->backend_params.synthetic.type[count-1] != HWLOC_OBJ_PROC) { - fprintf(stderr,"synthetic string needs to have a number of processors\n"); + if (topology->backend_params.synthetic.type[count-1] != HWLOC_OBJ_PU) { + fprintf(stderr,"synthetic string needs to have a number of PUs\n"); return -1; } @@ -203,14 +203,14 @@ hwloc__look_synthetic(struct hwloc_topology *topology, break; case HWLOC_OBJ_CORE: break; - case HWLOC_OBJ_PROC: + case HWLOC_OBJ_PU: break; } obj = hwloc_alloc_setup_object(type, topology->backend_params.synthetic.id[level]++); obj->cpuset = hwloc_cpuset_alloc(); - if (type == HWLOC_OBJ_PROC) { + if (type == HWLOC_OBJ_PU) { hwloc_cpuset_set(obj->cpuset, first_cpu++); } else { for (i = 0; i < topology->backend_params.synthetic.arity[level]; i++) @@ -258,7 +258,7 @@ hwloc__look_synthetic(struct hwloc_topology *topology, break; case HWLOC_OBJ_CORE: break; - case HWLOC_OBJ_PROC: + case HWLOC_OBJ_PU: break; } diff --git a/src/topology.c b/src/topology.c index e3f9646..dcf1426 100644 --- a/src/topology.c +++ b/src/topology.c @@ -384,7 +384,7 @@ hwloc_setup_misc_level_from_distances(struct hwloc_topology *topology, /* * Use the given number of processors and the optional online cpuset if given - * to set a Proc level. + * to set a PU level. */ void hwloc_setup_proc_level(struct hwloc_topology *topology, @@ -396,7 +396,7 @@ hwloc_setup_proc_level(struct hwloc_topology *topology, hwloc_debug("%s", "\n\n * CPU cpusets *\n\n"); for (cpu=0,oscpu=0; cpucpuset = hwloc_cpuset_alloc(); hwloc_cpuset_cpu(obj->cpuset, oscpu); @@ -512,7 +512,7 @@ static const unsigned obj_type_order[] = { [HWLOC_OBJ_SOCKET] = 4, [HWLOC_OBJ_CACHE] = 5, [HWLOC_OBJ_CORE] = 6, - [HWLOC_OBJ_PROC] = 7 + [HWLOC_OBJ_PU] = 7 }; static const hwloc_obj_type_t obj_order_type[] = { @@ -523,7 +523,7 @@ static const hwloc_obj_type_t obj_order_type[] = { [4] = HWLOC_OBJ_SOCKET, [5] = HWLOC_OBJ_CACHE, [6] = HWLOC_OBJ_CORE, - [7] = HWLOC_OBJ_PROC + [7] = HWLOC_OBJ_PU }; static unsigned __hwloc_attribute_const @@ -909,8 +909,8 @@ collect_proc_cpuset(hwloc_obj_t obj, hwloc_obj_t system) hwloc_obj_t child, *temp; if (system) { - /* We are already given a pointer to an system object */ - if (obj->type == HWLOC_OBJ_PROC) + /* We are already given a pointer to a system object */ + if (obj->type == HWLOC_OBJ_PU) hwloc_cpuset_or(system->cpuset, system->cpuset, obj->cpuset); } else { if (obj->cpuset) { @@ -1548,10 +1548,10 @@ hwloc_discover(struct hwloc_topology *topology) while (n_objs) { /* First find which type of object is the topmost. - * Don't use PROC if there are other types since we want to keep PROC at the bottom. + * Don't use PU if there are other types since we want to keep PU at the bottom. */ for (i = 0; i < n_objs; i++) - if (objs[i]->type != HWLOC_OBJ_PROC) + if (objs[i]->type != HWLOC_OBJ_PU) break; top_obj = i == n_objs ? objs[0] : objs[i]; for (i = 0; i < n_objs; i++) { @@ -1865,8 +1865,8 @@ hwloc_topology_ignore_type(struct hwloc_topology *topology, hwloc_obj_type_t typ } - if (type == HWLOC_OBJ_PROC) { - /* we need the proc level */ + if (type == HWLOC_OBJ_PU) { + /* we need the PU level */ errno = EINVAL; return -1; } @@ -1883,8 +1883,8 @@ hwloc_topology_ignore_type_keep_structure(struct hwloc_topology *topology, hwloc return -1; } - if (type == HWLOC_OBJ_PROC) { - /* we need the proc level */ + if (type == HWLOC_OBJ_PU) { + /* we need the PU level */ errno = EINVAL; return -1; } @@ -1898,7 +1898,7 @@ hwloc_topology_ignore_all_keep_structure(struct hwloc_topology *topology) { unsigned type; for(type=0; typeignored_types[type] = HWLOC_IGNORE_TYPE_KEEP_STRUCTURE; return 0; } @@ -2094,11 +2094,11 @@ hwloc_topology_check(struct hwloc_topology *topology) assert(i == hwloc_get_type_order(hwloc_get_order_type(i))); } - /* check that last level is PROC */ - assert(hwloc_get_depth_type(topology, hwloc_topology_get_depth(topology)-1) == HWLOC_OBJ_PROC); - /* check that other levels are not PROC */ + /* check that last level is PU */ + assert(hwloc_get_depth_type(topology, hwloc_topology_get_depth(topology)-1) == HWLOC_OBJ_PU); + /* check that other levels are not PU */ for(i=1; iarity == 0); assert(obj->children == NULL); - /* bottom-level object must always be PROC */ - assert(obj->type == HWLOC_OBJ_PROC); + /* bottom-level object must always be PU */ + assert(obj->type == HWLOC_OBJ_PU); } } diff --git a/src/traversal.c b/src/traversal.c index 217bac2..274d520 100644 --- a/src/traversal.c +++ b/src/traversal.c @@ -146,7 +146,7 @@ hwloc_obj_type_string (hwloc_obj_type_t obj) case HWLOC_OBJ_SOCKET: return "Socket"; case HWLOC_OBJ_CACHE: return "Cache"; case HWLOC_OBJ_CORE: return "Core"; - case HWLOC_OBJ_PROC: return "Proc"; + case HWLOC_OBJ_PU: return "PU"; default: return "Unknown"; } } @@ -161,7 +161,7 @@ hwloc_obj_type_of_string (const char * string) if (!strcasecmp(string, "Socket")) return HWLOC_OBJ_SOCKET; if (!strcasecmp(string, "Cache")) return HWLOC_OBJ_CACHE; if (!strcasecmp(string, "Core")) return HWLOC_OBJ_CORE; - if (!strcasecmp(string, "Proc")) return HWLOC_OBJ_PROC; + if (!strcasecmp(string, "PU") || !strcasecmp(string, "proc") /* backward compatiliby with 0.9 */) return HWLOC_OBJ_PU; return (hwloc_obj_type_t) -1; } @@ -180,9 +180,8 @@ hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_t size, hwloc_obj_t case HWLOC_OBJ_NODE: case HWLOC_OBJ_SOCKET: case HWLOC_OBJ_CORE: + case HWLOC_OBJ_PU: return hwloc_snprintf(string, size, "%s", hwloc_obj_type_string(type)); - case HWLOC_OBJ_PROC: - return hwloc_snprintf(string, size, "%s", verbose ? hwloc_obj_type_string(type) : "P"); case HWLOC_OBJ_CACHE: return hwloc_snprintf(string, size, "L%u%s", obj->attr->cache.depth, verbose ? hwloc_obj_type_string(type): ""); case HWLOC_OBJ_MISC: diff --git a/tests/glibc-sched.c b/tests/glibc-sched.c index 0b46c1c..067fd1c 100644 --- a/tests/glibc-sched.c +++ b/tests/glibc-sched.c @@ -52,7 +52,7 @@ int main(void) obj = hwloc_get_obj_by_depth(topology, depth-1, hwloc_get_nbobjs_by_depth(topology, depth-1) - 1); assert(obj); - assert(obj->type == HWLOC_OBJ_PROC); + assert(obj->type == HWLOC_OBJ_PU); hwlocset = hwloc_cpuset_dup(obj->cpuset); hwloc_cpuset_to_glibc_sched_affinity(topology, hwlocset, &schedset, sizeof(schedset)); diff --git a/tests/hwloc_get_obj_below_array_by_type.c b/tests/hwloc_get_obj_below_array_by_type.c index ce28194..da80e21 100644 --- a/tests/hwloc_get_obj_below_array_by_type.c +++ b/tests/hwloc_get_obj_below_array_by_type.c @@ -39,7 +39,7 @@ main (void) typev[0] = HWLOC_OBJ_NODE; idxv[0] = 0; typev[1] = HWLOC_OBJ_SOCKET; idxv[1] = 0; typev[2] = HWLOC_OBJ_CORE; idxv[2] = 0; - typev[3] = HWLOC_OBJ_PROC; idxv[3] = 0; + typev[3] = HWLOC_OBJ_PU; idxv[3] = 0; obj = hwloc_get_obj_below_array_by_type(topology, 4, typev, idxv); assert(obj == hwloc_get_obj_by_depth(topology, 4, 0)); @@ -65,7 +65,7 @@ main (void) assert(obj == hwloc_get_obj_by_depth(topology, 3, 20)); typev[0] = HWLOC_OBJ_SOCKET; idxv[0] = 1; - typev[1] = HWLOC_OBJ_PROC; idxv[1] = 1; + typev[1] = HWLOC_OBJ_PU; idxv[1] = 1; obj = hwloc_get_obj_below_array_by_type(topology, 2, typev, idxv); assert(obj == hwloc_get_obj_by_depth(topology, 4, 10)); /* check that hwloc_get_obj_below_by_type works as well */ diff --git a/tests/hwloc_get_obj_inside_cpuset.c b/tests/hwloc_get_obj_inside_cpuset.c index 1b52c5e..9c03007 100644 --- a/tests/hwloc_get_obj_inside_cpuset.c +++ b/tests/hwloc_get_obj_inside_cpuset.c @@ -48,11 +48,11 @@ main (void) obj = hwloc_get_next_obj_inside_cpuset_by_type(topology, root->cpuset, HWLOC_OBJ_SYSTEM, obj); assert(!obj); - /* check last proc */ - obj = hwloc_get_obj_inside_cpuset_by_type(topology, root->cpuset, HWLOC_OBJ_PROC, 2*3*4*5*6-1); + /* check last PU */ + obj = hwloc_get_obj_inside_cpuset_by_type(topology, root->cpuset, HWLOC_OBJ_PU, 2*3*4*5*6-1); assert(obj == hwloc_get_obj_by_depth(topology, 5, 2*3*4*5*6-1)); - /* there is no next proc after the last one */ - obj = hwloc_get_next_obj_inside_cpuset_by_type(topology, root->cpuset, HWLOC_OBJ_PROC, obj); + /* there is no next PU after the last one */ + obj = hwloc_get_next_obj_inside_cpuset_by_type(topology, root->cpuset, HWLOC_OBJ_PU, obj); assert(!obj); @@ -65,9 +65,9 @@ main (void) assert(hwloc_get_nbobjs_inside_cpuset_by_type(topology, root->cpuset, HWLOC_OBJ_CACHE) == 12); - /* check first proc of second socket */ + /* check first PU of second socket */ root = hwloc_get_obj_by_depth(topology, 2, 1); - obj = hwloc_get_obj_inside_cpuset_by_type(topology, root->cpuset, HWLOC_OBJ_PROC, 0); + obj = hwloc_get_obj_inside_cpuset_by_type(topology, root->cpuset, HWLOC_OBJ_PU, 0); assert(obj == hwloc_get_obj_by_depth(topology, 5, 4*5*6)); /* check third core of third socket */ diff --git a/tests/hwloc_type_depth.c b/tests/hwloc_type_depth.c index 4cd0ae5..8111f18 100644 --- a/tests/hwloc_type_depth.c +++ b/tests/hwloc_type_depth.c @@ -31,12 +31,12 @@ int main(void) assert(hwloc_get_depth_type(topology, 3) == HWLOC_OBJ_CORE); assert(hwloc_get_depth_type(topology, 4) == HWLOC_OBJ_CACHE); assert(hwloc_get_depth_type(topology, 5) == HWLOC_OBJ_CACHE); - assert(hwloc_get_depth_type(topology, 6) == HWLOC_OBJ_PROC); + assert(hwloc_get_depth_type(topology, 6) == HWLOC_OBJ_PU); assert(hwloc_get_type_depth(topology, HWLOC_OBJ_MACHINE) == 1); assert(hwloc_get_type_depth(topology, HWLOC_OBJ_MISC) == 2); assert(hwloc_get_type_depth(topology, HWLOC_OBJ_CORE) == 3); - assert(hwloc_get_type_depth(topology, HWLOC_OBJ_PROC) == 6); + assert(hwloc_get_type_depth(topology, HWLOC_OBJ_PU) == 6); assert(hwloc_get_type_depth(topology, HWLOC_OBJ_NODE) == HWLOC_TYPE_DEPTH_UNKNOWN); assert(hwloc_get_type_or_above_depth(topology, HWLOC_OBJ_NODE) == 2); diff --git a/utils/hwloc-bind.1in b/utils/hwloc-bind.1in index 9103acc..7b855ab 100644 --- a/utils/hwloc-bind.1in +++ b/utils/hwloc-bind.1in @@ -75,11 +75,11 @@ hwloc-bind's operation is best described through several examples. To run the echo command on the first logical processor of the second socket: - hwloc-bind socket:1.proc:0 -- echo hello + hwloc-bind socket:1.pu:0 -- echo hello which is exactly equivalent to - hwloc-bind socket:1.proc:0 echo hello + hwloc-bind socket:1.pu:0 echo hello To bind the "echo" command to the first core of the second socket and the second core of the first socket: diff --git a/utils/hwloc-calc.c b/utils/hwloc-calc.c index b9bcbaa..b9a59a6 100644 --- a/utils/hwloc-calc.c +++ b/utils/hwloc-calc.c @@ -24,7 +24,7 @@ static void usage(FILE *where) fprintf(where, " --lo --logical-output\tuse logical indexes for output (default)\n"); fprintf(where, " --pi --physical-input\tuse physical indexes for input\n"); fprintf(where, " --po --physical-output\tuse physical indexes for output\n"); - fprintf(where, " --proclist\treport the list of processors' indexes in the CPU set\n"); + fprintf(where, " --PUlist\treport the list of processing units' indexes in the CPU set\n"); fprintf(where, " --nodelist\treport the list of memory nodes' indexes near the CPU set\n"); fprintf(where, " --objects\treport the list of largest objects in the CPU set\n"); fprintf(where, " -v\t\tverbose messages\n"); @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) int logicali = 1; int logicalo = 1; int nodelist = 0; - int proclist = 0; + int pulist = 0; int showobjs = 0; char **orig_argv = argv; @@ -60,8 +60,8 @@ int main(int argc, char *argv[]) usage(stdout); return EXIT_SUCCESS; } - if (!strcmp(argv[1], "--proclist")) { - proclist = 1; + if (!strcasecmp(argv[1], "--pulist") || !strcmp(argv[1], "--proclist") /* backward compat with 0.9 */) { + pulist = 1; goto next; } if (!strcmp(argv[1], "--nodelist")) { @@ -131,9 +131,9 @@ int main(int argc, char *argv[]) } printf("\n"); hwloc_cpuset_free(remaining); - } else if (proclist) { + } else if (pulist) { hwloc_obj_t proc, prev = NULL; - while ((proc = hwloc_get_next_obj_covering_cpuset_by_type(topology, set, HWLOC_OBJ_PROC, prev)) != NULL) { + while ((proc = hwloc_get_next_obj_covering_cpuset_by_type(topology, set, HWLOC_OBJ_PU, prev)) != NULL) { if (prev) printf(","); printf("%u", logicalo ? proc->logical_index : proc->os_index); diff --git a/utils/hwloc-calc.h b/utils/hwloc-calc.h index 2281edf..b50f9b1 100644 --- a/utils/hwloc-calc.h +++ b/utils/hwloc-calc.h @@ -101,8 +101,8 @@ hwloc_mask_append_object(hwloc_topology_t topology, unsigned topodepth, depth = hwloc_get_type_or_above_depth(topology, HWLOC_OBJ_SOCKET); else if (!hwloc_namecoloncmp(string, "core", 1)) depth = hwloc_get_type_or_above_depth(topology, HWLOC_OBJ_CORE); - else if (!hwloc_namecoloncmp(string, "proc", 1)) - depth = hwloc_get_type_or_above_depth(topology, HWLOC_OBJ_PROC); + else if (!hwloc_namecoloncmp(string, "pu", 1) || !hwloc_namecoloncmp(string, "proc", 1) /* backward compat with 0.9 */) + depth = hwloc_get_type_or_above_depth(topology, HWLOC_OBJ_PU); else { char *end; depth = strtol(string, &end, 0); diff --git a/utils/lstopo-draw.c b/utils/lstopo-draw.c index b504341..895d520 100644 --- a/utils/lstopo-draw.c +++ b/utils/lstopo-draw.c @@ -335,12 +335,11 @@ lstopo_obj_snprintf(char *text, size_t textlen, hwloc_obj_t obj, int logical) { unsigned index = logical ? obj->logical_index : obj->os_index; const char *indexprefix = logical ? " #" : " p#"; - char typestr[32] = "P"; + char typestr[32]; char indexstr[32]= ""; char attrstr[256]; size_t attrlen; - if (obj->type != HWLOC_OBJ_PROC) - hwloc_obj_type_snprintf(typestr, sizeof(typestr), obj, 0); + hwloc_obj_type_snprintf(typestr, sizeof(typestr), obj, 0); if (index != (unsigned)-1 && obj->depth != 0) snprintf(indexstr, sizeof(indexstr), "%s%u", indexprefix, index); attrlen = hwloc_obj_attr_snprintf(attrstr, sizeof(attrstr), obj, " ", 0); @@ -641,7 +640,7 @@ get_type_fun(hwloc_obj_type_t type) case HWLOC_OBJ_SOCKET: return socket_draw; case HWLOC_OBJ_CACHE: return cache_draw; case HWLOC_OBJ_CORE: return core_draw; - case HWLOC_OBJ_PROC: return proc_draw; + case HWLOC_OBJ_PU: return proc_draw; case HWLOC_OBJ_MISC: return misc_draw; } return NULL; diff --git a/utils/lstopo-text.c b/utils/lstopo-text.c index a19e9a1..75292e8 100644 --- a/utils/lstopo-text.c +++ b/utils/lstopo-text.c @@ -45,15 +45,12 @@ output_console_obj (hwloc_obj_t l, FILE *output, int logical, int verbose_mode) unsigned index = logical ? l->logical_index : l->os_index; const char *indexprefix = logical ? " #" : " p#"; if (show_cpuset < 2) { - if (l->type != HWLOC_OBJ_PROC) { - hwloc_obj_type_snprintf (type, sizeof(type), l, verbose_mode-1); - fprintf(output, "%s", type); - } else - fprintf(output, "P"); + hwloc_obj_type_snprintf (type, sizeof(type), l, verbose_mode-1); + fprintf(output, "%s", type); if (l->depth != 0 && index != (unsigned)-1) fprintf(output, "%s%u", indexprefix, index); if (logical && l->os_index != (unsigned) -1 && - (verbose_mode >= 2 || l->type == HWLOC_OBJ_PROC || l->type == HWLOC_OBJ_NODE)) + (verbose_mode >= 2 || l->type == HWLOC_OBJ_PU || l->type == HWLOC_OBJ_NODE)) snprintf(phys, sizeof(phys), "phys=%u", l->os_index); hwloc_obj_attr_snprintf (attr, sizeof(attr), l, " ", verbose_mode-1); if (*phys || *attr) { diff --git a/utils/lstopo.1in b/utils/lstopo.1in index 37bcb2c..65e4196 100644 --- a/utils/lstopo.1in +++ b/utils/lstopo.1in @@ -29,7 +29,7 @@ Opposite of --verbose (default). \fB\-l\fR \fB\-\-logical\fR Display hwloc logical indexes instead of physical/OS indexes (default). These indexes are prefixed with "#". -The physical indexes of some objects (Proc and Node by default, all +The physical indexes of some objects (PU and Node by default, all objects if verbose) will appear as object attribute "phys=...". .TP \fB\-p\fR \fB\-\-physical\fR @@ -244,13 +244,13 @@ To only show the cpusets of sockets: lstopo --only socket --cpuset-only Simulate a fake hierarchy; this example shows with 2 NUMA nodes of 2 -processors: +processor units: lstopo --synthetic "n:2 2" To count the number of logical processors in the system - lstopo --only proc | wc -l + lstopo --only pu | wc -l .\" ************************** .\" See also section .\" **************************