[mpich2-commits] r7501 - in mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc: include/hwloc src utils

balaji at mcs.anl.gov balaji at mcs.anl.gov
Wed Nov 24 03:23:21 CST 2010


Author: balaji
Date: 2010-11-24 03:23:21 -0600 (Wed, 24 Nov 2010)
New Revision: 7501

Modified:
   mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/cpuset.h
   mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/cpuset.c
   mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-linux.c
   mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-bind.c
   mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-calc.c
Log:
Squash warnings on global variables being shadowed.

Modified: mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/cpuset.h
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/cpuset.h	2010-11-24 09:23:06 UTC (rev 7500)
+++ mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/cpuset.h	2010-11-24 09:23:21 UTC (rev 7501)
@@ -39,14 +39,14 @@
 static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_from_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask) { hwloc_bitmap_from_ith_ulong(bitmap, i, mask); }
 static __hwloc_inline unsigned __hwloc_attribute_deprecated long hwloc_cpuset_to_ulong(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_to_ulong(bitmap); }
 static __hwloc_inline unsigned __hwloc_attribute_deprecated long hwloc_cpuset_to_ith_ulong(hwloc_const_bitmap_t bitmap, unsigned i) { return hwloc_bitmap_to_ith_ulong(bitmap, i); }
-static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_cpu(hwloc_bitmap_t bitmap, unsigned index) { hwloc_bitmap_only(bitmap, index); }
-static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_all_but_cpu(hwloc_bitmap_t bitmap, unsigned index) { hwloc_bitmap_allbut(bitmap, index); }
-static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_set(hwloc_bitmap_t bitmap, unsigned index) { hwloc_bitmap_set(bitmap, index); }
+static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_cpu(hwloc_bitmap_t bitmap, unsigned index_) { hwloc_bitmap_only(bitmap, index_); }
+static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_all_but_cpu(hwloc_bitmap_t bitmap, unsigned index_) { hwloc_bitmap_allbut(bitmap, index_); }
+static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_set(hwloc_bitmap_t bitmap, unsigned index_) { hwloc_bitmap_set(bitmap, index_); }
 static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_set_range(hwloc_bitmap_t bitmap, unsigned begin, unsigned end) { hwloc_bitmap_set_range(bitmap, begin, end); }
 static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_set_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask) { hwloc_bitmap_set_ith_ulong(bitmap, i, mask); }
-static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_clr(hwloc_bitmap_t bitmap, unsigned index) { hwloc_bitmap_clr(bitmap, index); }
+static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_clr(hwloc_bitmap_t bitmap, unsigned index_) { hwloc_bitmap_clr(bitmap, index_); }
 static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_clr_range(hwloc_bitmap_t bitmap, unsigned begin, unsigned end) { hwloc_bitmap_clr_range(bitmap, begin, end); }
-static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_isset(hwloc_const_bitmap_t bitmap, unsigned index) { return hwloc_bitmap_isset(bitmap, index); }
+static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_isset(hwloc_const_bitmap_t bitmap, unsigned index_) { return hwloc_bitmap_isset(bitmap, index_); }
 static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_iszero(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_iszero(bitmap); }
 static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_isfull(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_isfull(bitmap); }
 static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_isequal(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { return hwloc_bitmap_isequal(bitmap1, bitmap2); }

Modified: mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/cpuset.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/cpuset.c	2010-11-24 09:23:06 UTC (rev 7500)
+++ mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/cpuset.c	2010-11-24 09:23:21 UTC (rev 7501)
@@ -547,29 +547,29 @@
 
 void hwloc_bitmap_only(struct hwloc_bitmap_s * set, unsigned cpu)
 {
-	unsigned index = HWLOC_SUBBITMAP_INDEX(cpu);
+	unsigned index_ = HWLOC_SUBBITMAP_INDEX(cpu);
 
 	HWLOC__BITMAP_CHECK(set);
 
 	hwloc_bitmap_reset_by_cpu_index(set, cpu);
 	hwloc_bitmap__zero(set);
-	set->ulongs[index] |= HWLOC_SUBBITMAP_CPU(cpu);
+	set->ulongs[index_] |= HWLOC_SUBBITMAP_CPU(cpu);
 }
 
 void hwloc_bitmap_allbut(struct hwloc_bitmap_s * set, unsigned cpu)
 {
-	unsigned index = HWLOC_SUBBITMAP_INDEX(cpu);
+	unsigned index_ = HWLOC_SUBBITMAP_INDEX(cpu);
 
 	HWLOC__BITMAP_CHECK(set);
 
 	hwloc_bitmap_reset_by_cpu_index(set, cpu);
 	hwloc_bitmap__fill(set);
-	set->ulongs[index] &= ~HWLOC_SUBBITMAP_CPU(cpu);
+	set->ulongs[index_] &= ~HWLOC_SUBBITMAP_CPU(cpu);
 }
 
 void hwloc_bitmap_set(struct hwloc_bitmap_s * set, unsigned cpu)
 {
-	unsigned index = HWLOC_SUBBITMAP_INDEX(cpu);
+	unsigned index_ = HWLOC_SUBBITMAP_INDEX(cpu);
 
 	HWLOC__BITMAP_CHECK(set);
 
@@ -578,7 +578,7 @@
 		return;
 
 	hwloc_bitmap_realloc_by_cpu_index(set, cpu);
-	set->ulongs[index] |= HWLOC_SUBBITMAP_CPU(cpu);
+	set->ulongs[index_] |= HWLOC_SUBBITMAP_CPU(cpu);
 }
 
 void hwloc_bitmap_set_range(struct hwloc_bitmap_s * set, unsigned begincpu, unsigned endcpu)
@@ -621,7 +621,7 @@
 
 void hwloc_bitmap_clr(struct hwloc_bitmap_s * set, unsigned cpu)
 {
-	unsigned index = HWLOC_SUBBITMAP_INDEX(cpu);
+	unsigned index_ = HWLOC_SUBBITMAP_INDEX(cpu);
 
 	HWLOC__BITMAP_CHECK(set);
 
@@ -630,7 +630,7 @@
 		return;
 
 	hwloc_bitmap_realloc_by_cpu_index(set, cpu);
-	set->ulongs[index] &= ~HWLOC_SUBBITMAP_CPU(cpu);
+	set->ulongs[index_] &= ~HWLOC_SUBBITMAP_CPU(cpu);
 }
 
 void hwloc_bitmap_clr_range(struct hwloc_bitmap_s * set, unsigned begincpu, unsigned endcpu)
@@ -665,11 +665,11 @@
 
 int hwloc_bitmap_isset(const struct hwloc_bitmap_s * set, unsigned cpu)
 {
-	unsigned index = HWLOC_SUBBITMAP_INDEX(cpu);
+	unsigned index_ = HWLOC_SUBBITMAP_INDEX(cpu);
 
 	HWLOC__BITMAP_CHECK(set);
 
-	return (HWLOC_SUBBITMAP_READULONG(set, index) & HWLOC_SUBBITMAP_CPU(cpu)) != 0;
+	return (HWLOC_SUBBITMAP_READULONG(set, index_) & HWLOC_SUBBITMAP_CPU(cpu)) != 0;
 }
 
 int hwloc_bitmap_iszero(const struct hwloc_bitmap_s *set)

Modified: mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-linux.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-linux.c	2010-11-24 09:23:06 UTC (rev 7500)
+++ mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-linux.c	2010-11-24 09:23:21 UTC (rev 7501)
@@ -1217,11 +1217,11 @@
     hwloc_bitmap_set_ith_ulong(set, i, maps[i]);
 #else
   for(i=0; i<(nr_maps+1)/2; i++) {
-    unsigned long ulong;
-    ulong = maps[2*i];
+    unsigned long ulong_;
+    ulong_ = maps[2*i];
     if (2*i+1<nr_maps)
-      ulong |= maps[2*i+1] << KERNEL_CPU_MASK_BITS;
-    hwloc_bitmap_set_ith_ulong(set, i, ulong);
+      ulong_ |= maps[2*i+1] << KERNEL_CPU_MASK_BITS;
+    hwloc_bitmap_set_ith_ulong(set, i, ulong_);
   }
 #endif
 
@@ -1585,7 +1585,7 @@
 {
   DIR *dir;
   struct dirent *dirent;
-  unsigned long index = 1;
+  unsigned long index_ = 1;
   FILE *hpfd;
   char line[64];
   char path[SYSFS_NUMA_NODE_PATH_LEN];
@@ -1595,21 +1595,21 @@
     while ((dirent = readdir(dir)) != NULL) {
       if (strncmp(dirent->d_name, "hugepages-", 10))
         continue;
-      memory->page_types[index].size = strtoul(dirent->d_name+10, NULL, 0) * 1024ULL;
+      memory->page_types[index_].size = strtoul(dirent->d_name+10, NULL, 0) * 1024ULL;
       sprintf(path, "%s/%s/nr_hugepages", dirpath, dirent->d_name);
       hpfd = hwloc_fopen(path, "r", topology->backend_params.sysfs.root_fd);
       if (hpfd) {
         if (fgets(line, sizeof(line), hpfd)) {
           fclose(hpfd);
           /* these are the actual total amount of huge pages */
-          memory->page_types[index].count = strtoull(line, NULL, 0);
-          *remaining_local_memory -= memory->page_types[index].count * memory->page_types[index].size;
-          index++;
+          memory->page_types[index_].count = strtoull(line, NULL, 0);
+          *remaining_local_memory -= memory->page_types[index_].count * memory->page_types[index_].size;
+          index_++;
         }
       }
     }
     closedir(dir);
-    memory->page_types_len = index;
+    memory->page_types_len = index_;
   }
 }
 
@@ -1825,31 +1825,31 @@
       hwloc_obj_t nodes[nbnodes];
       unsigned distances[nbnodes][nbnodes];
       unsigned distance_indexes[nbnodes];
-      unsigned index;
+      unsigned index_;
 
       /* Get node indexes now. We need them in order since Linux groups
        * sparse distances but keep them in order in the sysfs distance files.
        */
-      index = 0;
+      index_ = 0;
       hwloc_bitmap_foreach_begin (osnode, nodeset) {
-	distance_indexes[index] = osnode;
-	index++;
+	distance_indexes[index_] = osnode;
+	index_++;
       } hwloc_bitmap_foreach_end();
       hwloc_bitmap_free(nodeset);
 
 #ifdef HWLOC_DEBUG
       hwloc_debug("%s", "numa distance indexes: ");
-      for (index = 0; index < nbnodes; index++) {
-	hwloc_debug(" %u", distance_indexes[index]);
+      for (index_ = 0; index_ < nbnodes; index_++) {
+	hwloc_debug(" %u", distance_indexes[index_]);
       }
       hwloc_debug("%s", "\n");
 #endif
 
       /* Get actual distances now */
-      for (index = 0; index < nbnodes; index++) {
+      for (index_ = 0; index_ < nbnodes; index_++) {
           char nodepath[SYSFS_NUMA_NODE_PATH_LEN];
           hwloc_bitmap_t cpuset;
-	  osnode = distance_indexes[index];
+	  osnode = distance_indexes[index_];
 
           sprintf(nodepath, "%s/node%u/cpumap", path, osnode);
           cpuset = hwloc_parse_cpumap(nodepath, topology->backend_params.sysfs.root_fd);
@@ -1866,10 +1866,10 @@
           hwloc_debug_1arg_bitmap("os node %u has cpuset %s\n",
                                   osnode, node->cpuset);
           hwloc_insert_object_by_cpuset(topology, node);
-          nodes[index] = node;
+          nodes[index_] = node;
 
           sprintf(nodepath, "%s/node%u/distance", path, osnode);
-          hwloc_parse_node_distance(nodepath, nbnodes, distances[index], topology->backend_params.sysfs.root_fd);
+          hwloc_parse_node_distance(nodepath, nbnodes, distances[index_], topology->backend_params.sysfs.root_fd);
       }
 
       hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, (unsigned *) distances, (unsigned *) distance_indexes);
@@ -2215,7 +2215,7 @@
   unsigned caches_added = 0;
   hwloc_bitmap_foreach_begin(i, cpuset)
     {
-      struct hwloc_obj *socket, *core, *thread;
+      struct hwloc_obj *sock, *core, *thread;
       hwloc_bitmap_t socketset, coreset, threadset, savedcoreset;
       unsigned mysocketid, mycoreid;
 
@@ -2228,11 +2228,11 @@
       socketset = hwloc_parse_cpumap(str, topology->backend_params.sysfs.root_fd);
       if (socketset && hwloc_bitmap_first(socketset) == i) {
         /* first cpu in this socket, add the socket */
-        socket = hwloc_alloc_setup_object(HWLOC_OBJ_SOCKET, mysocketid);
-        socket->cpuset = socketset;
+        sock = hwloc_alloc_setup_object(HWLOC_OBJ_SOCKET, mysocketid);
+        sock->cpuset = socketset;
         hwloc_debug_1arg_bitmap("os socket %u has cpuset %s\n",
                      mysocketid, socketset);
-        hwloc_insert_object_by_cpuset(topology, socket);
+        hwloc_insert_object_by_cpuset(topology, sock);
         socketset = NULL; /* don't free it */
       }
       hwloc_bitmap_free(socketset);
@@ -2523,7 +2523,7 @@
 }
 
 static void
-hwloc__get_dmi_one_info(struct hwloc_topology *topology, hwloc_obj_t obj, char *sysfs_name, char *hwloc_name)
+hwloc__get_dmi_one_info(struct hwloc_topology *topology, hwloc_obj_t obj, const char *sysfs_name, const char *hwloc_name)
 {
   char sysfs_path[128];
   char dmi_line[64];

Modified: mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-bind.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-bind.c	2010-11-24 09:23:06 UTC (rev 7500)
+++ mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-bind.c	2010-11-24 09:23:21 UTC (rev 7501)
@@ -170,7 +170,8 @@
   }
 
   if (get_binding) {
-    char *s, *policystr = NULL;
+    char *s;
+    const char *policystr = NULL;
     int err;
     if (cpubind) {
       if (pid)

Modified: mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-calc.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-calc.c	2010-11-24 09:23:06 UTC (rev 7500)
+++ mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-calc.c	2010-11-24 09:23:21 UTC (rev 7501)
@@ -129,14 +129,14 @@
 	listtype = hwloc_obj_type_of_string(argv[2]);
 	if (listtype == (hwloc_obj_type_t) -1) {
 	  char *endptr;
-	  unsigned depth = strtoul(argv[2], &endptr, 0);
+	  unsigned depth_ = strtoul(argv[2], &endptr, 0);
 	  if (*endptr) {
 	    fprintf(stderr, "unrecognized list type or depth %s\n", argv[2]);
 	    usage(callname, stderr);
 	    return EXIT_SUCCESS;
 	  }
-	  listdepth = depth;
-	}
+	  listdepth = depth_;
+        }
 	argv++;
 	argc--;
 	goto next;



More information about the mpich2-commits mailing list