瀏覽代碼

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);