Browse Source

examples/worker_collections/worker_tree_example.c: skip application when no worker is found

Nathalie Furmento 11 years ago
parent
commit
adec4eb7ec
1 changed files with 6 additions and 1 deletions
  1. 6 1
      examples/worker_collections/worker_tree_example.c

+ 6 - 1
examples/worker_collections/worker_tree_example.c

@@ -30,7 +30,12 @@ int main(int argc, char **argv)
 
 int main()
 {
-	starpu_init(NULL);
+	int ret;
+
+	ret = starpu_init(NULL);
+	if (ret == -ENODEV)
+		return 77;
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	int procs[STARPU_NMAXWORKERS];
 	unsigned ncpus =  starpu_cpu_worker_get_count();