浏览代码

following coding conventions for curly braces

Nathalie Furmento 8 年之前
父节点
当前提交
745bb67c1f
共有 4 个文件被更改,包括 38 次插入25 次删除
  1. 19 10
      examples/heat/dw_sparse_cg.c
  2. 3 2
      mpi/examples/mpi_lu/pxlu.h
  3. 4 2
      src/core/workers.h
  4. 12 11
      src/sched_policies/component_mct.c

+ 19 - 10
examples/heat/dw_sparse_cg.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2011, 2015, 2017  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2016, 2017  CNRS
  *
  * 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
@@ -127,21 +127,24 @@ void init_problem(void)
  *	cg initialization phase
  */
 
-static struct starpu_codelet cl1 = {
+static struct starpu_codelet cl1 =
+{
 	.cpu_funcs = { cpu_codelet_func_1 },
 	.cpu_funcs_name = { "cpu_codelet_func_1" },
 	.nbuffers = 4,
 	.modes = { STARPU_R, STARPU_R, STARPU_W, STARPU_R },
 };
 
-static struct starpu_codelet cl2 = {
+static struct starpu_codelet cl2 =
+{
 	.cpu_funcs = { cpu_codelet_func_2 },
 	.cpu_funcs_name = { "cpu_codelet_func_2" },
 	.nbuffers = 2,
 	.modes = { STARPU_W, STARPU_R },
 };
 
-static struct starpu_codelet cl3 = {
+static struct starpu_codelet cl3 =
+{
 	.cpu_funcs = { cpu_codelet_func_3 },
 	.cpu_funcs_name = { "cpu_codelet_func_3" },
 #ifdef STARPU_USE_CUDA
@@ -205,14 +208,16 @@ void init_cg(struct cg_problem *problem)
  *		the codelet code launcher is its own callback !
  */
 
-static struct starpu_codelet cl4 = {
+static struct starpu_codelet cl4 =
+{
 	.cpu_funcs = { cpu_codelet_func_4 },
 	.cpu_funcs_name = { "cpu_codelet_func_4" },
 	.nbuffers = 3,
 	.modes = { STARPU_R, STARPU_R, STARPU_W },
 };
 
-static struct starpu_codelet cl5 = {
+static struct starpu_codelet cl5 =
+{
 	.cpu_funcs = { cpu_codelet_func_5 },
 	.cpu_funcs_name = { "cpu_codelet_func_5" },
 #ifdef STARPU_USE_CUDA
@@ -222,7 +227,8 @@ static struct starpu_codelet cl5 = {
 	.modes = { STARPU_R, STARPU_R },
 };
 
-static struct starpu_codelet cl6 = {
+static struct starpu_codelet cl6 =
+{
 	.cpu_funcs = { cpu_codelet_func_6 },
 	.cpu_funcs_name = { "cpu_codelet_func_6" },
 #ifdef STARPU_USE_CUDA
@@ -233,7 +239,8 @@ static struct starpu_codelet cl6 = {
 	.modes = { STARPU_RW, STARPU_R },
 };
 
-static struct starpu_codelet cl7 = {
+static struct starpu_codelet cl7 =
+{
 	.cpu_funcs = { cpu_codelet_func_7 },
 	.cpu_funcs_name = { "cpu_codelet_func_7" },
 #ifdef STARPU_USE_CUDA
@@ -244,7 +251,8 @@ static struct starpu_codelet cl7 = {
 	.modes = { STARPU_RW, STARPU_R },
 };
 
-static struct starpu_codelet cl8 = {
+static struct starpu_codelet cl8 =
+{
 	.cpu_funcs = { cpu_codelet_func_8 },
 	.cpu_funcs_name = { "cpu_codelet_func_8" },
 #ifdef STARPU_USE_CUDA
@@ -254,7 +262,8 @@ static struct starpu_codelet cl8 = {
 	.modes = { STARPU_R },
 };
 
-static struct starpu_codelet cl9 = {
+static struct starpu_codelet cl9 =
+{
 	.cpu_funcs = { cpu_codelet_func_9 },
 	.cpu_funcs_name = { "cpu_codelet_func_9" },
 #ifdef STARPU_USE_CUDA

+ 3 - 2
mpi/examples/mpi_lu/pxlu.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2014  Université de Bordeaux
- * Copyright (C) 2010, 2012, 2014  CNRS
+ * Copyright (C) 2010, 2012, 2014, 2017  CNRS
  *
  * 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
@@ -31,7 +31,8 @@
 //#define SINGLE_TMP11	1
 //#define SINGLE_TMP1221	1
 
-struct debug_info {
+struct debug_info
+{
 	unsigned i;
 	unsigned j;
 	unsigned k;

+ 4 - 2
src/core/workers.h

@@ -398,7 +398,8 @@ struct _starpu_machine_config
 	struct _starpu_combined_worker combined_workers[STARPU_NMAX_COMBINEDWORKERS];
 
 	/* Translation table from bindid to worker IDs */
-	struct {
+	struct
+	{
 		int *workerids;
 		unsigned nworkers; /* size of workerids */
 	} *bindid_workers;
@@ -1038,7 +1039,8 @@ static inline int _starpu_worker_trylock(int workerid)
 	int cur_workerid = starpu_worker_get_id();
 	if (!ret)
 	{
-		if (workerid != cur_workerid) {
+		if (workerid != cur_workerid)
+		{
 			ret = !worker->state_relax_refcnt;
 			if (ret)
 				STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(&worker->sched_mutex);

+ 12 - 11
src/sched_policies/component_mct.c

@@ -66,10 +66,10 @@ static int mct_push_task(struct starpu_sched_component * component, struct starp
 
 	/* Entering critical section to make sure no two workers
 	   make scheduling decisions at the same time */
-	STARPU_COMPONENT_MUTEX_LOCK(&d->scheduling_mutex); 
+	STARPU_COMPONENT_MUTEX_LOCK(&d->scheduling_mutex);
 
 
-	starpu_mct_compute_expected_times(component, task, estimated_lengths, estimated_transfer_length, 
+	starpu_mct_compute_expected_times(component, task, estimated_lengths, estimated_transfer_length,
 					  estimated_ends_with_task, &min_exp_end_with_task, &max_exp_end_with_task, suitable_components, nsuitable_components);
 
 	double best_fitness = DBL_MAX;
@@ -98,8 +98,9 @@ static int mct_push_task(struct starpu_sched_component * component, struct starp
 	 * the task had been purged since it has been pushed on the mct component.
 	 * We should send a push_fail message to its parent so that it will
 	 * be able to reschedule the task properly. */
-	if(best_icomponent == -1) {
-		STARPU_COMPONENT_MUTEX_UNLOCK(&d->scheduling_mutex); 
+	if(best_icomponent == -1)
+	{
+		STARPU_COMPONENT_MUTEX_UNLOCK(&d->scheduling_mutex);
 		return 1;
 	}
 
@@ -111,17 +112,17 @@ static int mct_push_task(struct starpu_sched_component * component, struct starp
 	if(starpu_sched_component_is_worker(best_component))
 	{
 		best_component->can_pull(best_component);
-		STARPU_COMPONENT_MUTEX_UNLOCK(&d->scheduling_mutex); 
-		
+		STARPU_COMPONENT_MUTEX_UNLOCK(&d->scheduling_mutex);
+
 		return 1;
 	}
 
 	_STARPU_TASK_BREAK_ON(task, sched);
 	int ret = starpu_sched_component_push_task(component, best_component, task);
-	
-	/* I can now exit the critical section: Pushing the task below ensures that its execution 
+
+	/* I can now exit the critical section: Pushing the task below ensures that its execution
 	   time will be taken into account for subsequent scheduling decisions */
-	STARPU_COMPONENT_MUTEX_UNLOCK(&d->scheduling_mutex); 
+	STARPU_COMPONENT_MUTEX_UNLOCK(&d->scheduling_mutex);
 
 	return ret;
 }
@@ -130,7 +131,7 @@ static void mct_component_deinit_data(struct starpu_sched_component * component)
 {
 	STARPU_ASSERT(starpu_sched_component_is_mct(component));
 	struct _starpu_mct_data * d = component->data;
-	STARPU_PTHREAD_MUTEX_DESTROY(&d->scheduling_mutex); 
+	STARPU_PTHREAD_MUTEX_DESTROY(&d->scheduling_mutex);
 	free(d);
 }
 
@@ -145,7 +146,7 @@ struct starpu_sched_component * starpu_sched_component_mct_create(struct starpu_
 	struct _starpu_mct_data *data = starpu_mct_init_parameters(params);
 
 	component->data = data;
-	STARPU_PTHREAD_MUTEX_INIT(&data->scheduling_mutex, NULL); 
+	STARPU_PTHREAD_MUTEX_INIT(&data->scheduling_mutex, NULL);
 
 	component->push_task = mct_push_task;
 	component->deinit_data = mct_component_deinit_data;