Forráskód Böngészése

don't throw error if one contributor with a 1-ary tree

Antoine JEGO 4 éve
szülő
commit
fc68d9e53e
1 módosított fájl, 4 hozzáadás és 4 törlés
  1. 4 4
      mpi/src/starpu_mpi_task_insert.c

+ 4 - 4
mpi/src/starpu_mpi_task_insert.c

@@ -790,10 +790,6 @@ void starpu_mpi_redux_data_prio_tree(MPI_Comm comm, starpu_data_handle_t data_ha
 	{
 		_STARPU_ERROR("StarPU needs to be told the MPI tag of this data, using starpu_mpi_data_register\n");
 	}
-	if (arity < 2)
-	{
-		_STARPU_ERROR("StarPU reduction tree should be at least a binary tree for a reduction to take place.\n");
-	}
 
 	starpu_mpi_comm_rank(comm, &me);
 	starpu_mpi_comm_size(comm, &nb_nodes);
@@ -811,6 +807,10 @@ void starpu_mpi_redux_data_prio_tree(MPI_Comm comm, starpu_data_handle_t data_ha
 		_STARPU_MPI_DEBUG(5, "mpi_data->redux_map[%d] = %d\n", i, mpi_data->redux_map[i]);
 		if (mpi_data->redux_map[i]) nb_contrib++;
 	}
+	if (arity < 2 || (arity==1 && nb_contrib == 1))
+	{
+		_STARPU_ERROR("StarPU reduction tree should be at least a binary tree for a reduction to take place.\n");
+	}
 	_STARPU_MPI_DEBUG(5, "There is %d contributors\n", nb_contrib);
 	int contributors[nb_contrib];
 	int reducing_node;