Browse Source

minor fixes following coding conventions w.r.t braces

Nathalie Furmento 7 years ago
parent
commit
3278b7715f

+ 2 - 1
mpi/src/nmad/starpu_mpi_nmad.c

@@ -518,7 +518,8 @@ static void *_starpu_mpi_progress_thread_func(void *arg)
 		int err=0;
 		int err=0;
 
 
 		if(running || pending_request>0)
 		if(running || pending_request>0)
-		{/* shall we block ? */
+		{
+			/* shall we block ? */
 			err = starpu_sem_wait(&callback_sem);
 			err = starpu_sem_wait(&callback_sem);
 			//running pending_request can change while waiting
 			//running pending_request can change while waiting
 		}
 		}

+ 5 - 3
mpi/src/starpu_mpi.c

@@ -2,7 +2,7 @@
  *
  *
  * Copyright (C) 2012-2013,2016-2017                      Inria
  * Copyright (C) 2012-2013,2016-2017                      Inria
  * Copyright (C) 2009-2018                                Université de Bordeaux
  * Copyright (C) 2009-2018                                Université de Bordeaux
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2018                                CNRS
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -41,7 +41,8 @@
 #include <mpi/starpu_mpi_tag.h>
 #include <mpi/starpu_mpi_tag.h>
 #endif
 #endif
 
 
-static void _starpu_mpi_isend_irecv_common(struct _starpu_mpi_req *req, enum starpu_data_access_mode mode, int sequential_consistency) {
+static void _starpu_mpi_isend_irecv_common(struct _starpu_mpi_req *req, enum starpu_data_access_mode mode, int sequential_consistency)
+{
 	/* Asynchronously request StarPU to fetch the data in main memory: when
 	/* Asynchronously request StarPU to fetch the data in main memory: when
 	 * it is available in main memory, _starpu_mpi_submit_ready_request(req) is called and
 	 * it is available in main memory, _starpu_mpi_submit_ready_request(req) is called and
 	 * the request is actually submitted */
 	 * the request is actually submitted */
@@ -260,7 +261,8 @@ void _starpu_mpi_data_clear(starpu_data_handle_t data_handle)
 	data_handle->mpi_data = NULL;
 	data_handle->mpi_data = NULL;
 }
 }
 
 
-struct _starpu_mpi_data *_starpu_mpi_data_get(starpu_data_handle_t data_handle) {
+struct _starpu_mpi_data *_starpu_mpi_data_get(starpu_data_handle_t data_handle)
+{
 	struct _starpu_mpi_data *mpi_data = data_handle->mpi_data;
 	struct _starpu_mpi_data *mpi_data = data_handle->mpi_data;
 	if (mpi_data)
 	if (mpi_data)
 	{
 	{

+ 19 - 9
mpi/src/starpu_mpi_coop_sends.c

@@ -2,7 +2,7 @@
  *
  *
  * Copyright (C) 2012-2013,2016-2017                      Inria
  * Copyright (C) 2012-2013,2016-2017                      Inria
  * Copyright (C) 2009-2018                                Université de Bordeaux
  * Copyright (C) 2009-2018                                Université de Bordeaux
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2018                                CNRS
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -29,11 +29,13 @@
  */
  */
 
 
 /* This is called after a request is finished processing, to release the data */
 /* This is called after a request is finished processing, to release the data */
-void _starpu_mpi_release_req_data(struct _starpu_mpi_req *req) {
+void _starpu_mpi_release_req_data(struct _starpu_mpi_req *req)
+{
 	if (!req->data_handle)
 	if (!req->data_handle)
 		return;
 		return;
 
 
-	if (_starpu_mpi_req_multilist_queued_coop_sends(req)) {
+	if (_starpu_mpi_req_multilist_queued_coop_sends(req))
+	{
 		struct _starpu_mpi_coop_sends *coop_sends = req->coop_sends_head;
 		struct _starpu_mpi_coop_sends *coop_sends = req->coop_sends_head;
 		struct _starpu_mpi_data *mpi_data = coop_sends->mpi_data;
 		struct _starpu_mpi_data *mpi_data = coop_sends->mpi_data;
 		int last;
 		int last;
@@ -42,12 +44,15 @@ void _starpu_mpi_release_req_data(struct _starpu_mpi_req *req) {
 		_starpu_mpi_req_multilist_erase_coop_sends(&coop_sends->reqs, req);
 		_starpu_mpi_req_multilist_erase_coop_sends(&coop_sends->reqs, req);
 		last = _starpu_mpi_req_multilist_empty_coop_sends(&coop_sends->reqs);
 		last = _starpu_mpi_req_multilist_empty_coop_sends(&coop_sends->reqs);
 		_starpu_spin_unlock(&mpi_data->coop_lock);
 		_starpu_spin_unlock(&mpi_data->coop_lock);
-		if (last) {
+		if (last)
+		{
 			/* We were last, release data */
 			/* We were last, release data */
 			starpu_data_release(req->data_handle);
 			starpu_data_release(req->data_handle);
 			free(coop_sends);
 			free(coop_sends);
 		}
 		}
-	} else {
+	}
+	else
+	{
 		/* Trivial request */
 		/* Trivial request */
 		starpu_data_release(req->data_handle);
 		starpu_data_release(req->data_handle);
 	}
 	}
@@ -95,7 +100,8 @@ static void _starpu_mpi_submit_coop_sends(void *arg)
 	/* TODO: turn them into redirects & forwards */
 	/* TODO: turn them into redirects & forwards */
 
 
 	/* And submit them */
 	/* And submit them */
-	for (i = 0; i < n; i++) {
+	for (i = 0; i < n; i++)
+	{
 		/* Prefetch next request, since once we submit cur we may not be able to read it.  */
 		/* Prefetch next request, since once we submit cur we may not be able to read it.  */
 		_STARPU_MPI_DEBUG(0, "cooperative sends %p sending to %d\n", coop_sends, reqs[i]->node_tag.rank);
 		_STARPU_MPI_DEBUG(0, "cooperative sends %p sending to %d\n", coop_sends, reqs[i]->node_tag.rank);
 		_starpu_mpi_submit_ready_request(reqs[i]);
 		_starpu_mpi_submit_ready_request(reqs[i]);
@@ -146,7 +152,8 @@ static int _starpu_mpi_coop_send_compatible(struct _starpu_mpi_req *req, struct
 	       && prevreq->sequential_consistency == req->sequential_consistency;
 	       && prevreq->sequential_consistency == req->sequential_consistency;
 }
 }
 
 
-void _starpu_mpi_coop_send(starpu_data_handle_t data_handle, struct _starpu_mpi_req *req, enum starpu_data_access_mode mode, int sequential_consistency) {
+void _starpu_mpi_coop_send(starpu_data_handle_t data_handle, struct _starpu_mpi_req *req, enum starpu_data_access_mode mode, int sequential_consistency)
+{
 	struct _starpu_mpi_data *mpi_data = _starpu_mpi_data_get(data_handle);
 	struct _starpu_mpi_data *mpi_data = _starpu_mpi_data_get(data_handle);
 	struct _starpu_mpi_coop_sends *coop_sends = NULL, *tofree = NULL;
 	struct _starpu_mpi_coop_sends *coop_sends = NULL, *tofree = NULL;
 	int done = 0, queue, first = 1;
 	int done = 0, queue, first = 1;
@@ -174,7 +181,9 @@ void _starpu_mpi_coop_send(starpu_data_handle_t data_handle, struct _starpu_mpi_
 				req->coop_sends_head = coop_sends;
 				req->coop_sends_head = coop_sends;
 				first = 0;
 				first = 0;
 				done = 1;
 				done = 1;
-			} else {
+			}
+			else
+			{
 				/* Nope, incompatible, put ours instead */
 				/* Nope, incompatible, put ours instead */
 				_STARPU_MPI_DEBUG(0, "%p: new cooperative sends %p, dest %d\n", data_handle, coop_sends, req->node_tag.rank);
 				_STARPU_MPI_DEBUG(0, "%p: new cooperative sends %p, dest %d\n", data_handle, coop_sends, req->node_tag.rank);
 				mpi_data->coop_sends = coop_sends;
 				mpi_data->coop_sends = coop_sends;
@@ -211,7 +220,8 @@ void _starpu_mpi_coop_send(starpu_data_handle_t data_handle, struct _starpu_mpi_
 	/* In case we created one for nothing after all */
 	/* In case we created one for nothing after all */
 	free(tofree);
 	free(tofree);
 
 
-	if (first) {
+	if (first)
+	{
 		/* We were first, we are responsible for acquiring the data for everybody */
 		/* We were first, we are responsible for acquiring the data for everybody */
 		starpu_data_acquire_on_node_cb_sequential_consistency_sync_jobids(req->data_handle, STARPU_MAIN_RAM, mode, _starpu_mpi_submit_coop_sends, coop_sends, sequential_consistency, &req->pre_sync_jobid, NULL);
 		starpu_data_acquire_on_node_cb_sequential_consistency_sync_jobids(req->data_handle, STARPU_MAIN_RAM, mode, _starpu_mpi_submit_coop_sends, coop_sends, sequential_consistency, &req->pre_sync_jobid, NULL);
 	}
 	}

+ 3 - 2
src/datawizard/coherency.c

@@ -2,7 +2,7 @@
  *
  *
  * Copyright (C) 2011-2014,2017                           Inria
  * Copyright (C) 2011-2014,2017                           Inria
  * Copyright (C) 2008-2017                                Université de Bordeaux
  * Copyright (C) 2008-2017                                Université de Bordeaux
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2018                                CNRS
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -366,7 +366,8 @@ static int determine_request_path(starpu_data_handle_t handle,
 		return 1;
 		return 1;
 	}
 	}
 
 
-	if (src_node < 0) {
+	if (src_node < 0)
+	{
 		/* Will just initialize the destination */
 		/* Will just initialize the destination */
 		STARPU_ASSERT(max_len >= 1);
 		STARPU_ASSERT(max_len >= 1);
 		src_nodes[0] = src_node; // ignored
 		src_nodes[0] = src_node; // ignored

+ 3 - 3
src/datawizard/copy_driver.c

@@ -2,7 +2,7 @@
  *
  *
  * Copyright (C) 2011-2013,2016-2017                      Inria
  * Copyright (C) 2011-2013,2016-2017                      Inria
  * Copyright (C) 2008-2017                                Université de Bordeaux
  * Copyright (C) 2008-2017                                Université de Bordeaux
- * Copyright (C) 2010-2011,2013,2015-2017                 CNRS
+ * Copyright (C) 2010-2011,2013,2015-2018                 CNRS
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -72,7 +72,7 @@ void _starpu_wake_all_blocked_workers_on_node(unsigned nodeid)
 		if (condition->cond == &condition->worker->sched_cond)
 		if (condition->cond == &condition->worker->sched_cond)
 		{
 		{
 			condition->worker->state_keep_awake = 1;
 			condition->worker->state_keep_awake = 1;
-		} 
+		}
 		STARPU_PTHREAD_COND_BROADCAST(condition->cond);
 		STARPU_PTHREAD_COND_BROADCAST(condition->cond);
 		STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(&condition->worker->sched_mutex);
 		STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(&condition->worker->sched_mutex);
 	}
 	}
@@ -603,7 +603,7 @@ static int copy_data_1_to_1_generic(starpu_data_handle_t handle,
 				req->async_channel.event.disk_event.size = size;
 				req->async_channel.event.disk_event.size = size;
 				req->async_channel.event.disk_event.handle = handle;
 				req->async_channel.event.disk_event.handle = handle;
 			}
 			}
-			
+
 			STARPU_ASSERT(ret == 0 || ret == -EAGAIN);
 			STARPU_ASSERT(ret == 0 || ret == -EAGAIN);
 		}
 		}
 		break;
 		break;

+ 18 - 9
src/datawizard/filters.c

@@ -4,7 +4,7 @@
  * Copyright (C) 2011-2012,2016-2017                      Inria
  * Copyright (C) 2011-2012,2016-2017                      Inria
  * Copyright (C) 2008-2017                                Université de Bordeaux
  * Copyright (C) 2008-2017                                Université de Bordeaux
  * Copyright (C) 2010                                     Mehdi Juhoor
  * Copyright (C) 2010                                     Mehdi Juhoor
- * Copyright (C) 2010-2013,2015-2017                      CNRS
+ * Copyright (C) 2010-2013,2015-2018                      CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2013                                     Thibaut Lambert
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * StarPU is free software; you can redistribute it and/or modify
@@ -640,7 +640,8 @@ void starpu_data_partition_clean(starpu_data_handle_t root_handle, unsigned npar
 {
 {
 	unsigned i;
 	unsigned i;
 
 
-	if (children[0]->active) {
+	if (children[0]->active)
+	{
 #ifdef STARPU_DEVEL
 #ifdef STARPU_DEVEL
 #warning FIXME: better choose gathering node
 #warning FIXME: better choose gathering node
 #endif
 #endif
@@ -699,7 +700,8 @@ void starpu_data_partition_readonly_submit(starpu_data_handle_t initial_handle,
 	STARPU_ASSERT_MSG(initial_handle->partitioned == 0 || initial_handle->readonly, "One can't submit a readonly partition planning at the same time as a readwrite partition planning");
 	STARPU_ASSERT_MSG(initial_handle->partitioned == 0 || initial_handle->readonly, "One can't submit a readonly partition planning at the same time as a readwrite partition planning");
 	initial_handle->partitioned++;
 	initial_handle->partitioned++;
 	initial_handle->readonly = 1;
 	initial_handle->readonly = 1;
-	if (initial_handle->nactive_readonly_children < initial_handle->partitioned) {
+	if (initial_handle->nactive_readonly_children < initial_handle->partitioned)
+	{
 		_STARPU_REALLOC(initial_handle->active_readonly_children, initial_handle->partitioned * sizeof(initial_handle->active_readonly_children[0]));
 		_STARPU_REALLOC(initial_handle->active_readonly_children, initial_handle->partitioned * sizeof(initial_handle->active_readonly_children[0]));
 		initial_handle->nactive_readonly_children = initial_handle->partitioned;
 		initial_handle->nactive_readonly_children = initial_handle->partitioned;
 	}
 	}
@@ -758,16 +760,21 @@ void starpu_data_unpartition_submit(starpu_data_handle_t initial_handle, unsigne
 	STARPU_ASSERT_MSG(gather_node == initial_handle->home_node || gather_node == -1, "gathering node different from home node is currently not supported");
 	STARPU_ASSERT_MSG(gather_node == initial_handle->home_node || gather_node == -1, "gathering node different from home node is currently not supported");
 	_starpu_spin_lock(&initial_handle->header_lock);
 	_starpu_spin_lock(&initial_handle->header_lock);
 	STARPU_ASSERT_MSG(initial_handle->partitioned >= 1, "No partition planning is active for this handle");
 	STARPU_ASSERT_MSG(initial_handle->partitioned >= 1, "No partition planning is active for this handle");
-	if (initial_handle->readonly) {
+	if (initial_handle->readonly)
+	{
 		/* Replace this children set with the last set in the list of readonly children sets */
 		/* Replace this children set with the last set in the list of readonly children sets */
-		for (i = 0; i < initial_handle->partitioned-1; i++) {
-			if (initial_handle->active_readonly_children[i] == children[0]->siblings) {
+		for (i = 0; i < initial_handle->partitioned-1; i++)
+		{
+			if (initial_handle->active_readonly_children[i] == children[0]->siblings)
+			{
 				initial_handle->active_readonly_children[i] = initial_handle->active_readonly_children[initial_handle->partitioned-1];
 				initial_handle->active_readonly_children[i] = initial_handle->active_readonly_children[initial_handle->partitioned-1];
 				initial_handle->active_readonly_children[initial_handle->partitioned-1] = NULL;
 				initial_handle->active_readonly_children[initial_handle->partitioned-1] = NULL;
 				break;
 				break;
 			}
 			}
 		}
 		}
-	} else {
+	}
+	else
+	{
 		initial_handle->active_children = NULL;
 		initial_handle->active_children = NULL;
 	}
 	}
 	initial_handle->partitioned--;
 	initial_handle->partitioned--;
@@ -839,12 +846,14 @@ void starpu_data_unpartition_submit_r(starpu_data_handle_t ancestor, int gatheri
 	{
 	{
 		unsigned n = ancestor->partitioned;
 		unsigned n = ancestor->partitioned;
 		/* Uh, has to go through all read-only partitions */
 		/* Uh, has to go through all read-only partitions */
-		for (i = 0; i < n; i++) {
+		for (i = 0; i < n; i++)
+		{
 			/* Note: active_readonly_children is emptied by starpu_data_unpartition_submit calls */
 			/* Note: active_readonly_children is emptied by starpu_data_unpartition_submit calls */
 			starpu_data_handle_t *children = ancestor->active_readonly_children[0];
 			starpu_data_handle_t *children = ancestor->active_readonly_children[0];
 			_STARPU_DEBUG("unpartition readonly children %p etc.\n", children[0]);
 			_STARPU_DEBUG("unpartition readonly children %p etc.\n", children[0]);
 			nsiblings = children[0]->nsiblings;
 			nsiblings = children[0]->nsiblings;
-			for (j = 0; j < nsiblings; j++) {
+			for (j = 0; j < nsiblings; j++)
+			{
 				/* Make sure our children are unpartitioned */
 				/* Make sure our children are unpartitioned */
 				starpu_data_unpartition_submit_r(children[j], gathering_node);
 				starpu_data_unpartition_submit_r(children[j], gathering_node);
 			}
 			}

+ 3 - 2
src/debug/traces/starpu_fxt.c

@@ -2,7 +2,7 @@
  *
  *
  * Copyright (C) 2011-2017                                Inria
  * Copyright (C) 2011-2017                                Inria
  * Copyright (C) 2013                                     Joris Pablo
  * Copyright (C) 2013                                     Joris Pablo
- * Copyright (C) 2012-2017                                CNRS
+ * Copyright (C) 2012-2018                                CNRS
  * Copyright (C) 2017                                     Universidade Federal do Rio Grande do Sul (UFRGS)
  * Copyright (C) 2017                                     Universidade Federal do Rio Grande do Sul (UFRGS)
  * Copyright (C) 2009-2017                                Université de Bordeaux
  * Copyright (C) 2009-2017                                Université de Bordeaux
  *
  *
@@ -3745,7 +3745,8 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 		for (i = 0; i < STARPU_NMAXWORKERS; i++)
 		for (i = 0; i < STARPU_NMAXWORKERS; i++)
 		{
 		{
 			struct _starpu_computation *comp = ongoing_computation[i];
 			struct _starpu_computation *comp = ongoing_computation[i];
-			if (comp) {
+			if (comp)
+			{
 				STARPU_ASSERT(!comp->peer);
 				STARPU_ASSERT(!comp->peer);
 				_starpu_computation_list_erase(&computation_list, comp);
 				_starpu_computation_list_erase(&computation_list, comp);
 			}
 			}

+ 4 - 2
src/util/starpu_task_insert_utils.c

@@ -735,8 +735,10 @@ int _fstarpu_task_insert_create(struct starpu_codelet *cl, struct starpu_task *t
 		}
 		}
 	}
 	}
 
 
-	if (state.nargs) {
-		if (task->cl_arg != NULL) {
+	if (state.nargs)
+	{
+		if (task->cl_arg != NULL)
+		{
 			_STARPU_DISP("Parameters STARPU_CL_ARGS and STARPU_VALUE cannot be used in the same call\n");
 			_STARPU_DISP("Parameters STARPU_CL_ARGS and STARPU_VALUE cannot be used in the same call\n");
 			free(state.arg_buffer);
 			free(state.arg_buffer);
 			return -EINVAL;
 			return -EINVAL;