Forráskód Böngészése

src: fix coding style

Nathalie Furmento 12 éve
szülő
commit
eb32a9b3d4

+ 5 - 3
src/common/starpu_spinlock.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2013  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
@@ -71,8 +71,10 @@ int _starpu_spin_destroy(struct _starpu_spinlock *lock STARPU_ATTRIBUTE_UNUSED)
 int _starpu_spin_lock(struct _starpu_spinlock *lock)
 {
 #ifdef STARPU_SIMGRID
-	while (1) {
-		if (!lock->taken) {
+	while (1)
+	{
+		if (!lock->taken)
+		{
 			lock->taken = 1;
 			return 0;
 		}

+ 9 - 5
src/core/debug.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2013  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
@@ -70,7 +70,8 @@ void _starpu_print_to_logfile(const char *format STARPU_ATTRIBUTE_UNUSED, ...)
 
 /* Record codelet to give ayudame nice function ids starting from 0. */
 #ifdef HAVE_AYUDAME_H
-struct ayudame_codelet {
+struct ayudame_codelet
+{
 	char *name;
 	struct starpu_codelet *cl;
 } *codelets;
@@ -84,15 +85,18 @@ int64_t _starpu_ayudame_get_func_id(struct starpu_codelet *cl)
 		return -1;
 	name = _starpu_codelet_get_model_name(cl);
 	_STARPU_PTHREAD_MUTEX_LOCK(&ayudame_mutex);
-	for (i=0; i < ncodelets; i++) {
+	for (i=0; i < ncodelets; i++)
+	{
 		if (codelets[i].cl == cl &&
 			((!name && !codelets[i].name) ||
-				((name && codelets[i].name) && !strcmp(codelets[i].name, name)))) {
+				((name && codelets[i].name) && !strcmp(codelets[i].name, name))))
+		{
 			_STARPU_PTHREAD_MUTEX_UNLOCK(&ayudame_mutex);
 			return i;
 		}
 	}
-	if (ncodelets == ncodelets_alloc) {
+	if (ncodelets == ncodelets_alloc)
+	{
 		if (!ncodelets_alloc)
 			ncodelets_alloc = 16;
 		else

+ 9 - 5
src/core/dependencies/implicit_data_deps.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2013  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
@@ -33,7 +33,8 @@ static void _starpu_add_ghost_dependency(starpu_data_handle_t handle STARPU_ATTR
 	struct _starpu_job *next_job = _starpu_get_job_associated_to_task(next);
 	_starpu_bound_job_id_dep(handle, next_job, previous);
 #ifdef HAVE_AYUDAME_H
-	if (AYU_event) {
+	if (AYU_event)
+	{
 		uintptr_t AYU_data[3] = { previous, (uintptr_t) handle, (uintptr_t) handle };
 		AYU_event(AYU_ADDDEPENDENCY, next_job->job_id, AYU_data);
 	}
@@ -117,7 +118,8 @@ static void _starpu_add_writer_after_readers(starpu_data_handle_t handle, struct
 		while (l)
 		{
 			STARPU_ASSERT(l->task);
-			if (l->task != post_sync_task) {
+			if (l->task != post_sync_task)
+			{
 				task_array[i++] = l->task;
 				_starpu_add_dependency(handle, l->task, pre_sync_task);
 				_STARPU_DEP_DEBUG("dep %p -> %p\n", l->task, pre_sync_task);
@@ -327,7 +329,8 @@ void _starpu_detect_implicit_data_deps(struct starpu_task *task)
 		_STARPU_PTHREAD_MUTEX_LOCK(&handle->sequential_consistency_mutex);
 		new_task = _starpu_detect_implicit_data_deps_with_handle(task, task, handle, mode);
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&handle->sequential_consistency_mutex);
-		if (new_task) {
+		if (new_task)
+		{
 			int ret = _starpu_task_submit_internally(new_task);
 			STARPU_ASSERT(!ret);
 		}
@@ -547,7 +550,8 @@ int _starpu_data_wait_until_available(starpu_data_handle_t handle, enum starpu_a
 		new_task = _starpu_detect_implicit_data_deps_with_handle(sync_task, sync_task, handle, mode);
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&handle->sequential_consistency_mutex);
 
-		if (new_task) {
+		if (new_task)
+		{
 			int ret = _starpu_task_submit_internally(new_task);
 			STARPU_ASSERT(!ret);
 		}

+ 17 - 9
src/core/dependencies/tags.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -96,7 +96,8 @@ static void _starpu_tag_free(void *_tag)
 {
 	struct _starpu_tag *tag = (struct _starpu_tag *) _tag;
 
-	if (tag) {
+	if (tag)
+	{
 		_starpu_spin_lock(&tag->lock);
 
 		unsigned nsuccs = tag->tag_successors.nsuccs;
@@ -139,7 +140,8 @@ void starpu_tag_remove(starpu_tag_t id)
 	struct _starpu_tag_table *entry;
 
 #ifdef HAVE_AYUDAME_H
-	if (AYU_event) {
+	if (AYU_event)
+	{
 		int id = -1;
 		AYU_event(AYU_REMOVETASK, id + AYUDAME_OFFSET, NULL);
 	}
@@ -199,7 +201,8 @@ static struct _starpu_tag *gettag_struct(starpu_tag_t id)
 		HASH_ADD_UINT64_T(tag_htbl, id, entry2);
 
 #ifdef HAVE_AYUDAME_H
-		if (AYU_event) {
+		if (AYU_event)
+		{
 			int64_t AYU_data[2] = {-1, 0};
 			STARPU_ASSERT(id < AYUDAME_OFFSET);
 			AYU_event(AYU_ADDTASK, id + AYUDAME_OFFSET, AYU_data);
@@ -232,7 +235,8 @@ void _starpu_tag_set_ready(struct _starpu_tag *tag)
 
 	_starpu_spin_lock(&tag->lock);
 #ifdef HAVE_AYUDAME_H
-	if (AYU_event) {
+	if (AYU_event)
+	{
 		int id = -1;
 		AYU_event(AYU_PRERUNTASK, tag->id + AYUDAME_OFFSET, &id);
 		AYU_event(AYU_POSTRUNTASK, tag->id + AYUDAME_OFFSET, NULL);
@@ -258,7 +262,8 @@ void _starpu_notify_tag_dependencies(struct _starpu_tag *tag)
 {
 	_starpu_spin_lock(&tag->lock);
 
-	if (tag->state == STARPU_DONE) {
+	if (tag->state == STARPU_DONE)
+	{
 		_starpu_spin_unlock(&tag->lock);
 		return;
 	}
@@ -315,7 +320,8 @@ void _starpu_tag_declare(starpu_tag_t id, struct _starpu_job *job)
 			tag->state != STARPU_DONE)
 		tag->state = STARPU_ASSOCIATED;
 #ifdef HAVE_AYUDAME_H
-	if (AYU_event) {
+	if (AYU_event)
+	{
 		uintptr_t AYU_data1[3] = {id+AYUDAME_OFFSET, 0, 0};
 		uintptr_t AYU_data2[3] = {job->job_id, 0, 0};
 		AYU_event(AYU_ADDDEPENDENCY, job->job_id, AYU_data1);
@@ -353,7 +359,8 @@ void starpu_tag_declare_deps_array(starpu_tag_t id, unsigned ndeps, starpu_tag_t
 		_starpu_spin_lock(&tag_child->lock);
 		_starpu_tag_add_succ(tag_dep, cg);
 #ifdef HAVE_AYUDAME_H
-		if (AYU_event) {
+		if (AYU_event)
+		{
 			uintptr_t AYU_data[3] = {dep_id+AYUDAME_OFFSET, 0, 0};
 			AYU_event(AYU_ADDDEPENDENCY, id+AYUDAME_OFFSET, AYU_data);
 		}
@@ -394,7 +401,8 @@ void starpu_tag_declare_deps(starpu_tag_t id, unsigned ndeps, ...)
 		_starpu_spin_lock(&tag_child->lock);
 		_starpu_tag_add_succ(tag_dep, cg);
 #ifdef HAVE_AYUDAME_H
-		if (AYU_event) {
+		if (AYU_event)
+		{
 			uintptr_t AYU_data[3] = {dep_id+AYUDAME_OFFSET, 0, 0};
 			AYU_event(AYU_ADDDEPENDENCY, id+AYUDAME_OFFSET, AYU_data);
 		}

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

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -81,7 +81,8 @@ void _starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, s
 		dep_job = _starpu_get_job_associated_to_task(dep_task);
 
 		STARPU_ASSERT_MSG(dep_job != job, "A task must not depend on itself.");
-		if (check) {
+		if (check)
+		{
 			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");
@@ -91,7 +92,8 @@ void _starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, s
 		_STARPU_TRACE_TASK_DEPS(dep_job, job);
 		_starpu_bound_task_dep(job, dep_job);
 #ifdef HAVE_AYUDAME_H
-		if (AYU_event && check) {
+		if (AYU_event && check)
+		{
 			uintptr_t AYU_data[3] = {dep_job->job_id, 0, 0};
 			AYU_event(AYU_ADDDEPENDENCY, job->job_id, AYU_data);
 		}

+ 10 - 6
src/core/jobs.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2011  INRIA
  *
@@ -64,7 +64,8 @@ struct _starpu_job* __attribute__((malloc)) _starpu_job_create(struct starpu_tas
 	{
 		job->job_id = STARPU_ATOMIC_ADD(&job_cnt, 1);
 #ifdef HAVE_AYUDAME_H
-		if (AYU_event) {
+		if (AYU_event)
+		{
 			/* Declare task to Ayudame */
 			int64_t AYU_data[2] = {_starpu_ayudame_get_func_id(task->cl), task->priority > STARPU_MIN_PRIO};
 			AYU_event(AYU_ADDTASK, job->job_id, AYU_data);
@@ -144,9 +145,11 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 	_STARPU_PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 
 	/* We release handle reference count */
-	if (task->cl) {
+	if (task->cl)
+	{
 		unsigned i;
-		for (i=0; i<task->cl->nbuffers; i++) {
+		for (i=0; i<task->cl->nbuffers; i++)
+		{
 			starpu_data_handle_t handle = task->handles[i];
 			_starpu_spin_lock(&handle->header_lock);
 			handle->busy_count--;
@@ -250,7 +253,8 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 		STARPU_ASSERT_MSG(detach && !destroy && !task->synchronous, "Regenerated task must be detached (was %d), and not have detroy=1 (was %d) or synchronous=1 (was %d)", detach, destroy, task->synchronous);
 
 #ifdef HAVE_AYUDAME_H
-		if (AYU_event) {
+		if (AYU_event)
+		{
 			int64_t AYU_data[2] = {j->exclude_from_dag?-1:_starpu_ayudame_get_func_id(task->cl), task->priority > STARPU_MIN_PRIO};
 			AYU_event(AYU_ADDTASK, j->job_id, AYU_data);
 		}
@@ -349,7 +353,7 @@ unsigned _starpu_enforce_deps_and_schedule(struct _starpu_job *j)
 		_STARPU_LOG_OUT_TAG("not_all_tag_deps_are_fulfilled");
 		return 0;
 	}
-	
+
 	/* enfore task dependencies */
 	if (_starpu_not_all_task_deps_are_fulfilled(j))
 	{

+ 9 - 5
src/core/perfmodel/perfmodel_bus.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -230,9 +230,11 @@ static void measure_bandwidth_between_dev_and_dev_cuda(int src, int dst)
 	 * since we cleanly shutdown CUDA before returning. */
 	cudaSetDevice(src);
 
-	if (starpu_get_env_number("STARPU_DISABLE_CUDA_GPU_GPU_DIRECT") <= 0) {
+	if (starpu_get_env_number("STARPU_DISABLE_CUDA_GPU_GPU_DIRECT") <= 0)
+	{
 		cures = cudaDeviceCanAccessPeer(&can, src, dst);
-		if (!cures && can) {
+		if (!cures && can)
+		{
 			cures = cudaDeviceEnablePeerAccess(dst, 0);
 			if (!cures)
 				_STARPU_DISP("GPU-Direct %d -> %d\n", dst, src);
@@ -250,9 +252,11 @@ static void measure_bandwidth_between_dev_and_dev_cuda(int src, int dst)
 	 * since we cleanly shutdown CUDA before returning. */
 	cudaSetDevice(dst);
 
-	if (starpu_get_env_number("STARPU_DISABLE_CUDA_GPU_GPU_DIRECT") <= 0) {
+	if (starpu_get_env_number("STARPU_DISABLE_CUDA_GPU_GPU_DIRECT") <= 0)
+	{
 		cures = cudaDeviceCanAccessPeer(&can, dst, src);
-		if (!cures && can) {
+		if (!cures && can)
+		{
 			cures = cudaDeviceEnablePeerAccess(src, 0);
 			if (!cures)
 				_STARPU_DISP("GPU-Direct %d -> %d\n", src, dst);

+ 13 - 6
src/core/perfmodel/perfmodel_history.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -57,11 +57,16 @@ size_t _starpu_job_get_data_size(struct starpu_perfmodel *model, enum starpu_per
 {
 	struct starpu_task *task = j->task;
 
-	if (model && model->per_arch[arch][nimpl].size_base) {
+	if (model && model->per_arch[arch][nimpl].size_base)
+	{
 		return model->per_arch[arch][nimpl].size_base(task, arch, nimpl);
-	} else if (model && model->size_base) {
+	}
+	else if (model && model->size_base)
+	{
 		return model->size_base(task, nimpl);
-	} else {
+	}
+	else
+	{
 		unsigned nbuffers = task->cl->nbuffers;
 		size_t size = 0;
 
@@ -746,7 +751,8 @@ void _starpu_deinitialize_registered_performance_models(void)
 				archmodel->history = NULL;
 
 				list = archmodel->list;
-				while (list) {
+				while (list)
+				{
 					free(list->entry);
 					plist = list;
 					list = list->next;
@@ -1261,7 +1267,8 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 	}
 }
 
-void starpu_perfmodel_update_history(struct starpu_perfmodel *model, struct starpu_task *task, enum starpu_perf_archtype arch, unsigned cpuid, unsigned nimpl, double measured) {
+void starpu_perfmodel_update_history(struct starpu_perfmodel *model, struct starpu_task *task, enum starpu_perf_archtype arch, unsigned cpuid, unsigned nimpl, double measured)
+{
 	struct _starpu_job *job = _starpu_get_job_associated_to_task(task);
 
 	_starpu_load_perfmodel(model);

+ 6 - 5
src/core/sched_policy.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2013  Université de Bordeaux 1
- * Copyright (C) 2010-2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010-2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -254,7 +254,7 @@ static int _starpu_push_task_on_specific_worker(struct starpu_task *task, int wo
 				task->handles[i]->mf_node = node;
 		}
 //		if(task->sched_ctx != _starpu_get_initial_sched_ctx()->id)
-			
+
 		if(task->priority > 0)
 			return _starpu_push_local_task(worker, task, 1);
 		else
@@ -297,7 +297,7 @@ static int _starpu_nworkers_able_to_execute_task(struct starpu_task *task, struc
 {
 	int worker = -1, nworkers = 0;
 	struct starpu_sched_ctx_worker_collection *workers = sched_ctx->workers;
-	
+
 	struct starpu_iterator it;
 	if(workers->init_iterator)
 		workers->init_iterator(workers, &it);
@@ -327,7 +327,8 @@ int _starpu_push_task(struct _starpu_job *j)
 	_starpu_increment_nready_tasks();
 	task->status = STARPU_TASK_READY;
 #ifdef HAVE_AYUDAME_H
-	if (AYU_event) {
+	if (AYU_event)
+	{
 		int id = -1;
 		AYU_event(AYU_ADDTASKTOQUEUE, j->job_id, &id);
 	}
@@ -411,7 +412,7 @@ int _starpu_push_task_to_workers(struct starpu_task *task)
 	_STARPU_LOG_OUT();
 	return ret;
 
-} 
+}
 
 /* This is called right after the scheduler has pushed a task to a queue
  * but just before releasing mutexes: we need the task to still be alive!

+ 26 - 12
src/core/simgrid.c

@@ -121,7 +121,8 @@ void starpu_simgrid_write_platform(struct starpu_conf *conf, FILE *file)
 #pragma weak starpu_main
 extern int starpu_main(int argc, char *argv[]);
 
-struct main_args {
+struct main_args
+{
 	int argc;
 	char **argv;
 };
@@ -336,11 +337,13 @@ static int transfer_execute(int argc STARPU_ATTRIBUTE_UNUSED, char *argv[] STARP
 	/* Wake transfers waiting for my termination */
 	/* Note: due to possible preemption inside process_create, the array
 	 * may grow while doing this */
-	for (i = 0; i < transfer->nwake; i++) {
+	for (i = 0; i < transfer->nwake; i++)
+	{
 		struct transfer *wake = transfer->wake[i];
 		STARPU_ASSERT(wake->nwait > 0);
 		wake->nwait--;
-		if (!wake->nwait) {
+		if (!wake->nwait)
+		{
 			_STARPU_DEBUG("triggering transfer %p\n", wake);
 			MSG_process_create("transfer task", transfer_execute, wake, MSG_get_host_by_name("MAIN"));
 		}
@@ -353,7 +356,8 @@ static int transfer_execute(int argc STARPU_ATTRIBUTE_UNUSED, char *argv[] STARP
 }
 
 /* Look for sequentialization between this transfer and pending transfers, and submit this one */
-static void transfer_submit(struct transfer *transfer) {
+static void transfer_submit(struct transfer *transfer)
+{
 	struct transfer *old;
 
 	if (!pending)
@@ -361,8 +365,10 @@ static void transfer_submit(struct transfer *transfer) {
 
 	for (old  = transfer_list_begin(pending);
 	     old != transfer_list_end(pending);
-	     old  = transfer_list_next(old)) {
-		if (transfers_are_sequential(transfer, old)) {
+	     old  = transfer_list_next(old))
+	{
+		if (transfers_are_sequential(transfer, old))
+		{
 			_STARPU_DEBUG("transfer %p(%d->%d) waits for %p(%d->%d)\n",
 					transfer, transfer->src_node, transfer->dst_node,
 					old, old->src_node, old->dst_node);
@@ -377,7 +383,8 @@ static void transfer_submit(struct transfer *transfer) {
 
 	transfer_list_push_front(pending, transfer);
 
-	if (!transfer->nwait) {
+	if (!transfer->nwait)
+	{
 		_STARPU_DEBUG("transfer %p waits for nobody, starting\n", transfer);
 		MSG_process_create("transfer task", transfer_execute, transfer, MSG_get_host_by_name("MAIN"));
 	}
@@ -407,11 +414,14 @@ int _starpu_simgrid_transfer(size_t size, unsigned src_node, unsigned dst_node,
 	transfer->dst_node = dst_node;
 	transfer->run_node = _starpu_get_local_memory_node();
 
-	if (req) {
+	if (req)
+	{
 		transfer->finished = &req->async_channel.event.finished;
 		transfer->mutex = &req->async_channel.event.mutex;
 		transfer->cond = &req->async_channel.event.cond;
-	} else {
+	}
+	else
+	{
 		transfer->finished = &finished;
 		transfer->mutex = &mutex;
 		transfer->cond = &cond;
@@ -430,11 +440,14 @@ int _starpu_simgrid_transfer(size_t size, unsigned src_node, unsigned dst_node,
 	transfer_submit(transfer);
 	/* Note: from here, transfer might be already freed */
 
-	if (req) {
+	if (req)
+	{
 		_STARPU_TRACE_END_DRIVER_COPY_ASYNC(src_node, dst_node);
 		_STARPU_TRACE_DATA_COPY(src_node, dst_node, size);
 		return -EAGAIN;
-	} else {
+	}
+	else
+	{
 		/* this is not associated to a request so it's synchronous */
 		_STARPU_PTHREAD_MUTEX_LOCK(&mutex);
 		while (!finished)
@@ -452,7 +465,8 @@ int _starpu_pthread_key_create(_starpu_pthread_key_t *key)
 
 	/* Note: no synchronization here, we are actually monothreaded anyway. */
 	for (i = 0; i < MAX_TSD; i++)
-		if (!used_key[i]) {
+		if (!used_key[i])
+		{
 			used_key[i] = 1;
 			break;
 		}

+ 25 - 22
src/core/task.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2011  INRIA
  *
@@ -99,7 +99,8 @@ void starpu_task_clean(struct starpu_task *task)
 
 	struct _starpu_job *j = (struct _starpu_job *)task->starpu_private;
 
-	if (j) {
+	if (j)
+	{
 		_starpu_job_destroy(j);
 		task->starpu_private = NULL;
 	}
@@ -127,22 +128,20 @@ struct starpu_task * __attribute__((malloc)) starpu_task_create(void)
 void _starpu_task_destroy(struct starpu_task *task)
 {
 
-   /* If starpu_task_destroy is called in a callback, we just set the destroy
-      flag. The task will be destroyed after the callback returns */
-   if (task == starpu_task_get_current()
-       && _starpu_get_local_worker_status() == STATUS_CALLBACK)
-   {
-
-	   task->destroy = 1;
-
-   }
-   else
-   {
-	   starpu_task_clean(task);
-	   /* TODO handle the case of task with detach = 1 and destroy = 1 */
-	   /* TODO handle the case of non terminated tasks -> return -EINVAL */
-	   free(task);
-   }
+	/* If starpu_task_destroy is called in a callback, we just set the destroy
+	   flag. The task will be destroyed after the callback returns */
+	if (task == starpu_task_get_current()
+	    && _starpu_get_local_worker_status() == STATUS_CALLBACK)
+	{
+		task->destroy = 1;
+	}
+	else
+	{
+		starpu_task_clean(task);
+		/* TODO handle the case of task with detach = 1 and destroy = 1 */
+		/* TODO handle the case of non terminated tasks -> return -EINVAL */
+		free(task);
+	}
 }
 
 void starpu_task_destroy(struct starpu_task *task)
@@ -223,7 +222,8 @@ int _starpu_submit_job(struct _starpu_job *j)
 #endif
 
 	/* We retain handle reference count */
-	if (task->cl) {
+	if (task->cl)
+	{
 		unsigned i;
 		for (i=0; i<task->cl->nbuffers; i++)
 		{
@@ -567,7 +567,8 @@ int _starpu_task_submit_conversion_task(struct starpu_task *task,
 
 	/* We retain handle reference count */
 	unsigned i;
-	for (i=0; i<task->cl->nbuffers; i++) {
+	for (i=0; i<task->cl->nbuffers; i++)
+	{
 		starpu_data_handle_t handle = task->handles[i];
 		_starpu_spin_lock(&handle->header_lock);
 		handle->busy_count++;
@@ -716,7 +717,8 @@ void _starpu_decrement_nsubmitted_tasks(void)
 
 	_STARPU_PTHREAD_MUTEX_LOCK(&submitted_mutex);
 
-	if (--nsubmitted == 0) {
+	if (--nsubmitted == 0)
+	{
 		if (!config->submitting)
 			config->running = 0;
 		_STARPU_PTHREAD_COND_BROADCAST(&submitted_cond);
@@ -736,7 +738,8 @@ starpu_drivers_request_termination(void)
 	_STARPU_PTHREAD_MUTEX_LOCK(&submitted_mutex);
 
 	config->submitting = 0;
-	if (nsubmitted == 0) {
+	if (nsubmitted == 0)
+	{
 		config->running = 0;
 		_STARPU_PTHREAD_COND_BROADCAST(&submitted_cond);
 	}

+ 3 - 2
src/core/topology.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012 Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
  * Copyright (C) 2011  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -1017,7 +1017,8 @@ starpu_topology_print (FILE *output)
 	unsigned nworkers = starpu_worker_get_count();
 	unsigned ncombinedworkers = topology->ncombinedworkers;
 
-	for (core = 0; core < topology->nhwcpus; core++) {
+	for (core = 0; core < topology->nhwcpus; core++)
+	{
 		fprintf(output, "core %u\t", core);
 		for (worker = 0;
 		     worker < nworkers + ncombinedworkers;

+ 9 - 6
src/core/workers.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2010, 2011  Institut National de Recherche en Informatique et Automatique
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2011-2012  INRIA
@@ -377,7 +377,8 @@ static void _starpu_launch_drivers(struct _starpu_machine_config *config)
 #endif
 
 #ifdef HAVE_AYUDAME_H
-	if (AYU_event) {
+	if (AYU_event)
+	{
 		unsigned long n = nworkers;
 		AYU_event(AYU_INIT, 0, (void*) &n);
 	}
@@ -780,7 +781,8 @@ int starpu_init(struct starpu_conf *user_conf)
 /* Dumb value for now */
 #define AYU_RT_STARPU 32
 #endif
-	if (AYU_event) {
+	if (AYU_event)
+	{
 		enum ayu_runtime_t ayu_rt = AYU_RT_STARPU;
 		AYU_event(AYU_PREINIT, 0, (void*) &ayu_rt);
 	}
@@ -796,9 +798,10 @@ int starpu_init(struct starpu_conf *user_conf)
 	}
 	else
 	{
-	     if (user_conf->magic != 42) {
-		_STARPU_DISP("starpu_conf structure needs to be initialized with starpu_conf_init\n");
-		return -EINVAL;
+	     if (user_conf->magic != 42)
+	     {
+		  _STARPU_DISP("starpu_conf structure needs to be initialized with starpu_conf_init\n");
+		  return -EINVAL;
 	     }
 	     config.conf = user_conf;
 	     config.default_conf = 0;

+ 3 - 2
src/datawizard/coherency.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -448,7 +448,8 @@ struct _starpu_data_request *_starpu_create_request_to_fetch_data(starpu_data_ha
 
 		if (hop != nhops - 1)
 		{
-			if (!reused_requests[hop + 1]) {
+			if (!reused_requests[hop + 1])
+			{
 				r->next_req[r->next_req_count++] = requests[hop + 1];
 				STARPU_ASSERT(r->next_req_count <= STARPU_MAXNODES);
 			}

+ 3 - 2
src/datawizard/data_request.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -577,7 +577,8 @@ static void _handle_pending_node_data_requests(uint32_t src_node, unsigned force
 			}
 		}
 	}
-	if (!_starpu_data_request_list_empty(new_data_requests_pending)) {
+	if (!_starpu_data_request_list_empty(new_data_requests_pending))
+	{
 		_STARPU_PTHREAD_MUTEX_LOCK(&data_requests_pending_list_mutex[src_node]);
 		_starpu_data_request_list_push_list_back(data_requests_pending[src_node], new_data_requests_pending);
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&data_requests_pending_list_mutex[src_node]);

+ 3 - 2
src/datawizard/filters.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2010-2013  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2012 INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -142,7 +142,8 @@ void starpu_data_partition(starpu_data_handle_t initial_handle, struct starpu_da
 		if (initial_handle->per_node[node].state != STARPU_INVALID)
 			break;
 	}
-	if (node == STARPU_MAXNODES) {
+	if (node == STARPU_MAXNODES)
+	{
 		/* This is lazy allocation, allocate it now in main RAM, so as
 		 * to have somewhere to gather pieces later */
 		int ret = _starpu_allocate_memory_on_node(initial_handle, &initial_handle->per_node[0], 0);

+ 9 - 4
src/datawizard/footprint.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -28,13 +28,18 @@ uint32_t _starpu_compute_buffers_footprint(struct starpu_perfmodel *model, enum
 
 	struct starpu_task *task = j->task;
 
-	if (model && model->per_arch[arch][nimpl].size_base) {
+	if (model && model->per_arch[arch][nimpl].size_base)
+	{
 		size_t size = model->per_arch[arch][nimpl].size_base(task, arch, nimpl);
 		footprint = starpu_crc32_be_n(&size, sizeof(size), footprint);
-	} else if (model && model->size_base) {
+	}
+	else if (model && model->size_base)
+	{
 		size_t size = model->size_base(task, nimpl);
 		footprint = starpu_crc32_be_n(&size, sizeof(size), footprint);
-	} else {
+	}
+	else
+	{
 		for (buffer = 0; buffer < task->cl->nbuffers; buffer++)
 		{
 			starpu_data_handle_t handle = task->handles[buffer];

+ 5 - 3
src/datawizard/interfaces/data_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -566,9 +566,11 @@ static void _starpu_data_unregister(starpu_data_handle_t handle, unsigned cohere
 	}
 
 	_starpu_spin_lock(&handle->header_lock);
-	if (!coherent) {
+	if (!coherent)
+	{
 		/* Should we postpone the unregister operation ? */
-		if ((handle->busy_count > 0) && handle->lazy_unregister) {
+		if ((handle->busy_count > 0) && handle->lazy_unregister)
+		{
 			_starpu_spin_unlock(&handle->header_lock);
 			return;
 		}

+ 3 - 2
src/datawizard/interfaces/multiformat_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012  Institut National de Recherche en Informatique et Automatique
- * Copyright (C) 2012       Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013       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
@@ -605,7 +605,8 @@ static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node,
 
 	size = src_multiformat->nx * src_multiformat->ops->opencl_elemsize;
 
-	if (dst_multiformat->opencl_ptr == NULL) {
+	if (dst_multiformat->opencl_ptr == NULL)
+	{
 		/* XXX : it is weird that we might have to allocate memory here... */
 		dst_multiformat->opencl_ptr = malloc(dst_multiformat->nx * dst_multiformat->ops->opencl_elemsize);
 	}

+ 9 - 5
src/datawizard/memalloc.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -702,12 +702,14 @@ void _starpu_request_mem_chunk_removal(starpu_data_handle_t handle, unsigned nod
 			/* This is particularly important when
 			 * STARPU_USE_ALLOCATION_CACHE is not enabled, as we
 			 * wouldn't even re-use these allocations! */
-			if (starpu_node_get_kind(node) == STARPU_CPU_RAM) {
+			if (starpu_node_get_kind(node) == STARPU_CPU_RAM)
+			{
 				free_memory_on_node(mc, node);
 
 				free(mc->chunk_interface);
 				_starpu_mem_chunk_delete(mc);
-			} else
+			}
+			else
 				/* put it in the list of buffers to be removed */
 				_starpu_mem_chunk_list_push_front(memchunk_cache[node], mc);
 
@@ -964,11 +966,13 @@ static ssize_t _starpu_allocate_interface(starpu_data_handle_t handle, struct _s
 			_starpu_spin_unlock(&handle->header_lock);
 
 			_STARPU_TRACE_START_MEMRECLAIM(dst_node);
-			if (is_prefetch) {
+			if (is_prefetch)
+			{
 				_STARPU_PTHREAD_RWLOCK_WRLOCK(&mc_rwlock[dst_node]);
 				flush_memchunk_cache(dst_node, reclaim);
 				_STARPU_PTHREAD_RWLOCK_UNLOCK(&mc_rwlock[dst_node]);
-			} else
+			}
+			else
 				reclaim_memory_generic(dst_node, 0, reclaim);
 			_STARPU_TRACE_END_MEMRECLAIM(dst_node);
 

+ 8 - 4
src/datawizard/reduction.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2013  Université de Bordeaux 1
- * Copyright (C) 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013  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
@@ -152,10 +152,13 @@ void _starpu_data_end_reduction_mode(starpu_data_handle_t handle)
 	}
 
 #ifndef NO_TREE_REDUCTION
-	if (empty) {
+	if (empty)
+	{
 		/* Only the final copy will touch the actual handle */
 		handle->reduction_refcnt = 1;
-	} else {
+	}
+	else
+	{
 		unsigned step = 1;
 		handle->reduction_refcnt = 0;
 		while (step < replicate_count)
@@ -258,7 +261,8 @@ void _starpu_data_end_reduction_mode(starpu_data_handle_t handle)
 			STARPU_ASSERT(ret == 0);
 		}
 #else
-		if (empty) {
+		if (empty)
+		{
 			struct starpu_task *redux_task = starpu_task_create();
 
 			/* Mark these tasks so that StarPU does not block them

+ 7 - 4
src/datawizard/user_interactions.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  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
@@ -156,7 +156,8 @@ int starpu_data_acquire_on_node_cb(starpu_data_handle_t handle, unsigned node,
 		new_task = _starpu_detect_implicit_data_deps_with_handle(wrapper->pre_sync_task, wrapper->post_sync_task, handle, mode);
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&handle->sequential_consistency_mutex);
 
-		if (new_task) {
+		if (new_task)
+		{
 			int ret = _starpu_task_submit_internally(new_task);
 			STARPU_ASSERT(!ret);
 		}
@@ -264,7 +265,8 @@ int starpu_data_acquire_on_node(starpu_data_handle_t handle, unsigned node, enum
 
 		new_task = _starpu_detect_implicit_data_deps_with_handle(wrapper.pre_sync_task, wrapper.post_sync_task, handle, mode);
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&handle->sequential_consistency_mutex);
-		if (new_task) {
+		if (new_task)
+		{
 			int ret = _starpu_task_submit_internally(new_task);
 			STARPU_ASSERT(!ret);
 		}
@@ -343,7 +345,8 @@ static void _prefetch_data_on_node(void *arg)
 
 	if (wrapper->async)
 		free(wrapper);
-	else {
+	else
+	{
 		_STARPU_PTHREAD_MUTEX_LOCK(&wrapper->lock);
 		wrapper->finished = 1;
 		_STARPU_PTHREAD_COND_SIGNAL(&wrapper->cond);

+ 27 - 16
src/drivers/cuda/driver_cuda.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009-2013  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -159,18 +159,21 @@ void starpu_cuda_set_device(unsigned devid STARPU_ATTRIBUTE_UNUSED)
 #endif
 
 #ifdef HAVE_CUDA_MEMCPY_PEER
-	if (conf->n_cuda_opengl_interoperability) {
+	if (conf->n_cuda_opengl_interoperability)
+	{
 		fprintf(stderr, "OpenGL interoperability was requested, but StarPU was built with multithread GPU control support, please reconfigure with --disable-cuda-memcpy-peer but that will disable the memcpy-peer optimizations\n");
 		STARPU_ABORT();
 	}
 #elif !defined(HAVE_CUDA_GL_INTEROP_H)
-	if (conf->n_cuda_opengl_interoperability) {
+	if (conf->n_cuda_opengl_interoperability)
+	{
 		fprintf(stderr,"OpenGL interoperability was requested, but cuda_gl_interop.h could not be compiled, please make sure that OpenGL headers were available before ./configure run.");
 		STARPU_ABORT();
 	}
 #else
 	for (i = 0; i < conf->n_cuda_opengl_interoperability; i++)
-		if (conf->cuda_opengl_interoperability[i] == devid) {
+		if (conf->cuda_opengl_interoperability[i] == devid)
+		{
 			cures = cudaGLSetGLDevice(devid);
 			goto done;
 		}
@@ -197,14 +200,18 @@ static void init_context(unsigned devid)
 	starpu_cuda_set_device(devid);
 
 #ifdef HAVE_CUDA_MEMCPY_PEER
-	if (starpu_get_env_number("STARPU_DISABLE_CUDA_GPU_GPU_DIRECT") == 0) {
+	if (starpu_get_env_number("STARPU_DISABLE_CUDA_GPU_GPU_DIRECT") == 0)
+	{
 		int nworkers = starpu_worker_get_count();
-		for (workerid = 0; workerid < nworkers; workerid++) {
+		for (workerid = 0; workerid < nworkers; workerid++)
+		{
 			struct _starpu_worker *worker = _starpu_get_worker_struct(workerid);
-			if (worker->arch == STARPU_CUDA_WORKER && worker->devid != devid) {
+			if (worker->arch == STARPU_CUDA_WORKER && worker->devid != devid)
+			{
 				int can;
 				cures = cudaDeviceCanAccessPeer(&can, devid, worker->devid);
-				if (!cures && can) {
+				if (!cures && can)
+				{
 					cures = cudaDeviceEnablePeerAccess(worker->devid, 0);
 					if (!cures)
 						_STARPU_DEBUG("Enabled GPU-Direct %d -> %d\n", worker->devid, devid);
@@ -216,8 +223,10 @@ static void init_context(unsigned devid)
 
 	/* force CUDA to initialize the context for real */
 	cures = cudaFree(0);
-	if (STARPU_UNLIKELY(cures)) {
-		if (cures == cudaErrorDevicesUnavailable) {
+	if (STARPU_UNLIKELY(cures))
+	{
+		if (cures == cudaErrorDevicesUnavailable)
+		{
 			fprintf(stderr,"All CUDA-capable devices are busy or unavailable\n");
 			exit(77);
 		}
@@ -228,7 +237,8 @@ static void init_context(unsigned devid)
 	if (STARPU_UNLIKELY(cures))
 		STARPU_CUDA_REPORT_ERROR(cures);
 #ifdef HAVE_CUDA_MEMCPY_PEER
-	if (props[devid].computeMode == cudaComputeModeExclusive) {
+	if (props[devid].computeMode == cudaComputeModeExclusive)
+	{
 		fprintf(stderr, "CUDA is in EXCLUSIVE-THREAD mode, but StarPU was built with multithread GPU control support, please either ask your administrator to use EXCLUSIVE-PROCESS mode (which should really be fine), or reconfigure with --disable-cuda-memcpy-peer but that will disable the memcpy-peer optimizations\n");
 		STARPU_ABORT();
 	}
@@ -503,10 +513,11 @@ int _starpu_cuda_driver_deinit(struct starpu_driver *d)
 void *_starpu_cuda_worker(void *arg)
 {
 	struct _starpu_worker* args = arg;
-	struct starpu_driver d = {
-		.type       = STARPU_CUDA_WORKER,
-		.id.cuda_id = args->devid
-	};
+	struct starpu_driver d =
+		{
+			.type       = STARPU_CUDA_WORKER,
+			.id.cuda_id = args->devid
+		};
 
 	_starpu_cuda_driver_init(&d);
 	while (_starpu_machine_is_running())
@@ -614,7 +625,7 @@ starpu_cuda_copy_async_sync(void *src_ptr, unsigned src_node,
 		{
 			cures = cudaMemcpy((char *)dst_ptr, (char *)src_ptr, ssize, kind);
 		}
-		
+
 
 		if (STARPU_UNLIKELY(cures))
 			STARPU_CUDA_REPORT_ERROR(cures);

+ 9 - 5
src/drivers/driver_common/driver_common.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -175,10 +175,13 @@ struct starpu_task *_starpu_get_worker_task(struct _starpu_worker *args, int wor
 		if (_starpu_worker_can_block(memnode))
 			_STARPU_PTHREAD_COND_WAIT(&args->sched_cond, &args->sched_mutex);
 #ifdef STARPU_SIMGRID
-		else {
-			if (_starpu_machine_is_running()) {
+		else
+		{
+			if (_starpu_machine_is_running())
+			{
 				static int warned;
-				if (!warned) {
+				if (!warned)
+				{
 					warned = 1;
 					_STARPU_DISP("Has to make simgrid spin for progression hooks\n");
 				}
@@ -202,7 +205,8 @@ struct starpu_task *_starpu_get_worker_task(struct _starpu_worker *args, int wor
 	}
 
 #ifdef HAVE_AYUDAME_H
-	if (AYU_event) {
+	if (AYU_event)
+	{
 		int id = workerid;
 		AYU_event(AYU_PRERUNTASK, _starpu_get_job_associated_to_task(task)->job_id, &id);
 	}

+ 55 - 53
src/drivers/opencl/driver_opencl.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2010-2012  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -249,38 +249,37 @@ cl_int starpu_opencl_allocate_memory(cl_mem *mem STARPU_ATTRIBUTE_UNUSED, size_t
 
 cl_int starpu_opencl_copy_ram_to_opencl(void *ptr, unsigned src_node STARPU_ATTRIBUTE_UNUSED, cl_mem buffer, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, size_t size, size_t offset, cl_event *event, int *ret)
 {
-   cl_int err;
-   struct _starpu_worker *worker = _starpu_get_local_worker_key();
-
-
-   if (event)
-      _STARPU_TRACE_START_DRIVER_COPY_ASYNC(src_node, dst_node);
-
-   cl_event ev;
-   err = clEnqueueWriteBuffer(transfer_queues[worker->devid], buffer, CL_FALSE, offset, size, ptr, 0, NULL, &ev);
-
-   if (event)
-      _STARPU_TRACE_END_DRIVER_COPY_ASYNC(src_node, dst_node);
-
-
-   if (STARPU_LIKELY(err == CL_SUCCESS))
-   {
-      if (event == NULL)
-      {
-         /* We want a synchronous copy, let's synchronise the queue */
-         clWaitForEvents(1, &ev);
-         clReleaseEvent(ev);
-      }
-      else {
-         *event = ev;
-      }
-
-      if (ret)
-      {
-         *ret = (event == NULL) ? 0 : -EAGAIN;
-      }
-   }
-   return err;
+	cl_int err;
+	struct _starpu_worker *worker = _starpu_get_local_worker_key();
+
+	if (event)
+		_STARPU_TRACE_START_DRIVER_COPY_ASYNC(src_node, dst_node);
+
+	cl_event ev;
+	err = clEnqueueWriteBuffer(transfer_queues[worker->devid], buffer, CL_FALSE, offset, size, ptr, 0, NULL, &ev);
+
+	if (event)
+		_STARPU_TRACE_END_DRIVER_COPY_ASYNC(src_node, dst_node);
+
+	if (STARPU_LIKELY(err == CL_SUCCESS))
+	{
+		if (event == NULL)
+		{
+			/* We want a synchronous copy, let's synchronise the queue */
+			clWaitForEvents(1, &ev);
+			clReleaseEvent(ev);
+		}
+		else
+		{
+			*event = ev;
+		}
+
+		if (ret)
+		{
+			*ret = (event == NULL) ? 0 : -EAGAIN;
+		}
+	}
+	return err;
 }
 
 cl_int starpu_opencl_copy_opencl_to_ram(cl_mem buffer, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *ptr, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, size_t size, size_t offset, cl_event *event, int *ret)
@@ -296,21 +295,22 @@ cl_int starpu_opencl_copy_opencl_to_ram(cl_mem buffer, unsigned src_node STARPU_
 		_STARPU_TRACE_END_DRIVER_COPY_ASYNC(src_node, dst_node);
 	if (STARPU_LIKELY(err == CL_SUCCESS))
 	{
-	  if (event == NULL)
-	  {
-		 /* We want a synchronous copy, let's synchronise the queue */
-		 clWaitForEvents(1, &ev);
-		 clReleaseEvent(ev);
-	 }
-	  else {
-		  *event = ev;
-	  }
-
-	  if (ret)
-	  {
-		 *ret = (event == NULL) ? 0 : -EAGAIN;
-	 }
-  }
+		if (event == NULL)
+		{
+			/* We want a synchronous copy, let's synchronise the queue */
+			clWaitForEvents(1, &ev);
+			clReleaseEvent(ev);
+		}
+		else
+		{
+			*event = ev;
+		}
+
+		if (ret)
+		{
+			*ret = (event == NULL) ? 0 : -EAGAIN;
+		}
+	}
 	return err;
 }
 
@@ -402,7 +402,8 @@ void _starpu_opencl_init(void)
 						platform_valid = 0;
 					}
 				}
-				if(strcmp(name, "SOCL Platform") == 0) {
+				if(strcmp(name, "SOCL Platform") == 0)
+				{
 					platform_valid = 0;
 					_STARPU_DEBUG("Skipping SOCL Platform\n");
 				}
@@ -606,10 +607,11 @@ void *_starpu_opencl_worker(void *arg)
 	struct _starpu_worker* args = arg;
 
 	starpu_opencl_get_device(args->devid, &id);
-	struct starpu_driver d = {
-		.type         = STARPU_OPENCL_WORKER,
-		.id.opencl_id = id
-	};
+	struct starpu_driver d =
+		{
+			.type         = STARPU_OPENCL_WORKER,
+			.id.opencl_id = id
+		};
 
 	_starpu_opencl_driver_init(&d);
 	while (_starpu_machine_is_running())

+ 7 - 4
src/profiling/bound.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2010-2012  Université de Bordeaux 1
  * Copyright (C) 2011  Télécom-SudParis
  *
@@ -537,7 +537,8 @@ void starpu_bound_print_lp(FILE *output)
 		fprintf(output, "\n/* Each task starts after all its task dependencies finish and data is transferred. */\n");
 		fprintf(output, "/* Note that the dependency finish time depends on the worker where it's working */\n");
 		for (t1 = tasks; t1; t1 = t1->next)
-			for (i = 0; i < t1->depsn; i++) {
+			for (i = 0; i < t1->depsn; i++)
+			{
 				fprintf(output, "/* %lu bytes transferred */\n", (unsigned long) t1->deps[i].size);
 				fprintf(output, "s%lu >= c%lu", t1->id, t1->deps[i].dep->id);
 				/* Transfer time: pick up one source node and a worker on it */
@@ -767,10 +768,12 @@ void starpu_bound_print_lp(FILE *output)
 			{
 				int got_one = 0;
 				fprintf(output, "/* task %s key %x */\n0", _starpu_codelet_get_model_name(tp->cl), (unsigned) tp->footprint);
-				for (w = 0; w < nw; w++) {
+				for (w = 0; w < nw; w++)
+				{
 					if (isnan(times[w*nt+t]))
 						fprintf(stderr, "Warning: task %s has no performance measurement for worker %d.\n", _starpu_codelet_get_model_name(tp->cl), w);
-					else {
+					else
+					{
 						got_one = 1;
 						fprintf(output, "\t+w%dt%dn", w, t);
 					}

+ 2 - 1
src/util/starpu_data_cpy.c

@@ -79,7 +79,8 @@ int _starpu_data_cpy(starpu_data_handle_t dst_handle, starpu_data_handle_t src_h
 	STARPU_ASSERT(task);
 
 	struct _starpu_job *j = _starpu_get_job_associated_to_task(task);
-	if (reduction) {
+	if (reduction)
+	{
 		j->reduction_task = reduction;
 		if (reduction_dep_task)
 			starpu_task_declare_deps_array(task, 1, &reduction_dep_task);