jsquy...@osl.iu.edu, le Tue 20 Oct 2009 19:59:16 -0400, a écrit : > @@ -578,6 +573,8 @@ > DIR *dir; > struct dirent *dirent; > hwloc_obj_t node; > + hwloc_obj_t nodes[nbnodes]; > + unsigned distances[nbnodes][nbnodes]; > > dir = hwloc_opendir(path, topology->backend_params.sysfs.root_fd); > if (dir) > @@ -597,9 +594,6 @@ > if (nbnodes <= 1) > return; > > - hwloc_obj_t nodes[nbnodes]; > - unsigned distances[nbnodes][nbnodes]; > - > for (osnode=0; osnode < nbnodes; osnode++) > { > char nodepath[SYSFS_NUMA_NODE_PATH_LEN];
This will not work: nbnodes is only known here, not at the beginning of the function. > @@ -213,6 +214,9 @@ > unsigned groupids[nbobjs]; > int nbgroups; > unsigned i,j; > + hwloc_obj_t groupobjs[nbgroups]; > + unsigned groupsizes[nbgroups]; > + unsigned groupdistances[nbgroups][nbgroups]; > > hwloc_debug("trying to group %s objects into misc objects according to > physical distances\n", > hwloc_obj_type_string(objs[0]->type)); > @@ -233,8 +237,6 @@ > } > > /* create new misc objects and record their size */ > - hwloc_obj_t groupobjs[nbgroups]; > - unsigned groupsizes[nbgroups]; > memset(groupsizes, 0, sizeof(groupsizes)); > for(i=0; i<nbgroups; i++) { > /* create the misc object */ > @@ -255,7 +257,6 @@ > } > > /* factorize distances */ > - unsigned groupdistances[nbgroups][nbgroups]; > memset(groupdistances, 0, sizeof(groupdistances)); > for(i=0; i<nbobjs; i++) > for(j=0; j<nbobjs; j++) Same here. Samuel