소스 검색

use tag to switch the reducer at each step

Antoine JEGO 3 년 전
부모
커밋
85987d4cb8
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      mpi/src/starpu_mpi_task_insert.c

+ 6 - 1
mpi/src/starpu_mpi_task_insert.c

@@ -811,6 +811,10 @@ void starpu_mpi_redux_data_prio_tree(MPI_Comm comm, starpu_data_handle_t data_ha
 	{
 		arity = nb_contrib;
 	}
+	if (arity < 2)
+	{
+		_STARPU_ERROR("StarPU can only operate an inter-node reduction on a tree with at least two nodes.\n");
+	}
 	_STARPU_MPI_DEBUG(5, "There is %d contributors\n", nb_contrib);
 	int contributors[nb_contrib];
 	int reducing_node;
@@ -852,9 +856,10 @@ void starpu_mpi_redux_data_prio_tree(MPI_Comm comm, starpu_data_handle_t data_ha
 			 * with the lowest id reduces the step : we could agree on another
 			 * node to better load balance in the case of multiple reductions involving
 			 * the same sets of nodes 
+			 * FIX: We chose to use the tag%arity-th contributor in the step 
 			 */
 			if (root_in_step) reducing_node = rank;
-			else reducing_node = contributors[step*arity]; 
+			else reducing_node = contributors[step*arity + data_tag%arity]; 
 
 			if (me == reducing_node)
 			{