Przeglądaj źródła

src/ tests/ tools/: fix coding style, curly braces go on a newline

Nathalie Furmento 10 lat temu
rodzic
commit
efea5f1a8f
56 zmienionych plików z 345 dodań i 241 usunięć
  1. 3 2
      src/common/rwlock.h
  2. 4 2
      src/common/thread.c
  3. 19 10
      src/common/utils.c
  4. 3 2
      src/core/dependencies/cg.c
  5. 8 4
      src/core/dependencies/implicit_data_deps.c
  6. 3 2
      src/core/dependencies/task_deps.c
  7. 3 2
      src/core/disk.c
  8. 31 44
      src/core/disk_ops/disk_leveldb.cpp
  9. 2 1
      src/core/disk_ops/disk_unistd.c
  10. 2 1
      src/core/disk_ops/disk_unistd_o_direct.c
  11. 2 1
      src/core/disk_ops/unistd/disk_unistd_global.h
  12. 6 3
      src/core/jobs.c
  13. 3 2
      src/core/jobs.h
  14. 11 6
      src/core/perfmodel/perfmodel_bus.c
  15. 2 1
      src/core/sched_ctx.c
  16. 5 4
      src/core/sched_policy.c
  17. 8 4
      src/core/simgrid.c
  18. 4 2
      src/core/topology.c
  19. 22 10
      src/core/workers.c
  20. 2 1
      src/datawizard/coherency.c
  21. 2 1
      src/datawizard/coherency.h
  22. 3 2
      src/datawizard/copy_driver.h
  23. 3 2
      src/datawizard/data_request.c
  24. 2 1
      src/datawizard/filters.c
  25. 2 1
      src/datawizard/interfaces/data_interface.c
  26. 12 7
      src/datawizard/malloc.c
  27. 26 13
      src/datawizard/memalloc.c
  28. 6 3
      src/datawizard/memory_manager.c
  29. 3 2
      src/datawizard/memory_nodes.c
  30. 3 2
      src/datawizard/sort_data_handles.c
  31. 3 2
      src/drivers/driver_common/driver_common.c
  32. 1 2
      src/drivers/mp_common/mp_common.c
  33. 36 36
      src/drivers/mp_common/source_common.c
  34. 2 1
      src/drivers/opencl/driver_opencl_utils.c
  35. 2 1
      src/sched_policies/component_composed.c
  36. 2 2
      src/sched_policies/component_fifo.c
  37. 2 1
      src/sched_policies/component_heft.c
  38. 2 2
      src/sched_policies/component_prio.c
  39. 2 2
      src/sched_policies/component_random.c
  40. 4 2
      src/sched_policies/component_sched.c
  41. 5 3
      src/sched_policies/component_worker.c
  42. 4 2
      src/sched_policies/eager_central_priority_policy.c
  43. 3 2
      src/sched_policies/locality_work_stealing_policy.c
  44. 1 2
      src/sched_policies/scheduler_maker.c
  45. 6 5
      src/util/openmp_runtime_support.c
  46. 3 2
      tests/main/tag_task_data_deps.c
  47. 7 3
      tests/sched_policies/prio.c
  48. 10 5
      tools/dev/experimental/cpu_func_to_cpu_funcs_test.c
  49. 4 2
      tools/dev/experimental/modes/fix_cocci_output_test.c
  50. 6 3
      tools/dev/experimental/name_codelets_test.c
  51. 5 6
      tools/dev/experimental/not_unlocked_mutex_test.c
  52. 3 2
      tools/dev/experimental/remove_where_field_test.c
  53. 2 1
      tools/dev/experimental/use_starpu_unlikely_test.c
  54. 3 2
      tools/starpu_fxt_data_trace.c
  55. 3 2
      tools/starpu_fxt_tool.c
  56. 19 10
      tools/starpu_lp2paje.c

+ 3 - 2
src/common/rwlock.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -22,7 +22,8 @@
 #include <starpu.h>
 
 /* Dummy implementation of a RW-lock using a spinlock. */
-struct _starpu_rw_lock {
+struct _starpu_rw_lock
+{
 	uint32_t busy;
 	uint8_t writer;
 	uint16_t readercnt;

+ 4 - 2
src/common/thread.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -370,7 +370,9 @@ int starpu_pthread_barrier_wait(starpu_pthread_barrier_t *barrier)
 		barrier->done = 0;
 		starpu_pthread_cond_broadcast(&barrier->cond);
 		ret = STARPU_PTHREAD_BARRIER_SERIAL_THREAD;
-	} else {
+	}
+	else
+	{
 		starpu_pthread_cond_wait(&barrier->cond, &barrier->mutex);
 	}
 

+ 19 - 10
src/common/utils.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -136,12 +136,15 @@ int _starpu_frdlock(FILE *file)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
 	int ret;
-	do {
+	do
+	{
 		ret = _locking(fileno(file), _LK_RLCK, 10);
-	} while (ret == EDEADLOCK);
+	}
+	while (ret == EDEADLOCK);
 	return ret;
 #else
-	struct flock lock = {
+	struct flock lock =
+	{
 		.l_type = F_RDLCK,
 		.l_whence = SEEK_SET,
 		.l_start = 0,
@@ -159,7 +162,8 @@ int _starpu_frdunlock(FILE *file)
 #  endif
 	return _locking(fileno(file), _LK_UNLCK, 10);
 #else
-	struct flock lock = {
+	struct flock lock =
+	{
 		.l_type = F_UNLCK,
 		.l_whence = SEEK_SET,
 		.l_start = 0,
@@ -173,12 +177,15 @@ int _starpu_fwrlock(FILE *file)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
 	int ret;
-	do {
+	do
+	{
 		ret = _locking(fileno(file), _LK_LOCK, 10);
-	} while (ret == EDEADLOCK);
+	}
+	while (ret == EDEADLOCK);
 	return ret;
 #else
-	struct flock lock = {
+	struct flock lock =
+	{
 		.l_type = F_WRLCK,
 		.l_whence = SEEK_SET,
 		.l_start = 0,
@@ -220,9 +227,11 @@ char *_starpu_get_home_path(void)
 		path = getenv("HOME");
 	if (!path)
 		path = getenv("USERPROFILE");
-	if (!path) {
+	if (!path)
+	{
 		static int warn;
-		if (!warn) {
+		if (!warn)
+		{
 			warn = 1;
 			_STARPU_DISP("couldn't find a $STARPU_HOME place to put .starpu data, using /tmp\n");
 		}

+ 3 - 2
src/core/dependencies/cg.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2012, 2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2012 inria
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -163,7 +163,8 @@ void _starpu_notify_cg(struct _starpu_cg *cg)
 					/* That task has already passed tag checks,
 					 * do not do them again since the tag has been cleared! */
 					_starpu_enforce_deps_starting_from_task(j);
-				} else
+				}
+				else
 					STARPU_PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 
 

+ 8 - 4
src/core/dependencies/implicit_data_deps.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2013, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -90,7 +90,8 @@ static void _starpu_add_accessor(starpu_data_handle_t handle, struct starpu_task
 		_STARPU_DEP_DEBUG("dep ID%lu -> %p\n", handle->last_submitted_ghost_sync_id, pre_sync_task);
 	}
 
-	if (!pre_sync_task->cl) {
+	if (!pre_sync_task->cl)
+	{
 		/* Add a reference to be released in _starpu_handle_job_termination */
 		_starpu_spin_lock(&handle->header_lock);
 		handle->busy_count++;
@@ -162,7 +163,8 @@ static void _starpu_add_sync_task(starpu_data_handle_t handle, struct starpu_tas
 	handle->last_submitted_accessors.prev = &handle->last_submitted_accessors;
 	handle->last_sync_task = post_sync_task;
 
-	if (!post_sync_task->cl) {
+	if (!post_sync_task->cl)
+	{
 		/* Add a reference to be released in _starpu_handle_job_termination */
 		_starpu_spin_lock(&handle->header_lock);
 		handle->busy_count++;
@@ -252,7 +254,9 @@ struct starpu_task *_starpu_detect_implicit_data_deps_with_handle(struct starpu_
 					 * as synchronization task by making it
 					 * wait for the previous ones. */
 					_starpu_add_sync_task(handle, pre_sync_task, post_sync_task, post_sync_task);
-				} else {
+				}
+				else
+				{
 					_STARPU_DEP_DEBUG("several predecessors, adding sync task\n");
 					/* insert an empty synchronization task
 					 * which waits for the whole set,

+ 3 - 2
src/core/dependencies/task_deps.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2014  Inria
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -97,7 +97,8 @@ void _starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, s
 			STARPU_ASSERT_MSG(!dep_job->submitted || !dep_job->task->destroy || dep_job->task->detach, "Unless it is not to be destroyed automatically, a task dependencies have to be set before submission");
 			STARPU_ASSERT_MSG(dep_job->submitted != 2, "For resubmited tasks, dependencies have to be set before first re-submission");
 			STARPU_ASSERT_MSG(!dep_job->submitted || !dep_job->task->regenerate, "For regenerated tasks, dependencies have to be set before first submission");
-		} else
+		}
+		else
 			STARPU_ASSERT_MSG(dep_job->terminated <= 1, "Task dependencies have to be set before termination (terminated %u)", dep_job->terminated);
 		if (dep_job->task->regenerate)
 		{

+ 3 - 2
src/core/disk.c

@@ -36,7 +36,8 @@
 #include <profiling/profiling.h>
 #include <common/uthash.h>
 
-struct disk_register {
+struct disk_register
+{
 	unsigned node;
 	void * base;
 	struct starpu_disk_ops * functions;
@@ -272,7 +273,7 @@ int starpu_disk_test_request(struct _starpu_async_channel *async_channel)
 {
 	int position = get_location_with_node(async_channel->event.disk_event.memory_node);
 	return disk_register_list[position]->functions->test_request(async_channel->event.disk_event.backend_event);
-}	
+}
 
 void starpu_disk_free_request(struct _starpu_async_channel *async_channel)
 {

+ 31 - 44
src/core/disk_ops/disk_leveldb.cpp

@@ -32,13 +32,15 @@
 
 /* ------------------- use leveldb to write on disk -------------------  */
 
-struct starpu_leveldb_obj {
+struct starpu_leveldb_obj
+{
 	char * key;
 	size_t size;
 	starpu_pthread_mutex_t mutex;
 };
 
-struct starpu_leveldb_base {
+struct starpu_leveldb_base
+{
 	leveldb::DB* db;
 	/* if StarPU creates the leveldb */
 	bool created;
@@ -46,8 +48,7 @@ struct starpu_leveldb_base {
 
 
 /* allocation memory on disk */
-static void * 
-starpu_leveldb_alloc (void *base, size_t size)
+static void *starpu_leveldb_alloc (void *base, size_t size)
 {
 	struct starpu_leveldb_base * base_tmp = (struct starpu_leveldb_base *) base;
 	struct starpu_leveldb_obj * obj = (struct starpu_leveldb_obj *) malloc(sizeof(struct starpu_leveldb_obj));
@@ -72,8 +73,7 @@ starpu_leveldb_alloc (void *base, size_t size)
 
 
 /* free memory on disk */
-static void
-starpu_leveldb_free (void *base , void *obj, size_t size STARPU_ATTRIBUTE_UNUSED)
+static void starpu_leveldb_free (void *base , void *obj, size_t size STARPU_ATTRIBUTE_UNUSED)
 {
 	struct starpu_leveldb_obj * tmp = (struct starpu_leveldb_obj *) obj;
 	struct starpu_leveldb_base * base_tmp = (struct starpu_leveldb_base *) base;
@@ -88,8 +88,7 @@ starpu_leveldb_free (void *base , void *obj, size_t size STARPU_ATTRIBUTE_UNUSED
 
 
 /* open an existing memory on disk */
-static void * 
-starpu_leveldb_open (void *base, void *pos, size_t size)
+static void *starpu_leveldb_open (void *base, void *pos, size_t size)
 {
 	struct starpu_leveldb_obj * obj = (struct starpu_leveldb_obj *) malloc(sizeof(struct starpu_leveldb_obj));
 	STARPU_ASSERT(obj != NULL);
@@ -100,31 +99,26 @@ starpu_leveldb_open (void *base, void *pos, size_t size)
 	obj->size = size;
 
 	return (void *) obj;
-	
 }
 
-
 /* free memory without delete it */
-static void 
-starpu_leveldb_close (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, size_t size STARPU_ATTRIBUTE_UNUSED)
+static void starpu_leveldb_close (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, size_t size STARPU_ATTRIBUTE_UNUSED)
 {
 	struct starpu_leveldb_obj * tmp = (struct starpu_leveldb_obj *) obj;
 
 	STARPU_PTHREAD_MUTEX_DESTROY(&tmp->mutex);
 
 	free(tmp->key);
-	free(tmp);	
+	free(tmp);
 }
 
-
-/* in the leveldb, we are obliged to read and to write the entire data 
+/* in the leveldb, we are obliged to read and to write the entire data
  * so, we have to use buffers to have offset and size options */
-static int 
-starpu_leveldb_read (void *base, void *obj, void *buf, off_t offset, size_t size)
+static int starpu_leveldb_read (void *base, void *obj, void *buf, off_t offset, size_t size)
 {
 	struct starpu_leveldb_obj * tmp = (struct starpu_leveldb_obj *) obj;
-	struct starpu_leveldb_base * base_tmp = (struct starpu_leveldb_base *) base;	
-	
+	struct starpu_leveldb_base * base_tmp = (struct starpu_leveldb_base *) base;
+
 	STARPU_PTHREAD_MUTEX_LOCK(&tmp->mutex);
 
 	/* leveldb need a string to store datas */
@@ -143,8 +137,7 @@ starpu_leveldb_read (void *base, void *obj, void *buf, off_t offset, size_t size
 	return 0;
 }
 
-static int
-starpu_leveldb_full_read(void *base, void * obj, void ** ptr, size_t * size)
+static int starpu_leveldb_full_read(void *base, void * obj, void ** ptr, size_t * size)
 {
         struct starpu_leveldb_obj * tmp = (struct starpu_leveldb_obj *) obj;
         struct starpu_leveldb_base * base_tmp = (struct starpu_leveldb_base *) base;
@@ -169,8 +162,7 @@ starpu_leveldb_full_read(void *base, void * obj, void ** ptr, size_t * size)
 }
 
 /* write on the memory disk */
-static int 
-starpu_leveldb_write (void *base, void *obj, const void *buf, off_t offset, size_t size)
+static int starpu_leveldb_write (void *base, void *obj, const void *buf, off_t offset, size_t size)
 {
         struct starpu_leveldb_obj * tmp = (struct starpu_leveldb_obj *) obj;
         struct starpu_leveldb_base * base_tmp = (struct starpu_leveldb_base *) base;
@@ -199,12 +191,12 @@ starpu_leveldb_write (void *base, void *obj, const void *buf, off_t offset, size
 		memcpy(buffer, (void *) value_read, tmp->size);
 
 		/* put the new data on their new place */
-		memcpy(buffer, (void *) (buf_tmp+offset), size); 
+		memcpy(buffer, (void *) (buf_tmp+offset), size);
 	}
 
 	/* and write them */
 	s = base_tmp->db->Put(leveldb::WriteOptions(), tmp->key, (char *)buffer);
-	STARPU_ASSERT(s.ok());	
+	STARPU_ASSERT(s.ok());
 
 	/* if the new size is higher than the old, we update it - first write after the alloc */
 	tmp->size = (tmp->size > size) ? tmp->size : size;
@@ -215,8 +207,7 @@ starpu_leveldb_write (void *base, void *obj, const void *buf, off_t offset, size
 	return 0;
 }
 
-static int
-starpu_leveldb_full_write (void * base, void * obj, void * ptr, size_t size)
+static int starpu_leveldb_full_write (void * base, void * obj, void * ptr, size_t size)
 {
 	struct starpu_leveldb_obj * tmp = (struct starpu_leveldb_obj *) obj;
 	struct starpu_leveldb_base * base_tmp = (struct starpu_leveldb_base *) base;
@@ -234,8 +225,7 @@ starpu_leveldb_full_write (void * base, void * obj, void * ptr, size_t size)
 
 
 /* create a new copy of parameter == base */
-static void * 
-starpu_leveldb_plug (void *parameter, starpu_ssize_t size STARPU_ATTRIBUTE_UNUSED)
+static void *starpu_leveldb_plug (void *parameter, starpu_ssize_t size STARPU_ATTRIBUTE_UNUSED)
 {
 	struct starpu_leveldb_base * tmp = (struct starpu_leveldb_base *) malloc(sizeof(struct starpu_leveldb_base));
 	STARPU_ASSERT(tmp != NULL);
@@ -244,12 +234,12 @@ starpu_leveldb_plug (void *parameter, starpu_ssize_t size STARPU_ATTRIBUTE_UNUSE
 	leveldb::DB* db;
 	leveldb::Options options;
 	options.create_if_missing = true;
-	
+
 	/* try to create the database */
 	options.error_if_exists = true;
 	status = leveldb::DB::Open(options, (char *) parameter, &db);
 	tmp->created = true;
-	
+
 	/* if it has already been created  before */
 	if (!status.ok())
 	{
@@ -261,13 +251,11 @@ starpu_leveldb_plug (void *parameter, starpu_ssize_t size STARPU_ATTRIBUTE_UNUSE
 
 	tmp->db = db;
 	STARPU_ASSERT(status.ok());
-	return (void *) tmp;	
+	return (void *) tmp;
 }
 
-
 /* free memory allocated for the base */
-static void
-starpu_leveldb_unplug (void *base)
+static void starpu_leveldb_unplug (void *base)
 {
 	struct starpu_leveldb_base * base_tmp = (struct starpu_leveldb_base *) base;
 	if(base_tmp->created)
@@ -275,20 +263,17 @@ starpu_leveldb_unplug (void *base)
 	free(base);
 }
 
-
-static int
-get_leveldb_bandwidth_between_disk_and_main_ram(unsigned node)
+static int get_leveldb_bandwidth_between_disk_and_main_ram(unsigned node)
 {
-
 	unsigned iter;
 	double timing_slowness, timing_latency;
 	double start;
 	double end;
-	
-	srand (time (NULL)); 
+
+	srand (time (NULL));
 	char * buf = (char *) malloc(SIZE_DISK_MIN*sizeof(char));
 	STARPU_ASSERT(buf != NULL);
-	
+
 	/* allocate memory */
 	void * mem = _starpu_disk_alloc(node, SIZE_DISK_MIN);
 	/* fail to alloc */
@@ -332,7 +317,8 @@ get_leveldb_bandwidth_between_disk_and_main_ram(unsigned node)
 }
 
 #if __cplusplus >= 201103L
-struct starpu_disk_ops starpu_disk_leveldb_ops = {
+struct starpu_disk_ops starpu_disk_leveldb_ops =
+{
 	.plug = starpu_leveldb_plug,
 	.unplug = starpu_leveldb_unplug,
 	.bandwidth = get_leveldb_bandwidth_between_disk_and_main_ram,
@@ -354,7 +340,8 @@ struct starpu_disk_ops starpu_disk_leveldb_ops = {
 	.free_request = NULL
 };
 #else
-struct starpu_disk_ops starpu_disk_leveldb_ops = {
+struct starpu_disk_ops starpu_disk_leveldb_ops =
+{
 	starpu_leveldb_plug,
 	starpu_leveldb_unplug,
 	get_leveldb_bandwidth_between_disk_and_main_ram,

+ 2 - 1
src/core/disk_ops/disk_unistd.c

@@ -53,7 +53,8 @@ starpu_unistd_open (void *base, void *pos, size_t size)
 
 }
 
-struct starpu_disk_ops starpu_disk_unistd_ops = {
+struct starpu_disk_ops starpu_disk_unistd_ops =
+{
 	.alloc = starpu_unistd_alloc,
 	.free = starpu_unistd_global_free,
 	.open = starpu_unistd_open,

+ 2 - 1
src/core/disk_ops/disk_unistd_o_direct.c

@@ -87,7 +87,8 @@ starpu_unistd_o_direct_plug (void *parameter, starpu_ssize_t size)
 	return starpu_unistd_global_plug (parameter, size);
 }
 
-struct starpu_disk_ops starpu_disk_unistd_o_direct_ops = {
+struct starpu_disk_ops starpu_disk_unistd_o_direct_ops =
+{
 	.alloc = starpu_unistd_o_direct_alloc,
 	.free = starpu_unistd_global_free,
 	.open = starpu_unistd_o_direct_open,

+ 2 - 1
src/core/disk_ops/unistd/disk_unistd_global.h

@@ -23,7 +23,8 @@
 #define O_BINARY 0
 #endif
 
-struct starpu_unistd_global_obj {
+struct starpu_unistd_global_obj
+{
         int descriptor;
         char * path;
         size_t size;

+ 6 - 3
src/core/jobs.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2011, 2014  INRIA
  *
@@ -165,12 +165,15 @@ int _starpu_test_job_termination(struct _starpu_job *j)
 #ifdef RUNNING_ON_VALGRIND
 	{
 		int v = STARPU_PTHREAD_MUTEX_TRYLOCK(&j->sync_mutex);
-		if (v != EBUSY) {
+		if (v != EBUSY)
+		{
 			STARPU_ASSERT(v == 0);
 			int ret = (j->terminated == 2);
 			STARPU_PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 			return ret;
-		} else {
+		}
+		else
+		{
 			return 0;
 		}
 	}

+ 3 - 2
src/core/jobs.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2014  Inria
  *
@@ -56,7 +56,8 @@ typedef void (*_starpu_cl_func_t)(void **, void *);
 #define _STARPU_MIC_MAY_PERFORM(j)	((j)->task->cl->where & STARPU_MIC)
 #define _STARPU_SCC_MAY_PERFORM(j)	((j)->task->cl->where & STARPU_SCC)
 
-struct _starpu_data_descr {
+struct _starpu_data_descr
+{
 	starpu_data_handle_t handle;
 	enum starpu_data_access_mode mode;
 	int node;

+ 11 - 6
src/core/perfmodel/perfmodel_bus.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2013 Corentin Salingue
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -1697,7 +1697,8 @@ void _starpu_simgrid_get_platform_path(char *path, size_t maxlen)
 #if defined(STARPU_USE_CUDA) && HAVE_DECL_HWLOC_CUDA_GET_DEVICE_OSDEV_BY_INDEX && defined(HAVE_CUDA_MEMCPY_PEER)
 
 /* Records, for each PCI link and hub, the maximum bandwidth seen through it */
-struct pci_userdata {
+struct pci_userdata
+{
 	/* Uplink max measurement */
 	double bw_up;
 	double bw_down;
@@ -1892,7 +1893,8 @@ static void emit_pci_dev(FILE *f, struct hwloc_pcidev_attr_s *pcidev)
 static void emit_topology_bandwidths(FILE *f, hwloc_obj_t obj)
 {
 	unsigned i;
-	if (obj->userdata) {
+	if (obj->userdata)
+	{
 		struct pci_userdata *data = obj->userdata;
 
 		if (obj->type == HWLOC_OBJ_BRIDGE)
@@ -2247,7 +2249,8 @@ static void write_bus_platform_file_content(void)
 
 #if HAVE_DECL_HWLOC_CUDA_GET_DEVICE_OSDEV_BY_INDEX && defined(HAVE_CUDA_MEMCPY_PEER)
 	/* If we have enough hwloc information, write PCI bandwidths and routes */
-	if (!starpu_get_env_number_default("STARPU_PCI_FLAT", 0)) {
+	if (!starpu_get_env_number_default("STARPU_PCI_FLAT", 0))
+	{
 		hwloc_topology_t topology;
 		hwloc_topology_init(&topology);
 		hwloc_topology_set_flags(topology, HWLOC_TOPOLOGY_FLAG_IO_DEVICES | HWLOC_TOPOLOGY_FLAG_IO_BRIDGES);
@@ -2301,7 +2304,9 @@ static void write_bus_platform_file_content(void)
 
 		clean_topology(hwloc_get_root_obj(topology));
 		hwloc_topology_destroy(topology);
-	} else {
+	}
+	else
+	{
 flat_cuda:
 #else
 	{
@@ -2505,7 +2510,7 @@ void _starpu_save_bandwidth_and_latency_disk(double bandwidth_write, double band
 				latency_matrix[i][j] = 0;
 			}
 			else if (i == node) /* source == disk */
-			{			
+			{
 				latency_matrix[i][j] = (latency_write+latency_matrix[STARPU_MAIN_RAM][j]);
 			}
 			else if (j == node) /* destination == disk */

+ 2 - 1
src/core/sched_ctx.c

@@ -2177,7 +2177,8 @@ static int _starpu_sched_ctx_find_master(unsigned sched_ctx_id, int *workerids,
                         awake_workers[nawake_workers++] = workerids[w];
         }
 
-        for (i = 0 ; i < npotential_masters ; i++) {
+        for (i = 0 ; i < npotential_masters ; i++)
+	{
 		int master_is_in_section = 0;
 		//Could create a function for this. Basically searching an element in an array.
 		for (w = 0 ; w < nworkers ; w++)

+ 5 - 4
src/core/sched_policy.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2015  Université de Bordeaux
- * Copyright (C) 2010-2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010-2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -458,7 +458,8 @@ int _starpu_push_task_to_workers(struct starpu_task *task)
 		/* When a task can only be executed on a given arch and we have
 		 * only one memory node for that arch, we can systematically
 		 * prefetch before the scheduling decision. */
-		if (starpu_get_prefetch_flag()) {
+		if (starpu_get_prefetch_flag())
+		{
 			if (task->cl->where == STARPU_CPU && config->cpus_nodeid >= 0)
 				starpu_prefetch_task_input_on_node(task, config->cpus_nodeid);
 			else if (task->cl->where == STARPU_CUDA && config->cuda_nodeid >= 0)
@@ -714,7 +715,7 @@ struct _starpu_sched_ctx* _get_next_sched_ctx_to_pop_into(struct _starpu_worker
 		worker->reverse_phase[worker->pop_ctx_priority] = !worker->reverse_phase[worker->pop_ctx_priority];
 		if(are_2_priorities)
 			worker->pop_ctx_priority = !worker->pop_ctx_priority;
-	}	
+	}
 
 	unsigned first_sched_ctx = STARPU_NMAX_SCHED_CTXS;
 	for (l = worker->sched_ctx_list; l; l = l->next)
@@ -754,7 +755,7 @@ pick:
 
 	/* get tasks from the stacks of the strategy */
 	if(!task)
-	{		
+	{
 		struct _starpu_sched_ctx *sched_ctx ;
 #ifndef STARPU_NON_BLOCKING_DRIVERS
 		int been_here[STARPU_NMAX_SCHED_CTXS];

+ 8 - 4
src/core/simgrid.c

@@ -63,7 +63,8 @@ static msg_as_t __starpu_simgrid_get_as_by_name(msg_as_t root, const char *name)
 	const char *key;
 	msg_as_t as, ret;
 	dict = MSG_environment_as_get_routing_sons(root);
-	xbt_dict_foreach(dict, cursor, key, as) {
+	xbt_dict_foreach(dict, cursor, key, as)
+	{
 		if (!strcmp(MSG_environment_as_get_name(as), name))
 			return as;
 		ret = __starpu_simgrid_get_as_by_name(as, name);
@@ -105,7 +106,8 @@ int _starpu_simgrid_get_nbhosts(const char *prefix)
 	nb = xbt_dynar_length(hosts);
 
 	ret = 0;
-	for (i = 0; i < nb; i++) {
+	for (i = 0; i < nb; i++)
+	{
 		const char *name;
 		name = MSG_host_get_name(xbt_dynar_get_as(hosts, i, msg_host_t));
 		if (!strncmp(name, prefix, len))
@@ -155,7 +157,8 @@ msg_host_t _starpu_simgrid_get_host_by_worker(struct _starpu_worker *worker)
 	char *prefix;
 	char name[16];
 	msg_host_t host;
-	switch (worker->arch) {
+	switch (worker->arch)
+	{
 		case STARPU_CPU_WORKER:
 			prefix = "CPU";
 			break;
@@ -254,7 +257,8 @@ void _starpu_simgrid_init()
  * Tasks
  */
 
-struct task {
+struct task
+{
 	msg_task_t task;
 	int workerid;
 

+ 4 - 2
src/core/topology.c

@@ -374,7 +374,8 @@ _starpu_init_mic_node (struct _starpu_machine_config *config, int mic_idx,
 					    (argv ? (*argv)[0] : NULL),
 					    suffixes);
 
-	if (0 != mic_file_found) {
+	if (0 != mic_file_found)
+	{
 		fprintf(stderr, "No MIC program specified, use the environment\n"
 			"variable STARPU_MIC_SINK_PROGRAM_NAME or the environment\n"
 			"or the field 'starpu_conf.mic_sink_program_path'\n"
@@ -446,7 +447,8 @@ _starpu_init_topology (struct _starpu_machine_config *config)
 	/* Would be very odd */
 	STARPU_ASSERT(config->cpu_depth != HWLOC_TYPE_DEPTH_MULTIPLE);
 
-	if (config->cpu_depth == HWLOC_TYPE_DEPTH_UNKNOWN) {
+	if (config->cpu_depth == HWLOC_TYPE_DEPTH_UNKNOWN)
+	{
 		/* unknown, using logical procesors as fallback */
 		_STARPU_DISP("Warning: The OS did not report CPU cores. Assuming there is only one hardware thread per core.\n");
 		config->cpu_depth = hwloc_get_type_depth(topology->hwtopology,

+ 22 - 10
src/core/workers.c

@@ -324,15 +324,19 @@ int starpu_worker_can_execute_task_impl(unsigned workerid, struct starpu_task *t
 	if (!task->cl->can_execute)
 	{
 		for (i = 0; i < STARPU_MAXIMPLEMENTATIONS; i++)
-			if (_starpu_can_use_nth_implementation(arch, cl, i)) {
+			if (_starpu_can_use_nth_implementation(arch, cl, i))
+			{
 				mask |= 1U << i;
 				if (!impl_mask)
 					break;
 			}
-	} else {
+	}
+	else
+	{
 		for (i = 0; i < STARPU_MAXIMPLEMENTATIONS; i++)
 			if (_starpu_can_use_nth_implementation(arch, cl, i)
-			 && (!task->cl->can_execute || task->cl->can_execute(workerid, task, i))) {
+			 && (!task->cl->can_execute || task->cl->can_execute(workerid, task, i)))
+			{
 				mask |= 1U << i;
 				if (!impl_mask)
 					break;
@@ -358,15 +362,19 @@ int starpu_worker_can_execute_task_first_impl(unsigned workerid, struct starpu_t
 	if (!task->cl->can_execute)
 	{
 		for (i = 0; i < STARPU_MAXIMPLEMENTATIONS; i++)
-			if (_starpu_can_use_nth_implementation(arch, cl, i)) {
+			if (_starpu_can_use_nth_implementation(arch, cl, i))
+			{
 				if (nimpl)
 					*nimpl = i;
 				return 1;
 			}
-	} else {
+	}
+	else
+	{
 		for (i = 0; i < STARPU_MAXIMPLEMENTATIONS; i++)
 			if (_starpu_can_use_nth_implementation(arch, cl, i)
-			 && (!task->cl->can_execute || task->cl->can_execute(workerid, task, i))) {
+			 && (!task->cl->can_execute || task->cl->can_execute(workerid, task, i)))
+			{
 				if (nimpl)
 					*nimpl = i;
 				return 1;
@@ -1259,7 +1267,8 @@ int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
 	/* Finally, if we are a MP sink, we never leave this function. Else,
 	 * we enter an infinite event loop which listen for MP commands from
 	 * the source. */
-	if (is_a_sink) {
+	if (is_a_sink)
+	{
 		_starpu_sink_common_worker();
 
 		/* We should normally never leave the loop as we don't want to
@@ -1349,9 +1358,11 @@ void _starpu_may_pause(void)
 	/* pause_depth is just protected by a memory barrier */
 	STARPU_RMB();
 
-	if (STARPU_UNLIKELY(config.pause_depth > 0)) {
+	if (STARPU_UNLIKELY(config.pause_depth > 0))
+	{
 		STARPU_PTHREAD_MUTEX_LOCK(&pause_mutex);
-		if (config.pause_depth > 0) {
+		if (config.pause_depth > 0)
+		{
 			STARPU_PTHREAD_COND_WAIT(&pause_cond, &pause_mutex);
 		}
 		STARPU_PTHREAD_MUTEX_UNLOCK(&pause_mutex);
@@ -1380,7 +1391,8 @@ void starpu_resume()
 {
 	STARPU_PTHREAD_MUTEX_LOCK(&pause_mutex);
 	config.pause_depth -= 1;
-	if (!config.pause_depth) {
+	if (!config.pause_depth)
+	{
 		STARPU_PTHREAD_COND_BROADCAST(&pause_cond);
 	}
 	STARPU_PTHREAD_MUTEX_UNLOCK(&pause_mutex);

+ 2 - 1
src/datawizard/coherency.c

@@ -523,7 +523,8 @@ struct _starpu_data_request *_starpu_create_request_to_fetch_data(starpu_data_ha
 		/* if the data is in write only mode (and not SCRATCH or REDUX), there is no need for a source, data will be initialized by the task itself */
 		if (mode & STARPU_W)
 			dst_replicate->initialized = 1;
-		if (requesting_node == STARPU_MAIN_RAM) {
+		if (requesting_node == STARPU_MAIN_RAM)
+		{
 			/* And this is the main RAM, really no need for a
 			 * request, just allocate */
 			if (_starpu_allocate_memory_on_node(handle, dst_replicate, is_prefetch) == 0)

+ 2 - 1
src/datawizard/coherency.h

@@ -40,7 +40,8 @@ enum _starpu_cache_state
 };
 
 /* this should contain the information relative to a given data replicate  */
-struct _starpu_data_replicate {
+struct _starpu_data_replicate
+{
 	starpu_data_handle_t handle;
 
 	/* describe the actual data layout, as manipulated by data interfaces in *_interface.c */

+ 3 - 2
src/datawizard/copy_driver.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2013, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -68,7 +68,8 @@ struct _starpu_disk_async_event
 union _starpu_async_channel_event
 {
 #ifdef STARPU_SIMGRID
-	struct {
+	struct
+	{
 		unsigned finished;
 		starpu_pthread_mutex_t mutex;
 		starpu_pthread_cond_t cond;

+ 3 - 2
src/datawizard/data_request.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -103,7 +103,8 @@ static void starpu_data_request_destroy(struct _starpu_data_request *r)
 	STARPU_ASSERT(r->dst_replicate->request[node] == r);
 	r->dst_replicate->request[node] = NULL;
 
-	switch (r->async_channel.type) {
+	switch (r->async_channel.type)
+	{
 		case STARPU_DISK_RAM:
 			starpu_disk_free_request(&r->async_channel);
 			break;

+ 2 - 1
src/datawizard/filters.c

@@ -335,7 +335,8 @@ void starpu_data_unpartition(starpu_data_handle_t root_handle, unsigned gatherin
 			/* Acquire the child data on the gathering node. This will trigger collapsing the reduction */
 			ret = starpu_data_acquire_on_node(child_handle, gathering_node, STARPU_RW);
 			_starpu_unlock_post_sync_tasks(child_handle);
-		} else
+		}
+		else
 		{
 			/* Simply transfer any pending data */
 			ret = _starpu_fetch_data_on_node(child_handle, &child_handle->per_node[gathering_node], STARPU_R, 0, 0, 0, NULL, NULL);

+ 2 - 1
src/datawizard/interfaces/data_interface.c

@@ -750,7 +750,8 @@ static void _starpu_data_unregister(starpu_data_handle_t handle, unsigned cohere
 
 	/* Wait for all requests to finish (notably WT requests) */
 	STARPU_PTHREAD_MUTEX_LOCK(&handle->busy_mutex);
-	while (1) {
+	while (1)
+	{
 		/* Here helgrind would shout that this an unprotected access,
 		 * but this is actually fine: all threads who do busy_count--
 		 * are supposed to call _starpu_data_check_not_busy, which will

+ 12 - 7
src/datawizard/malloc.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2010, 2012-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -359,8 +359,9 @@ int starpu_free_flags(void *A, size_t dim, int flags)
 #ifdef STARPU_USE_SCC
 		_starpu_scc_free_shared_memory(A);
 #endif
-	} else
-	free(A);
+	}
+	else
+		free(A);
 
 #ifndef STARPU_SIMGRID
 out:
@@ -653,7 +654,8 @@ starpu_memory_unpin(void *addr STARPU_ATTRIBUTE_UNUSED, size_t size STARPU_ATTRI
 #define CHUNK_NBLOCKS (CHUNK_SIZE/CHUNK_ALLOC_MIN)
 
 /* Linked list for available segments */
-struct block {
+struct block
+{
 	int length;	/* Number of consecutive free blocks */
 	int next;	/* next free segment */
 };
@@ -771,7 +773,8 @@ starpu_malloc_on_node(unsigned dst_node, size_t size)
 		{
 			STARPU_ASSERT(block >= 0 && block <= CHUNK_NBLOCKS);
 			int length = bitmap[block].length;
-			if (length >= nblocks) {
+			if (length >= nblocks)
+			{
 
 				if (length >= 2*nblocks)
 				{
@@ -908,12 +911,14 @@ starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size)
 	{
 		/* This chunk is now empty, but avoid chunk free/alloc
 		 * ping-pong by keeping some of these.  */
-		if (nfreechunks[dst_node] >= 1) {
+		if (nfreechunks[dst_node] >= 1)
+		{
 			/* We already have free chunks, release this one */
 			_starpu_free_on_node(dst_node, chunk->base, CHUNK_SIZE);
 			_starpu_chunk_list_erase(chunks[dst_node], chunk);
 			free(chunk);
-		} else
+		}
+		else
 			nfreechunks[dst_node]++;
 	}
 	else

+ 26 - 13
src/datawizard/memalloc.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -157,7 +157,8 @@ static int lock_all_subtree(starpu_data_handle_t handle)
 	/* lock all sub-subtrees children */
 	for (child = 0; child < (int) handle->nchildren; child++)
 	{
-		if (!lock_all_subtree(starpu_data_get_child(handle, child))) {
+		if (!lock_all_subtree(starpu_data_get_child(handle, child)))
+		{
 			/* Some child is busy, abort */
 			while (--child >= 0)
 				/* Unlock what we have already uselessly locked */
@@ -359,7 +360,8 @@ static size_t do_free_mem_chunk(struct _starpu_mem_chunk *mc, unsigned node)
 	size_t size;
 	starpu_data_handle_t handle = mc->data;
 
-	if (handle) {
+	if (handle)
+	{
 		_starpu_spin_checklocked(&handle->header_lock);
 		mc->size = _starpu_data_get_size(handle);
 	}
@@ -442,7 +444,8 @@ static size_t try_to_free_mem_chunk(struct _starpu_mem_chunk *mc, unsigned node)
 			/* choose the best target */
 			target = choose_target(handle, node);
 
-			if (target != -1) {
+			if (target != -1)
+			{
 				/* Should have been avoided in our caller */
 				STARPU_ASSERT(!mc->remove_notify);
 				mc->remove_notify = &mc;
@@ -708,7 +711,8 @@ static size_t flush_memchunk_cache(unsigned node, size_t reclaim)
 	_starpu_spin_lock(&mc_lock[node]);
 	HASH_ITER(hh, mc_cache[node], entry, tmp)
 	{
-		while (!_starpu_mem_chunk_list_empty(entry->list)) {
+		while (!_starpu_mem_chunk_list_empty(entry->list))
+		{
 			mc = _starpu_mem_chunk_list_pop_front(entry->list);
 			STARPU_ASSERT(!mc->data);
 			STARPU_ASSERT(!mc->replicate);
@@ -830,7 +834,8 @@ size_t _starpu_memory_reclaim_generic(unsigned node, unsigned force, size_t recl
 	if (reclaim && !force)
 	{
 		static unsigned warned;
-		if (!warned) {
+		if (!warned)
+		{
 			if (STARPU_ATOMIC_ADD(&warned, 1) == 1)
 			{
 				char name[32];
@@ -927,18 +932,22 @@ void starpu_memchunk_tidy(unsigned node)
 			     || (_starpu_get_data_refcnt(handle, node) && handle->current_mode == STARPU_W)
 				/* REDUX, can't do anything with it, skip it */
 			     || mc->relaxed_coherency == 2
-			) {
+			)
+			{
 				_starpu_spin_unlock(&handle->header_lock);
 				continue;
 			}
 
 			/* This should have been marked as clean already */
 			STARPU_ASSERT(mc->relaxed_coherency != 1);
-			if (handle->per_node[handle->home_node].state != STARPU_INVALID) {
+			if (handle->per_node[handle->home_node].state != STARPU_INVALID)
+			{
 				/* it's actually clean */
 				mc->clean = 1;
 				mc_clean_nb[node]++;
-			} else {
+			}
+			else
+			{
 				/* MC is dirty, submit writeback */
 
 				/* MC will be clean, consider it as such */
@@ -1006,7 +1015,8 @@ void starpu_memchunk_tidy(unsigned node)
 		goto out;
 
 	static unsigned warned;
-	if (!warned) {
+	if (!warned)
+	{
 		if (STARPU_ATOMIC_ADD(&warned, 1) == 1)
 		{
 			char name[32];
@@ -1130,7 +1140,8 @@ void _starpu_request_mem_chunk_removal(starpu_data_handle_t handle, struct _star
 		struct mc_cache_entry *entry;
 		_starpu_spin_lock(&mc_lock[node]);
 		HASH_FIND(hh, mc_cache[node], &footprint, sizeof(footprint), entry);
-		if (!entry) {
+		if (!entry)
+		{
 			entry = malloc(sizeof(*entry));
 			entry->list = _starpu_mem_chunk_list_new();
 			entry->footprint = footprint;
@@ -1338,7 +1349,9 @@ void _starpu_memchunk_dirty(struct _starpu_mem_chunk *mc, unsigned node)
 			mc_clean_nb[node]++;
 			mc->clean = 1;
 		}
-	} else {
+	}
+	else
+	{
 		if (mc->clean)
 		{
 			mc_clean_nb[node]--;
@@ -1415,7 +1428,7 @@ get_better_disk_can_accept_size(starpu_data_handle_t handle, unsigned node)
 					target = i;
 					time_disk = time_tmp;
 				}
-			}	
+			}
 		}
 	}
 	return target;

+ 6 - 3
src/datawizard/memory_manager.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012-2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012-2013, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -55,10 +55,13 @@ int _starpu_memory_manager_init()
 void _starpu_memory_manager_set_global_memory_size(unsigned node, size_t size)
 {
 	STARPU_PTHREAD_MUTEX_LOCK(&lock_nodes[node]);
-	if (!global_size[node]) {
+	if (!global_size[node])
+	{
 		global_size[node] = size;
 		_STARPU_DEBUG("Global size for node %d is %ld\n", node, (long)global_size[node]);
-	} else {
+	}
+	else
+	{
 		STARPU_ASSERT(global_size[node] == size);
 	}
 	STARPU_PTHREAD_MUTEX_UNLOCK(&lock_nodes[node]);

+ 3 - 2
src/datawizard/memory_nodes.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -109,7 +109,8 @@ unsigned starpu_memory_nodes_get_count(void)
 void _starpu_memory_node_get_name(unsigned node, char *name, int size)
 {
 	const char *prefix;
-	switch (descr.nodes[node]) {
+	switch (descr.nodes[node])
+	{
 	case STARPU_CPU_RAM:
 		prefix = "RAM";
 		break;

+ 3 - 2
src/datawizard/sort_data_handles.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011, 2014  Université de Bordeaux
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -87,7 +87,8 @@ static int _starpu_compar_handles(const struct _starpu_data_descr *descrA,
 			else
 				/* Only A writes, take it first */
 				return -1;
-		} else
+		}
+		else
 			/* A doesn't write, take B before */
 			return 1;
 	}

+ 3 - 2
src/drivers/driver_common/driver_common.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2014  Inria
  *
@@ -562,7 +562,8 @@ int _starpu_get_multi_worker_task(struct _starpu_worker *workers, struct starpu_
 	struct _starpu_worker *worker = &workers[0];
 	unsigned workerid = workers[0].workerid;
 
-	if (!count && !executing) {
+	if (!count && !executing)
+	{
 		/* Didn't get a task to run and none are running, go to sleep */
 
 		/* Note: we need to keep the sched condition mutex all along the path

+ 1 - 2
src/drivers/mp_common/mp_common.c

@@ -192,8 +192,7 @@ _starpu_mp_common_node_create(enum _starpu_mp_node_kind node_kind,
 		STARPU_PTHREAD_BARRIER_INIT(&node->init_completed_barrier, NULL, node->nb_cores+1);
 
 		node->launch_workers(node);
-	}	
-
+	}
 
 	return node;
 }

+ 36 - 36
src/drivers/mp_common/source_common.c

@@ -29,24 +29,24 @@
 
 
 /* Finalize the execution of a task by a worker*/
-static int _starpu_src_common_finalize_job (struct _starpu_job *j, struct _starpu_worker *worker) 
+static int _starpu_src_common_finalize_job (struct _starpu_job *j, struct _starpu_worker *worker)
 {
 	int profiling = starpu_profiling_status_get();
 	struct timespec codelet_end;
 	_starpu_driver_end_job(worker, j, &worker->perf_arch, &codelet_end, 0,
 			profiling);
-	
+
 	int count = worker->current_rank;
 
 	/* If it's a combined worker, we check if it's the last one of his combined */
 	if(j->task_size > 1)
 	{
-		struct _starpu_combined_worker * cb_worker = _starpu_get_combined_worker_struct(worker->combined_workerid); 
+		struct _starpu_combined_worker * cb_worker = _starpu_get_combined_worker_struct(worker->combined_workerid);
 
 		STARPU_PTHREAD_MUTEX_LOCK(&cb_worker->count_mutex);
 		count = cb_worker->count--;
 		if(count == 0)
-			cb_worker->count = cb_worker->worker_size - 1; 
+			cb_worker->count = cb_worker->worker_size - 1;
 		STARPU_PTHREAD_MUTEX_UNLOCK(&cb_worker->count_mutex);
 	}
 
@@ -71,8 +71,8 @@ static int _starpu_src_common_process_completed_job(struct _starpu_worker_set *w
 {
 	int coreid;
 
-	STARPU_ASSERT(sizeof(coreid) == arg_size);	
-	
+	STARPU_ASSERT(sizeof(coreid) == arg_size);
+
 	coreid = *(int *) arg;
 
 	struct _starpu_worker *worker = &workerset->workers[coreid];
@@ -100,19 +100,19 @@ static void _starpu_src_common_pre_exec(void * arg, int arg_size)
 		struct _starpu_worker * worker = _starpu_get_worker_struct(combined_worker->combined_workerid[i]);
 		_starpu_set_local_worker_key(worker);
 		_starpu_sched_pre_exec_hook(worker->current_task);
-	}	
+	}
 }
 
 /* recv a message and handle asynchronous message
  * return 0 if the message has not been handle (it's certainly mean that it's a synchronous message)
  * return 1 if the message has been handle
  */
-static int _starpu_src_common_handle_async(const struct _starpu_mp_node *node STARPU_ATTRIBUTE_UNUSED, 
-		void * arg, int arg_size, 
+static int _starpu_src_common_handle_async(const struct _starpu_mp_node *node STARPU_ATTRIBUTE_UNUSED,
+		void * arg, int arg_size,
 		enum _starpu_mp_command answer)
 {
-	struct _starpu_worker_set * worker_set=NULL; 
-	switch(answer) 
+	struct _starpu_worker_set * worker_set=NULL;
+	switch(answer)
 	{
 		case STARPU_EXECUTION_COMPLETED:
 			worker_set = _starpu_get_worker_struct(starpu_worker_get_id())->set;
@@ -137,17 +137,17 @@ static void _starpu_src_common_handle_stored_async(struct _starpu_mp_node *node)
 	{
 		/* We pop a message and handle it */
 		struct mp_message * message = mp_message_list_pop_back(node->message_queue);
-		_starpu_src_common_handle_async(node, message->buffer, 
+		_starpu_src_common_handle_async(node, message->buffer,
 				message->size, message->type);
 		mp_message_delete(message);
 	}
 	STARPU_PTHREAD_MUTEX_UNLOCK(&node->message_queue_mutex);
 }
 
-/* Store a message if is asynchronous 
+/* Store a message if is asynchronous
  * return 1 if the message has been stored
  * return 0 if the message is unknown or synchrone */
-int _starpu_src_common_store_message(struct _starpu_mp_node *node, 
+int _starpu_src_common_store_message(struct _starpu_mp_node *node,
 		void * arg, int arg_size, enum _starpu_mp_command answer)
 {
 	struct mp_message * message = NULL;
@@ -157,8 +157,8 @@ int _starpu_src_common_store_message(struct _starpu_mp_node *node,
 		case STARPU_PRE_EXECUTION:
 			message = mp_message_new();
 			message->type = answer;
-			memcpy(message->buffer, arg, arg_size); 
-			message->size = arg_size; 
+			memcpy(message->buffer, arg, arg_size);
+			message->size = arg_size;
 
 			STARPU_PTHREAD_MUTEX_LOCK(&node->message_queue_mutex);
 			mp_message_list_push_front(node->message_queue,message);
@@ -172,7 +172,7 @@ int _starpu_src_common_store_message(struct _starpu_mp_node *node,
 }
 
 /* Store all asynchronous messages and return when a synchronous message is received */
-static enum _starpu_mp_command _starpu_src_common_wait_command_sync(struct _starpu_mp_node *node, 
+static enum _starpu_mp_command _starpu_src_common_wait_command_sync(struct _starpu_mp_node *node,
 		void ** arg, int* arg_size)
 {
 	enum _starpu_mp_command answer;
@@ -197,7 +197,7 @@ static void _starpu_src_common_recv_async(struct _starpu_mp_node * node)
 	{
 		printf("incorrect commande: unknown command or sync command");
 		STARPU_ASSERT(0);
-	}	
+	}
 }
 
 /* Handle all asynchrone message while a completed execution message from a specific worker has been receive */
@@ -205,7 +205,7 @@ static void _starpu_src_common_recv_async(struct _starpu_mp_node * node)
 {
 	enum _starpu_mp_command answer;
 
-	int completed = 0;	
+	int completed = 0;
 	/*While the waited completed execution message has not been receive*/
 	while(!completed)
 	{
@@ -214,7 +214,7 @@ static void _starpu_src_common_recv_async(struct _starpu_mp_node * node)
 		if(answer == STARPU_EXECUTION_COMPLETED)
 		{
 			int coreid;
-			STARPU_ASSERT(sizeof(coreid) == *arg_size);	
+			STARPU_ASSERT(sizeof(coreid) == *arg_size);
 			coreid = *(int *) *arg;
 			if(devid == coreid)
 				completed = 1;
@@ -275,7 +275,7 @@ int _starpu_src_common_lookup(struct _starpu_mp_node *node,
 	answer = _starpu_src_common_wait_command_sync(node, (void **) &arg,
 			&arg_size);
 
-	if (answer == STARPU_ERROR_LOOKUP) 
+	if (answer == STARPU_ERROR_LOOKUP)
 	{
 		_STARPU_DISP("Error looking up symbol %s\n", func_name);
 		return -ESPIPE;
@@ -319,11 +319,11 @@ int _starpu_src_common_execute_kernel(struct _starpu_mp_node *node,
 
 	buffer_size = sizeof(kernel) + sizeof(coreid) + sizeof(type)
 		+ sizeof(nb_interfaces) + nb_interfaces * sizeof(union _starpu_interface) + sizeof(is_parallel_task);
-	
+
 	/*if the task is parallel*/
 	if(is_parallel_task)
 	{
-		buffer_size += sizeof(cb_workerid); 
+		buffer_size += sizeof(cb_workerid);
 	}
 
 	/* If the user didn't give any cl_arg, there is no need to send it */
@@ -332,7 +332,7 @@ int _starpu_src_common_execute_kernel(struct _starpu_mp_node *node,
 		STARPU_ASSERT(cl_arg_size);
 		buffer_size += cl_arg_size;
 	}
-	
+
 	/* We give to send_command a buffer we just allocated, which contains
 	 * a pointer to the function (sink-side), core on which execute this
 	 * function (sink-side), number of interfaces we send,
@@ -395,8 +395,8 @@ int _starpu_src_common_execute_kernel(struct _starpu_mp_node *node,
 
 
 /* Get the information and call the function to send to the sink a message to execute the task*/
-static int _starpu_src_common_execute(struct _starpu_job *j, 
-		struct _starpu_worker *worker, 
+static int _starpu_src_common_execute(struct _starpu_job *j,
+		struct _starpu_worker *worker,
 		struct _starpu_mp_node * node)
 {
 	int ret;
@@ -407,7 +407,7 @@ static int _starpu_src_common_execute(struct _starpu_job *j,
 	int profiling = starpu_profiling_status_get();
 
 	STARPU_ASSERT(task);
-	if (worker->current_rank == 0) 
+	if (worker->current_rank == 0)
 	{
 		ret = _starpu_fetch_task_input(j);
 		if (ret != 0)
@@ -534,7 +534,7 @@ int _starpu_src_common_copy_sink_to_sink(const struct _starpu_mp_node *src_node,
 /* 5 functions to determine the executable to run on the device (MIC, SCC,
  * MPI).
  */
-static void _starpu_src_common_cat_3(char *final, const char *first, 
+static void _starpu_src_common_cat_3(char *final, const char *first,
 		const char *second, const char *third)
 {
 	strcpy(final, first);
@@ -642,12 +642,12 @@ int _starpu_src_common_locate_file(char *located_file_name,
 	return 1;
 }
 
-/* Send workers to the sink node 
+/* Send workers to the sink node
  */
 static void _starpu_src_common_send_workers(struct _starpu_mp_node * node, int baseworkerid, int nworkers)
-{	
+{
 	struct _starpu_machine_config *config = _starpu_get_machine_config();
-	int worker_size = sizeof(struct _starpu_worker)*nworkers;	
+	int worker_size = sizeof(struct _starpu_worker)*nworkers;
 	int combined_worker_size = STARPU_NMAX_COMBINEDWORKERS*sizeof(struct _starpu_combined_worker);
 	int msg[5];
 	msg[0] = nworkers;
@@ -657,7 +657,7 @@ static void _starpu_src_common_send_workers(struct _starpu_mp_node * node, int b
 	msg[4] = starpu_worker_get_count();
 
 	/* tell the sink node that we will send him all workers */
-	_starpu_mp_common_send_command(node, STARPU_SYNC_WORKERS, 
+	_starpu_mp_common_send_command(node, STARPU_SYNC_WORKERS,
 			&msg, sizeof(msg));
 
 	/* Send all worker to the sink node */
@@ -665,13 +665,13 @@ static void _starpu_src_common_send_workers(struct _starpu_mp_node * node, int b
 
 	/* Send all combined workers to the sink node */
 	node->dt_send(node, &config->combined_workers,combined_worker_size);
-}	
+}
 
 /* Function looping on the source node */
-void _starpu_src_common_worker(struct _starpu_worker_set * worker_set, 
-		unsigned baseworkerid, 
+void _starpu_src_common_worker(struct _starpu_worker_set * worker_set,
+		unsigned baseworkerid,
 		struct _starpu_mp_node * mp_node)
-{ 
+{
 	unsigned memnode = worker_set->workers[0].memory_node;
 	struct starpu_task **tasks = malloc(sizeof(struct starpu_task *)*worker_set->nworkers);
 

+ 2 - 1
src/drivers/opencl/driver_opencl_utils.c

@@ -273,7 +273,8 @@ int _starpu_opencl_compile_or_load_opencl_from_string(const char *opencl_program
 
 		// Create the compute program from the source buffer
 		program = clCreateProgramWithSource(context, 1, (const char **) &opencl_program_source, NULL, &err);
-		if (!program || err != CL_SUCCESS) {
+		if (!program || err != CL_SUCCESS)
+		{
 			_STARPU_DISP("Error: Failed to load program source with options %s!\n", build_options);
 			return EXIT_FAILURE;
 		}

+ 2 - 1
src/sched_policies/component_composed.c

@@ -198,7 +198,8 @@ void composed_component_deinit_data(struct starpu_sched_component * _component)
 		component->workers = NULL;
 		next = component->children ? component->children[0] : NULL;
 		starpu_sched_component_destroy(component);
-	}while(next);
+	}
+	while(next);
 	free(c);
 	_component->data = NULL;
 }

+ 2 - 2
src/sched_policies/component_fifo.c

@@ -64,7 +64,7 @@ static double fifo_estimated_load(struct starpu_sched_component * component)
 	double relative_speedup = 0.0;
 	double load;
 	if(STARPU_SCHED_COMPONENT_IS_HOMOGENEOUS(component))
-	{		
+	{
 		int first_worker = starpu_bitmap_first(component->workers_in_ctx);
 		relative_speedup = starpu_worker_get_relative_speedup(starpu_worker_get_perf_archtype(first_worker, component->tree->sched_ctx_id));
 		STARPU_PTHREAD_MUTEX_LOCK(mutex);
@@ -225,7 +225,7 @@ static int fifo_can_push(struct starpu_sched_component * component)
 		task = component->pull_task(component);
 		if(task)
 			ret = child->push_task(child,task);	
-	} 
+	}
 	if(task && ret)
 		fifo_push_local_task(component,task,1); 
 

+ 2 - 1
src/sched_policies/component_heft.c

@@ -55,7 +55,8 @@ static int heft_progress_one(struct starpu_sched_component *component)
 	}
 	STARPU_PTHREAD_MUTEX_UNLOCK(mutex);
 
-	if (!ntasks) {
+	if (!ntasks)
+	{
 		return 1;
 	}
 

+ 2 - 2
src/sched_policies/component_prio.c

@@ -83,7 +83,7 @@ static double prio_estimated_load(struct starpu_sched_component * component)
 	double relative_speedup = 0.0;
 	double load;
 	if(STARPU_SCHED_COMPONENT_IS_HOMOGENEOUS(component))
-	{		
+	{
 		int first_worker = starpu_bitmap_first(component->workers_in_ctx);
 		relative_speedup = starpu_worker_get_relative_speedup(starpu_worker_get_perf_archtype(first_worker, component->tree->sched_ctx_id));
 		STARPU_PTHREAD_MUTEX_LOCK(mutex);
@@ -247,7 +247,7 @@ static int prio_can_push(struct starpu_sched_component * component)
 		task = component->pull_task(component);
 		if(task)
 			ret = child->push_task(child,task);	
-	} 
+	}
 	if(task && ret)
 		prio_push_local_task(component,task,1); 
 

+ 2 - 2
src/sched_policies/component_random.c

@@ -72,12 +72,12 @@ static int random_push_task(struct starpu_sched_component * component, struct st
 	double random = starpu_drand48()*alpha_sum;
 	double alpha = 0.0;
 	struct starpu_sched_component * select  = NULL;
-	
+
 	for(i = 0; i < size ; i++)
 	{
 		int index = indexes_components[i];
 		if(alpha + speedup[i] >= random)
-		{	
+		{
 			select = component->children[index];
 			break;
 		}

+ 4 - 2
src/sched_policies/component_sched.c

@@ -428,7 +428,8 @@ static void starpu_sched_component_add_child(struct starpu_sched_component* comp
 	STARPU_ASSERT(component && child);
 	STARPU_ASSERT(!starpu_sched_component_is_worker(component));
 	int i;
-	for(i = 0; i < component->nchildren; i++){
+	for(i = 0; i < component->nchildren; i++)
+	{
 		STARPU_ASSERT(component->children[i] != component);
 		STARPU_ASSERT(component->children[i] != NULL);
 	}
@@ -454,7 +455,8 @@ static void starpu_sched_component_add_parent(struct starpu_sched_component* com
 {
 	STARPU_ASSERT(component && parent);
 	int i;
-	for(i = 0; i < component->nparents; i++){
+	for(i = 0; i < component->nparents; i++)
+	{
 		STARPU_ASSERT(component->parents[i] != component);
 		STARPU_ASSERT(component->parents[i] != NULL);
 	}

+ 5 - 3
src/sched_policies/component_worker.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2014  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2011-2013  INRIA
  * Copyright (C) 2013  Simon Archipoff
@@ -491,7 +491,8 @@ static struct starpu_task * simple_worker_pull_task(struct starpu_sched_componen
 	}
 	_starpu_sched_component_lock_worker(component->tree->sched_ctx_id, workerid);	
 	int i;
-	do {
+	do
+	{
 		_starpu_sched_component_worker_reset_status(component);
 		for(i=0; i < component->nparents; i++)
 		{
@@ -506,7 +507,8 @@ static struct starpu_task * simple_worker_pull_task(struct starpu_sched_componen
 					break;
 			}
 		}
-	} while((!task) && _starpu_sched_component_worker_is_changed_status(component));
+	}
+	while((!task) && _starpu_sched_component_worker_is_changed_status(component));
 	_starpu_sched_component_worker_set_sleep_status(component);
 	_starpu_sched_component_unlock_worker(component->tree->sched_ctx_id, workerid);	
 	if(!task)

+ 4 - 2
src/sched_policies/eager_central_priority_policy.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -239,7 +239,9 @@ static struct starpu_task *_starpu_priority_pop_task(unsigned sched_ctx_id)
 					taskq->total_ntasks--;
 					_STARPU_TRACE_JOB_POP(task, 0);
 					break;
-				} else skipped = 1;
+				}
+				else
+					skipped = 1;
 			}
 		}
 	}

+ 3 - 2
src/sched_policies/locality_work_stealing_policy.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2011, 2012  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -48,7 +48,8 @@ static unsigned select_victim_neighborhood(unsigned sched_ctx_id, int workerid)
 
 	int i;
 	int neighbor;
-	for(i=0; i<nworkers; i++){
+	for(i=0; i<nworkers; i++)
+	{
 		neighbor = ws->proxlist[workerid][i];
 		int ntasks = ws->queue_array[neighbor]->ntasks;
 		

+ 1 - 2
src/sched_policies/scheduler_maker.c

@@ -170,7 +170,7 @@ static struct starpu_sched_component * where_should_we_plug_this(struct starpu_s
 			return parent->children[i];
 	}
 	if(obj->type == HWLOC_OBJ_NODE)
-	{	
+	{
 		struct starpu_sched_component * component = starpu_sched_component_composed_component_create(root->tree, specs.hwloc_component_composed_sched_component);
 		component->obj = obj;
 		parent->add_child(parent, component);
@@ -198,7 +198,6 @@ static void set_worker_leaf(struct starpu_sched_component * root, struct starpu_
 		starpu_sched_component_add_parent(tmp, component);
 		component->add_child(component, tmp);
 		component = tmp;
-		
 	}
 	starpu_sched_component_composed_recipe_destroy(recipe);
 	starpu_sched_component_add_parent(worker_component, component);

+ 6 - 5
src/util/openmp_runtime_support.c

@@ -210,7 +210,8 @@ static struct starpu_omp_thread *get_local_thread(void)
 			STARPU_ASSERT(thread != NULL);
 		}
 
-		if (thread != NULL) {
+		if (thread != NULL)
+		{
 			STARPU_PTHREAD_SETSPECIFIC(omp_thread_key, thread);
 		}
 	}
@@ -1360,12 +1361,12 @@ void starpu_omp_single_copyprivate(void (*f)(void *arg, void *data, unsigned lon
 	{
 		region->copy_private_data = data;
 		f(arg, data, data_size);
-	} 
+	}
 	starpu_omp_barrier();
 	if (!first)
 	{
 		memcpy(data, region->copy_private_data, data_size);
-	} 
+	}
 	starpu_omp_barrier();
 }
 
@@ -1381,7 +1382,7 @@ void *starpu_omp_single_copyprivate_inline_begin(void *data)
 	{
 		task->single_first = 1;
 		region->copy_private_data = data;
-	} 
+	}
 	else
 	{
 		starpu_omp_barrier();
@@ -1398,7 +1399,7 @@ void starpu_omp_single_copyprivate_inline_end(void)
 	{
 		task->single_first = 0;
 		starpu_omp_barrier();
-	} 
+	}
 	starpu_omp_barrier();
 }
 

+ 3 - 2
tests/main/tag_task_data_deps.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2013  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -66,7 +66,8 @@ static struct starpu_task *create_dummy_task(int write, int data, unsigned durat
 		else
 			task->cl = &dummy_Rcodelet;
 		task->handles[0] = handle;
-	} else
+	}
+	else
 		task->cl = &dummy_codelet;
 	task->cl_arg = (void*) (uintptr_t) duration;
 

+ 7 - 3
tests/sched_policies/prio.c

@@ -76,13 +76,17 @@ run(struct starpu_sched_policy *policy)
 
         starpu_srand48(0);
 
-	for (i = 0; i < NTASKS; i++) {
+	for (i = 0; i < NTASKS; i++)
+	{
 		struct starpu_task *task = starpu_task_create();
 
-		if (((int)(starpu_drand48()*2))%2) {
+		if (((int)(starpu_drand48()*2))%2)
+		{
 			task->cl = &clA;
 			task->priority=STARPU_MIN_PRIO;
-		} else {
+		}
+		else
+		{
 			task->cl = &clB;
 			task->priority=STARPU_MAX_PRIO;
 		}

+ 10 - 5
tools/dev/experimental/cpu_func_to_cpu_funcs_test.c

@@ -21,7 +21,8 @@
 /*
  * Old format
  */
-struct starpu_codelet cl1 = {
+struct starpu_codelet cl1 =
+{
 	.where = STARPU_CPU,
 	.cpu_func = foo
 };
@@ -29,14 +30,16 @@ struct starpu_codelet cl1 = {
 /*
  * New format : it must not be changed !
  */
-struct starpu_codelet cl2 = {
+struct starpu_codelet cl2 =
+{
 	.cpu_funcs = {foo}
 };
 
 /*
  * Maybe we added the cpu_funcs fields, but forgot to remove the cpu_func one.
  */
-struct starpu_codelet cl3 = {
+struct starpu_codelet cl3 =
+{
 	.cpu_func = foo,
 	.cpu_funcs = { foo }
 };
@@ -45,7 +48,8 @@ struct starpu_codelet cl3 = {
  * Old multiimplementations format, but not terminated by NULL
  * XXX : NULL is not added.
  */
-struct starpu_codelet cl4 = {
+struct starpu_codelet cl4 =
+{
 	.cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
 	.cpu_funcs = { foo, bar }
 };
@@ -53,7 +57,8 @@ struct starpu_codelet cl4 = {
 /*
  * Old multiimplementations format, terminated by NULL
  */
-struct starpu_codelet cl5 = {
+struct starpu_codelet cl5 =
+{
 	.cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
 	.cpu_funcs = { foo, bar }
 };

+ 4 - 2
tools/dev/experimental/modes/fix_cocci_output_test.c

@@ -1,4 +1,5 @@
-struct starpu_codelet cl = {
+struct starpu_codelet cl =
+{
 	.where = STARPU_CPU,
 	/* => .modes = { STARPU_R, STARPU_W }, */
 	.modes[1] = STARPU_W,
@@ -10,7 +11,8 @@ struct starpu_codelet cl = {
 static void
 foo(void)
 {
-	struct starpu_codelet cl = {
+	struct starpu_codelet cl =
+	{
 		.where = STARPU_CPU,
 		/* .modes = STARPU_R, STARPU_RW, STARPU_W } */
 		.modes[2] = STARPU_W,

+ 6 - 3
tools/dev/experimental/name_codelets_test.c

@@ -14,17 +14,20 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
-struct starpu_codelet good_beginning = {
+struct starpu_codelet good_beginning =
+{
 	.where = STARPU_CPU,
 	.name = "lol"
 };
 
-struct starpu_codelet good_middle = { 
+struct starpu_codelet good_middle =
+{
 	.where = STARPU_CPU,
 	.name = "lol",
 	.cpu_funcs = { foo }
 };
-struct starpu_codelet good_end = {
+struct starpu_codelet good_end =
+{
 	.where = STARPU_CPU,
 	.name = "lol"
 };

+ 5 - 6
tools/dev/experimental/not_unlocked_mutex_test.c

@@ -16,7 +16,7 @@
  */
 static pthread_mutex_t m;
 
-int 
+int
 bad_0(void)
 {
         blah();
@@ -29,10 +29,10 @@ bad_0(void)
                 return 2;
 
         if (err3)
-        {   
+        {
                 lol();
                 return 3;
-        }   
+        }
 
         _STARPU_PTHREAD_MUTEX_UNLOCK(&m);
 }
@@ -43,11 +43,10 @@ good_0(void)
         _STARPU_PTHREAD_MUTEX_lock(&m);
 
         if (brol)
-        {   
+        {
                 _STARPU_PTHREAD_MUTEX_unlock(&m);
                 return;
-        }   
+        }
 
         _STARPU_PTHREAD_MUTEX_unlock(&m);
 }
-

+ 3 - 2
tools/dev/experimental/remove_where_field_test.c

@@ -21,7 +21,8 @@ struct dummy_struct
 
 
 /* Simple example : remove the where field */
-struct starpu_codelet cl = {
+struct starpu_codelet cl =
+{
 	.cuda_func = bar,
 	.where = STARPU_CPU | STARPU_OPENCL,
 	.cpu_func = foo
@@ -38,5 +39,5 @@ dummy(void)
 	struct dummy_struct ds;
 	struct dummy_struct *dsp = &ds;
 	ds.where = 12;   /* Must not be removed */
-	dsp->where = 12; /* Must not be removed */ 
+	dsp->where = 12; /* Must not be removed */
 }

+ 2 - 1
tools/dev/experimental/use_starpu_unlikely_test.c

@@ -4,7 +4,8 @@ foo(void)
 	if (ret != CL_SUCCESS)
 		foo();
 
-	if (ret != cudaSuccess) {
+	if (ret != cudaSuccess)
+	{
 		fprintf(stderr, "Fail.\n");
 		STARPU_ABORT();
 	}

+ 3 - 2
tools/starpu_fxt_data_trace.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2013       Joris Pablo
  * Copyright (C) 2011-2014  Universite de Bordeaux
- * Copyright (C) 2014       Centre National de la Recherche Scientifique
+ * Copyright (C) 2014, 2015       Centre National de la Recherche Scientifique
  *
  * 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
@@ -75,7 +75,8 @@ static void write_gp(int argc, char **argv)
 	}
 	char codelet_name[MAX_LINE_SIZE];
 	FILE *plt = fopen("data_trace.gp", "w+");
-	if(!plt){
+	if(!plt)
+	{
 		perror("Error while creating data_trace.gp:");
 		exit(-1);
 	}

+ 3 - 2
tools/starpu_fxt_tool.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2014  Universite de Bordeaux
- * Copyright (C) 2012-2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012-2015  Centre National de la Recherche Scientifique
  *
  * 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
@@ -97,7 +97,8 @@ static void parse_args(int argc, char **argv)
 		}
 
 		if (strcmp(argv[i], "-v") == 0
-		 || strcmp(argv[i], "--version") == 0) {
+		 || strcmp(argv[i], "--version") == 0)
+		{
 		        fputs(PROGNAME " (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stderr);
 			exit(EXIT_SUCCESS);
 		}

+ 19 - 10
tools/starpu_lp2paje.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011, 2013-2014  Université de Bordeaux
- * Copyright (C) 2014                  Centre National de la Recherche Scientifique
+ * Copyright (C) 2014, 2015                  Centre National de la Recherche Scientifique
  *
  * 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
@@ -110,36 +110,45 @@ int main(int argc, char *argv[])
 	{
 		struct task task[nt];
 		memset(&task, 0, sizeof(task));
-		for (t = nt-1; t >= 0; t--) {
+		for (t = nt-1; t >= 0; t--)
+		{
 			assert(scanf("c%d %lf\n", &foo, &task[t].stop) == 2);
 		}
 
 		for (t = nt-1; t >= 0; t--)
-			for (w = 0; w < nw; w++) {
+			for (w = 0; w < nw; w++)
+			{
 				assert(scanf("t%dw%d %lf\n", &tt, &ww, &bar) == 3);
 				assert(ww == w);
 
-				if (bar > 0.5) {
+				if (bar > 0.5)
+				{
 					task[t].num = tt;
 					task[t].worker = w;
 				}
 		}
-		for (t = nt-1; t >= 0; t--) {
+		for (t = nt-1; t >= 0; t--)
+		{
 			assert(scanf("s%d %lf\n", &tt, &task[t].start) == 2);
 			fprintf(stderr,"%d: task %d on %d: %f - %f\n", nt-1-t, tt, task[t].worker, task[t].start, task[t].stop);
 			assert(tt == task[t].num);
 		}
 
-		for (t = 0; t < nt; t++) {
+		for (t = 0; t < nt; t++)
+		{
 			printf("6 %f S W%d R%d\n", task[t].start, task[t].worker, t);
 			printf("6 %f S W%d F\n", task[t].stop, task[t].worker);
 		}
 
-		for (t = 0; t < nt; t++) {
-			for (t2 = 0; t2 < nt; t2++) {
-				if (t != t2 && task[t].worker == task[t2].worker) {
+		for (t = 0; t < nt; t++)
+		{
+			for (t2 = 0; t2 < nt; t2++)
+			{
+				if (t != t2 && task[t].worker == task[t2].worker)
+				{
 					if (!(task[t].start >= task[t2].stop
-					    || task[t2].start >= task[t].stop)) {
+					    || task[t2].start >= task[t].stop))
+					{
 						fprintf(stderr,"oops, %d and %d sharing worker %d !!\n", task[t].num, task[t2].num, task[t].worker);
 					}
 				}