Forráskód Böngészése

support unbound ranges for STARPU_WORKERS_CPUID

Samuel Thibault 9 éve
szülő
commit
714329c797
1 módosított fájl, 11 hozzáadás és 2 törlés
  1. 11 2
      src/core/topology.c

+ 11 - 2
src/core/topology.c

@@ -598,8 +598,17 @@ _starpu_initialize_workers_bindid (struct _starpu_machine_config *config)
 						/* range of values */
 						long int endval;
 						strval++;
-						endval = strtol(strval, &endptr, 10);
-						strval = endptr;
+						if (*strval && *strval != ' ' && *strval != ',')
+						{
+							endval = strtol(strval, &endptr, 10);
+							strval = endptr;
+						}
+						else
+						{
+							endval = topology->nhwpus-1;
+							if (*strval)
+								strval++;
+						}
 						for (val++; val <= endval && i < STARPU_NMAXWORKERS-1; val++)
 						{
 							i++;