Bladeren bron

Add STARPU_LIMIT_CPU_NUMA_MEM environment variable.

Samuel Thibault 5 jaren geleden
bovenliggende
commit
23cfba50f1
3 gewijzigde bestanden met toevoegingen van 15 en 0 verwijderingen
  1. 1 0
      ChangeLog
  2. 12 0
      doc/doxygen/chapters/501_environment_variables.doxy
  3. 2 0
      src/core/topology.c

+ 1 - 0
ChangeLog

@@ -48,6 +48,7 @@ Small features:
     them from starpu_interface_copy2d and 3d.
   * New function starpu_task_watchdog_set_hook to specify a function
     to be called when the watchdog is raised
+  * Add STARPU_LIMIT_CPU_NUMA_MEM environment variable.
 
 StarPU 1.3.3 (git revision 11afc5b007fe1ab1c729b55b47a5a98ef7f3cfad)
 ====================================================================

+ 12 - 0
doc/doxygen/chapters/501_environment_variables.doxy

@@ -956,6 +956,18 @@ Specify the maximum number of megabytes that should be
 available to the application on the NUMA node with the OS identifier <c>devid</c>.
 </dd>
 
+<dt>STARPU_LIMIT_CPU_NUMA_MEM</dt>
+<dd>
+\anchor STARPU_LIMIT_CPU_NUMA_MEM
+\addindex __env__STARPU_LIMIT_CPU_NUMA_MEM
+Specify the maximum number of megabytes that should be available to the
+application on each NUMA node. This is the same as specifying that same amount
+with \ref STARPU_LIMIT_CPU_NUMA_devid_MEM for each NUMA node number. The total
+memory available to StarPU will thus be this amount multiplied by the number of
+NUMA nodes used by StarPU. Any \ref STARPU_LIMIT_CPU_NUMA_devid_MEM additionally
+specified will take over STARPU_LIMIT_CPU_NUMA_MEM.
+</dd>
+
 <dt>STARPU_MINIMUM_AVAILABLE_MEM</dt>
 <dd>
 \anchor STARPU_MINIMUM_AVAILABLE_MEM

+ 2 - 0
src/core/topology.c

@@ -2113,6 +2113,8 @@ static size_t _starpu_cpu_get_global_mem_size(int nodeid, struct _starpu_machine
 #endif
 			snprintf(name, sizeof(name), "STARPU_LIMIT_CPU_NUMA_%d_MEM", obj->os_index);
 			limit = starpu_get_env_number(name);
+			if (limit == -1)
+				limit = starpu_get_env_number("STARPU_LIMIT_CPU_NUMA_MEM");
 		}
 	}
 	else