Browse Source

Add STARPU_WORKERS_NOBIND environment variable

Samuel Thibault 13 years ago
parent
commit
897125a8a7
3 changed files with 10 additions and 2 deletions
  1. 7 0
      doc/chapters/configuration.texi
  2. 1 2
      src/core/dependencies/cg.c
  3. 2 0
      src/core/topology.c

+ 7 - 0
doc/chapters/configuration.texi

@@ -222,6 +222,7 @@ variables.
 * STARPU_NCUDA::                Number of CUDA workers
 * STARPU_NOPENCL::              Number of OpenCL workers
 * STARPU_NGORDON::              Number of SPU workers (Cell)
+* STARPU_WORKERS_NOBIND::       Do not bind workers
 * STARPU_WORKERS_CPUID::        Bind workers to specific CPUs
 * STARPU_WORKERS_CUDAID::       Select specific CUDA devices
 * STARPU_WORKERS_OPENCLID::     Select specific OpenCL devices
@@ -253,6 +254,12 @@ OpenCL equivalent of the @code{STARPU_NCUDA} environment variable.
 
 Specify the number of SPUs that StarPU can use.
 
+@node STARPU_WORKERS_NOBIND
+@subsubsection @code{STARPU_WORKERS_NOBIND} -- Do not bind workers to specific CPUs
+
+Setting it to non-zero will prevent StarPU from binding its threads to
+CPUs. This is for instance useful when running the testsuite in parallel.
+
 @node STARPU_WORKERS_CPUID
 @subsubsection @code{STARPU_WORKERS_CPUID} -- Bind workers to specific CPUs
 

+ 1 - 2
src/core/dependencies/cg.c

@@ -36,8 +36,7 @@ void _starpu_cg_list_init(struct _starpu_cg_list *list)
 #ifdef STARPU_DYNAMIC_DEPS_SIZE
 	/* this is a small initial default value ... may be changed */
 	list->succ_list_size = 0;
-	list->succ =
-		(struct _starpu_cg **) realloc(NULL, list->succ_list_size*sizeof(struct _starpu_cg *));
+	list->succ = NULL;
 #endif
 }
 

+ 2 - 0
src/core/topology.c

@@ -643,6 +643,8 @@ static inline int _starpu_get_next_bindid(struct _starpu_machine_config *config,
 
 void _starpu_bind_thread_on_cpu(struct _starpu_machine_config *config STARPU_ATTRIBUTE_UNUSED, unsigned cpuid)
 {
+	if (starpu_get_env_number("STARPU_WORKERS_NOBIND") > 0)
+		return;
 #ifdef STARPU_HAVE_HWLOC
 	const struct hwloc_topology_support *support;