ソースを参照

port r14823 from 1.2: Fix test on machines which less than 6 cpus

Samuel Thibault 10 年 前
コミット
af47991240
共有1 個のファイルを変更した4 個の追加1 個の削除を含む
  1. 4 1
      examples/worker_collections/worker_tree_example.c

+ 4 - 1
examples/worker_collections/worker_tree_example.c

@@ -80,7 +80,10 @@ int main()
 //		FPRINTF(stderr, "pu = %d out of %d workers \n", pu, co->nworkers);
 	}
 
-	for(i = 0; i < 6; i++)
+	int six = 6;
+	if (six < ncpus)
+		six = ncpus/2;
+	for(i = 0; i < six; i++)
 	{
 		co->remove(co, i);
 //		FPRINTF(stderr, "remove %d out of %d workers\n", i, co->nworkers);