Ver código fonte

minor format fixes

Nathalie Furmento 4 anos atrás
pai
commit
081da472db

+ 9 - 13
mpi/examples/mpi_redux/mpi_redux.c

@@ -13,7 +13,7 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
- 
+
 /*
  * This example illustrates how to use the STARPU_MPI_REDUX mode
  * and compare it with the standard STARPU_REDUX.
@@ -21,7 +21,7 @@
  * In order to make this comparison salliant, the init codelet is not
  * a task that set the handle to a neutral element but rather depends
  * on the working node.
- * This is not a proper way to use a reduction pattern however it 
+ * This is not a proper way to use a reduction pattern however it
  * can be analogous to the cost/weight of each contribution.
  */
 
@@ -34,7 +34,6 @@
 #include "helper.h"
 #include <unistd.h>
 
-
 static void cl_cpu_work(void *handles[], void*arg)
 {
 	(void)arg;
@@ -46,7 +45,7 @@ static void cl_cpu_work(void *handles[], void*arg)
 	printf("%f\n",*a);
 }
 
-static struct starpu_codelet work_cl = 
+static struct starpu_codelet work_cl =
 {
 	.cpu_funcs = { cl_cpu_work },
 	.nbuffers = 2,
@@ -54,7 +53,7 @@ static struct starpu_codelet work_cl =
 	.name = "task_init"
 };
 
-static struct starpu_codelet mpi_work_cl = 
+static struct starpu_codelet mpi_work_cl =
 {
 	.cpu_funcs = { cl_cpu_work },
 	.nbuffers = 2,
@@ -71,7 +70,7 @@ static void cl_cpu_task_init(void *handles[], void*arg)
 	*a = starpu_mpi_world_rank();
 }
 
-static struct starpu_codelet task_init_cl = 
+static struct starpu_codelet task_init_cl =
 {
 	.cpu_funcs = { cl_cpu_task_init },
 	.nbuffers = 1,
@@ -89,7 +88,7 @@ static void cl_cpu_task_red(void *handles[], void*arg)
 	*ad = *ad + *as;
 }
 
-static struct starpu_codelet task_red_cl = 
+static struct starpu_codelet task_red_cl =
 {
 	.cpu_funcs = { cl_cpu_task_red },
 	.nbuffers = 2,
@@ -113,7 +112,7 @@ int main(int argc, char *argv[])
        		return STARPU_TEST_SKIPPED;
 	}
 	starpu_mpi_comm_size(MPI_COMM_WORLD, &comm_size);
-	if (comm_size< 2)
+	if (comm_size < 2)
 	{
         	FPRINTF(stderr, "We need at least 2 nodes.\n");
         	starpu_mpi_shutdown();
@@ -159,7 +158,7 @@ int main(int argc, char *argv[])
 		starpu_mpi_data_register(a_h, tag++, 0);
 		for (j=0;j<comm_size;j++)
 			starpu_mpi_data_register(b_h[j], tag++, j);
-		
+
 		starpu_data_set_reduction_methods(a_h, &task_red_cl, &task_init_cl);
 		starpu_fxt_start_profiling();
 		for (work_node=1; work_node < comm_size;work_node++)
@@ -185,7 +184,7 @@ int main(int argc, char *argv[])
 		starpu_mpi_redux_data(MPI_COMM_WORLD, a_h);
 		starpu_mpi_wait_for_all(MPI_COMM_WORLD);
 		starpu_mpi_barrier(MPI_COMM_WORLD);
-		if (comm_rank == 0) 
+		if (comm_rank == 0)
 		{
 			double tmp = 0.0;
 			for (work_node = 1; work_node < comm_size ; work_node++)
@@ -200,6 +199,3 @@ int main(int argc, char *argv[])
 	starpu_mpi_shutdown();
 	return 0;
 }
-
-
-

+ 3 - 3
mpi/src/starpu_mpi_task_insert.c

@@ -630,7 +630,7 @@ int _starpu_mpi_task_postbuild_v(MPI_Comm comm, int xrank, int do_execute, struc
 			}
 			else if (me == xrank)
 				mpi_data->redux_map = REDUX_CONTRIB;
-		} 
+		}
 		_starpu_mpi_exchange_data_after_execution(descrs[i].handle, descrs[i].mode, me, xrank, do_execute, prio, comm);
 		_starpu_mpi_clear_data_after_execution(descrs[i].handle, descrs[i].mode, me, do_execute);
 	}
@@ -938,8 +938,8 @@ void starpu_mpi_redux_data_prio(MPI_Comm comm, starpu_data_handle_t data_handle,
 	{
 		_STARPU_MPI_DEBUG(5, "I am not in the map of %d, I am %d ...\n", rank, me);
 	}
-	if (mpi_data->redux_map != NULL) 
-	{ 
+	if (mpi_data->redux_map != NULL)
+	{
 		_STARPU_MPI_DEBUG(100, "waiting for redux tasks with %d\n", rank);
 		starpu_task_wait_for_all();
 	}

+ 10 - 10
src/util/starpu_task_insert_utils.c

@@ -100,7 +100,7 @@ void starpu_codelet_pick_arg(struct starpu_codelet_pack_arg_data *state, void **
 {
 	memcpy((void*)size, state->arg_buffer+state->current_offset, sizeof(*size));
 	state->current_offset += sizeof(*size);
-	
+
 	*ptr = state->arg_buffer+state->current_offset;
 	state->current_offset += *size;
 
@@ -116,7 +116,7 @@ void starpu_codelet_unpack_discard_arg(struct starpu_codelet_pack_arg_data *stat
 {
 	size_t ptr_size;
 	memcpy((void *)&ptr_size, state->arg_buffer+state->current_offset, sizeof(ptr_size));
-	
+
 	state->current_offset += sizeof(ptr_size);
 	state->current_offset += ptr_size;
 
@@ -369,24 +369,24 @@ void starpu_task_insert_data_process_arg(struct starpu_codelet *cl, struct starp
 
 	starpu_task_insert_data_make_room(cl, task, allocated_buffers, *current_buffer, 1);
 	STARPU_TASK_SET_HANDLE(task, handle, *current_buffer);
-	
+
 	enum starpu_data_access_mode arg_mode = (enum starpu_data_access_mode) arg_type & ~STARPU_SSEND;
 
-	/* MPI_REDUX should be interpreted as RW|COMMUTE by the "ground" StarPU layer.*/ 
-	if (arg_mode & STARPU_MPI_REDUX) 
+	/* MPI_REDUX should be interpreted as RW|COMMUTE by the "ground" StarPU layer.*/
+	if (arg_mode & STARPU_MPI_REDUX)
 	{
 		arg_mode = STARPU_RW|STARPU_COMMUTE;
 	}
-	if (cl->nbuffers == STARPU_VARIABLE_NBUFFERS || (cl->nbuffers > STARPU_NMAXBUFS && !cl->dyn_modes)) 
-	{ 
+	if (cl->nbuffers == STARPU_VARIABLE_NBUFFERS || (cl->nbuffers > STARPU_NMAXBUFS && !cl->dyn_modes))
+	{
 		STARPU_TASK_SET_MODE(task, arg_mode,* current_buffer);
 	}
 	else if (STARPU_CODELET_GET_MODE(cl, *current_buffer))
 	{
 		STARPU_ASSERT_MSG(STARPU_CODELET_GET_MODE(cl, *current_buffer) == arg_mode,
-			"The codelet <%s> defines the access mode %d for the buffer %d which is different from the mode %d given to starpu_task_insert\n",
-			cl->name, STARPU_CODELET_GET_MODE(cl, *current_buffer),
-			*current_buffer, arg_mode);
+				  "The codelet <%s> defines the access mode %d for the buffer %d which is different from the mode %d given to starpu_task_insert\n",
+				  cl->name, STARPU_CODELET_GET_MODE(cl, *current_buffer),
+				  *current_buffer, arg_mode);
 	}
 	else
 	{