Explorar o código

cleaner choice of node

Antoine JEGO %!s(int64=4) %!d(string=hai) anos
pai
achega
2ec6c65dd2
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      mpi/src/starpu_mpi_task_insert.c

+ 9 - 2
mpi/src/starpu_mpi_task_insert.c

@@ -854,8 +854,15 @@ void starpu_mpi_redux_data_prio_tree(MPI_Comm comm, starpu_data_handle_t data_ha
 			 * 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 + data_tag%arity]; 
+			if (root_in_step) {
+				reducing_node = rank;
+			}
+			else if (step*arity + data_tag%arity < nb_contrib) { 
+				reducing_node = contributors[step*arity + data_tag%arity]; 
+			}
+			else { 
+				reducing_node = contributors[step*arity]; 
+			}
 
 			if (me == reducing_node)
 			{