ソースを参照

tests: set STARPU_LIMIT_CPU_NUMA_MEM instead of STARPU_LIMIT_CPU_MEM when NUMA is enabled

Nathalie Furmento 5 年 前
コミット
509ccb7775
共有4 個のファイルを変更した27 個の追加9 個の削除を含む
  1. 8 3
      tests/datawizard/allocate.c
  2. 7 2
      tests/datawizard/noreclaim.c
  3. 6 2
      tests/datawizard/numa_overflow.c
  4. 6 2
      tests/disk/disk_copy.c

+ 8 - 3
tests/datawizard/allocate.c

@@ -174,12 +174,18 @@ void test_malloc()
 
 int main(void)
 {
-	int ret;
+	int ret, numa;
 	unsigned memnodes, i;
 
+	numa = starpu_get_env_number_default("STARPU_USE_NUMA", 0);
+
 	setenv("STARPU_LIMIT_CUDA_MEM", STR_LIMIT, 1);
 	setenv("STARPU_LIMIT_OPENCL_MEM", STR_LIMIT, 1);
-	setenv("STARPU_LIMIT_CPU_MEM", STR_LIMIT, 1);
+
+	if (numa == 1)
+		setenv("STARPU_LIMIT_CPU_NUMA_MEM", STR_LIMIT, 1);
+	else
+		setenv("STARPU_LIMIT_CPU_MEM", STR_LIMIT, 1);
 
         ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
@@ -208,4 +214,3 @@ int main(void)
 }
 
  #endif
-

+ 7 - 2
tests/datawizard/noreclaim.c

@@ -76,12 +76,17 @@ static void emit_empty_task(void)
 
 int main(int argc, char **argv)
 {
-	int ret;
+	int ret, numa;
 	struct starpu_conf conf;
 	starpu_data_handle_t handle;
 	void *allocated;
 
-	setenv("STARPU_LIMIT_CPU_MEM", TOTAL, 1);
+	numa = starpu_get_env_number_default("STARPU_USE_NUMA", 0);
+
+	if (numa == 1)
+		setenv("STARPU_LIMIT_CPU_NUMA_MEM", TOTAL, 1);
+	else
+		setenv("STARPU_LIMIT_CPU_MEM", TOTAL, 1);
 
 	starpu_conf_init(&conf);
 	conf.ncpus = 1;

+ 6 - 2
tests/datawizard/numa_overflow.c

@@ -64,11 +64,15 @@ int main(int argc, char **argv)
 	int ret;
 	unsigned i, j;
 	char s[16];
-	int worker;
+	int worker, numa;
 
 	snprintf(s, sizeof(s), "%u", (N*3/4)*SIZE/(1024*1024));
 	/* We make NUMA nodes not big enough for all data */
-	setenv("STARPU_LIMIT_CPU_MEM", s, 1);
+	numa = starpu_get_env_number_default("STARPU_USE_NUMA", 0);
+	if (numa == 1)
+		setenv("STARPU_LIMIT_CPU_NUMA_MEM", s, 1);
+	else
+		setenv("STARPU_LIMIT_CPU_MEM", s, 1);
 
 	ret = starpu_initialize(NULL, &argc, &argv);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;

+ 6 - 2
tests/disk/disk_copy.c

@@ -54,10 +54,14 @@ int main(void)
 int dotest(struct starpu_disk_ops *ops, void *param)
 {
 	double *A,*B,*C,*D,*E,*F;
-	int ret;
+	int ret, numa;
 
 	/* limit main ram to force to push in disk */
-	setenv("STARPU_LIMIT_CPU_MEM", RAM, 1);
+	numa = starpu_get_env_number_default("STARPU_USE_NUMA", 0);
+	if (numa == 1)
+		setenv("STARPU_LIMIT_CPU_NUMA_MEM", RAM, 1);
+	else
+		setenv("STARPU_LIMIT_CPU_MEM", RAM, 1);
 
 	/* Initialize StarPU without GPU devices to make sure the memory of the GPU devices will not be used */
 	// Ignore environment variables as we want to force the exact number of workers