浏览代码

worker tree: Special-case when the tree is only composed of the root

Samuel Thibault 5 年之前
父节点
当前提交
14e5b6ef22
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/core/tree.c

+ 5 - 2
src/core/tree.c

@@ -1,8 +1,8 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2014,2015                                Inria
- * Copyright (C) 2014-2017, 2019                          CNRS
- * Copyright (C) 2014,2016                                Université de Bordeaux
+ * Copyright (C) 2014-2017,2019                           CNRS
+ * Copyright (C) 2014,2016,2019                           Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -112,6 +112,9 @@ struct starpu_tree* starpu_tree_get_neighbour(struct starpu_tree *tree, struct s
 
 	if (father == NULL) return NULL;
 
+	if (father == tree && father->arity == 0)
+		return tree;
+
 	for(st = 0; st < father->arity; st++)
 	{
 		if(&father->nodes[st] == node)