浏览代码

examples/spmd/vector_scal_spmd.c: use less cpu workers to be sure parallel workers can be safely created

Nathalie Furmento 3 年之前
父节点
当前提交
ebeddfa5d8
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      examples/spmd/vector_scal_spmd.c

+ 9 - 0
examples/spmd/vector_scal_spmd.c

@@ -112,6 +112,15 @@ int main(void)
 	conf.single_combined_worker = 1;
 	conf.sched_policy_name = "pheft";
 
+	{
+		ret = starpu_init(NULL);
+		if (ret == -ENODEV) return 77;
+		conf.ncpus = starpu_cpu_worker_get_count();
+		conf.ncpus /= 2;
+		starpu_shutdown();
+	}
+
+
 	ret = starpu_init(&conf);
 	if (ret == -ENODEV) return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");