Procházet zdrojové kódy

Make STARPU_WORKERS_CPUID take precedence over the configuration passed to starpu_init().

Cyril Roelandt před 13 roky
rodič
revize
6e0c988e1e
1 změnil soubory, kde provedl 8 přidání a 8 odebrání
  1. 8 8
      src/core/topology.c

+ 8 - 8
src/core/topology.c

@@ -542,14 +542,7 @@ static void _starpu_initialize_workers_bindid(struct _starpu_machine_config *con
 	 * cpus. */
 
 	/* what do we use, explicit value, env. variable, or round-robin ? */
-	if (config->user_conf && config->user_conf->use_explicit_workers_bindid)
-	{
-		/* we use the explicit value from the user */
-		memcpy(topology->workers_bindid,
-			config->user_conf->workers_bindid,
-			STARPU_NMAXWORKERS*sizeof(unsigned));
-	}
-	else if ((strval = getenv("STARPU_WORKERS_CPUID")))
+	if ((strval = getenv("STARPU_WORKERS_CPUID")))
 	{
 		/* STARPU_WORKERS_CPUID certainly contains less entries than
 		 * STARPU_NMAXWORKERS, so we reuse its entries in a round robin
@@ -588,6 +581,13 @@ static void _starpu_initialize_workers_bindid(struct _starpu_machine_config *con
 			}
 		}
 	}
+	else if (config->user_conf && config->user_conf->use_explicit_workers_bindid)
+	{
+		/* we use the explicit value from the user */
+		memcpy(topology->workers_bindid,
+			config->user_conf->workers_bindid,
+			STARPU_NMAXWORKERS*sizeof(unsigned));
+	}
 	else
 	{
 		/* by default, we take a round robin policy */