Browse Source

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

Samuel Thibault 10 years ago
parent
commit
af47991240
1 changed files with 4 additions and 1 deletions
  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);