Prechádzať zdrojové kódy

bug fix: the worker list was empty

Andra Hugo 11 rokov pred
rodič
commit
4f21f8b8ca

+ 1 - 1
src/worker_collection/worker_list.c

@@ -61,7 +61,7 @@ static int list_add(struct starpu_worker_collection *workers, int worker)
 	int *workerids = (int *)workers->workerids;
 	unsigned *nworkers = &workers->nworkers;
 
-	STARPU_ASSERT(*nworkers < STARPU_NMAXWORKERS - 1);
+	STARPU_ASSERT(*nworkers < STARPU_NMAXWORKERS);
 
 	if(!_worker_belongs_to_ctx(workers, worker))
 	{

+ 2 - 0
src/worker_collection/worker_tree.c

@@ -24,6 +24,8 @@
 static unsigned tree_has_next(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
 {
 	STARPU_ASSERT(it != NULL);
+	if(workers->nworkers == 0)
+		return 0;
 
 	struct starpu_tree *tree = (struct starpu_tree*)workers->workerids;
 	struct starpu_tree *neighbour = starpu_tree_get_neighbour(tree, (struct starpu_tree*)it->value, it->visited, workers->present);