ソースを参照

fix code format

Nathalie Furmento 4 年 前
コミット
9864f45539

+ 2 - 1
examples/tag_example/tag_example.c

@@ -223,7 +223,8 @@ int main(int argc, char **argv)
 	int ret;
 
 #ifdef STARPU_HAVE_HELGRIND_H
-	if (RUNNING_ON_VALGRIND) {
+	if (RUNNING_ON_VALGRIND)
+	{
 		ni /= 2;
 		nj /= 2;
 		nk /= 2;

+ 4 - 2
src/common/rbtree_i.h

@@ -44,7 +44,8 @@
  * architectures, as long as the nodes aren't embedded in structures with
  * special alignment constraints such as member packing.
  */
-struct starpu_rbtree_node {
+struct starpu_rbtree_node
+{
     uintptr_t parent;
     struct starpu_rbtree_node *children[2];
 };
@@ -52,7 +53,8 @@ struct starpu_rbtree_node {
 /**
  * Red-black tree structure.
  */
-struct starpu_rbtree {
+struct starpu_rbtree
+{
     struct starpu_rbtree_node *root;
 };
 

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

@@ -221,7 +221,8 @@ void _starpu_notify_cg(void *pred STARPU_ATTRIBUTE_UNUSED, struct _starpu_cg *cg
 					tag_successors->ndeps_completed = 0;
 					/* This releases the lock */
 					_starpu_tag_set_ready(tag);
-				} else
+				}
+				else
 					_starpu_spin_unlock(&tag->lock);
 				break;
 			}

+ 5 - 2
src/core/perfmodel/energy_model.c

@@ -56,8 +56,11 @@ static const int N_EVTS = 2;
 
 static int nsockets;
 
-static const char* event_names[] = { "rapl::RAPL_ENERGY_PKG:cpu=%d",
-				     "rapl::RAPL_ENERGY_DRAM:cpu=%d"};
+static const char* event_names[] =
+{
+	"rapl::RAPL_ENERGY_PKG:cpu=%d",
+	"rapl::RAPL_ENERGY_DRAM:cpu=%d"
+};
 
 static int add_event(int EventSet, int socket);
 

+ 4 - 3
src/core/perfmodel/perfmodel_history.c

@@ -1243,7 +1243,8 @@ void _starpu_initialize_registered_performance_models(void)
 	historymaxerror = starpu_get_env_number_default("STARPU_HISTORY_MAX_ERROR", STARPU_HISTORYMAXERROR);
 	_starpu_calibration_minimum = starpu_get_env_number_default("STARPU_CALIBRATE_MINIMUM", 10);
 
-	for (archtype = 0; archtype < STARPU_NARCH; archtype++) {
+	for (archtype = 0; archtype < STARPU_NARCH; archtype++)
+	{
 		char name[128];
 		const char *arch = starpu_worker_get_type_as_env_var(archtype);
 		int def = archtype == STARPU_CPU_WORKER ? 1 : 0;
@@ -1518,8 +1519,8 @@ int starpu_perfmodel_unload_model(struct starpu_perfmodel *model)
 	return 0;
 }
 
-int starpu_perfmodel_deinit(struct starpu_perfmodel *model){
-
+int starpu_perfmodel_deinit(struct starpu_perfmodel *model)
+{
 	_starpu_deinitialize_performance_model(model);
 	free(model->state);
 	model->state = NULL;

+ 2 - 1
src/core/sched_policy.c

@@ -632,7 +632,8 @@ int _starpu_push_task_to_workers(struct starpu_task *task)
 				enum starpu_worker_archtype type;
 				for (type = 0; type < STARPU_NARCH; type++)
 				{
-					if (task->where == (int32_t) STARPU_WORKER_TO_MASK(type)) {
+					if (task->where == (int32_t) STARPU_WORKER_TO_MASK(type))
+					{
 						if (config->arch_nodeid[type] >= 0)
 							starpu_prefetch_task_input_on_node(task, config->arch_nodeid[type]);
 						break;

+ 2 - 1
src/core/simgrid.c

@@ -360,7 +360,8 @@ void _starpu_start_simgrid(int *argc, char **argv)
 #ifdef HAVE_SG_LINK_BANDWIDTH_SET
 		sg_link_t *links = sg_link_list();
 		int count = sg_link_count(), i;
-		for (i = 0; i < count; i++) {
+		for (i = 0; i < count; i++)
+		{
 			sg_link_bandwidth_set(links[i], limit_bandwidth * 1000000.);
 		}
 #else

+ 2 - 1
src/core/workers.c

@@ -1402,7 +1402,8 @@ int _starpu_get_catch_signals(void)
 	return _starpu_config.conf.catch_signals;
 }
 
-void starpu_drivers_preinit(void) {
+void starpu_drivers_preinit(void)
+{
 	_starpu_cpu_preinit();
 	_starpu_cuda_preinit();
 	_starpu_opencl_preinit();

+ 4 - 2
src/core/workers.h

@@ -416,7 +416,8 @@ struct _starpu_machine_config
 };
 
 /** Provides information for a device driver */
-struct starpu_driver_info {
+struct starpu_driver_info
+{
 	const char *name_upper;	/**< Name of worker type in upper case */
 	const char *name_var;	/**< Name of worker type for environment variables */
 	const char *name_lower;	/**< Name of worker type in lower case */
@@ -430,7 +431,8 @@ extern struct starpu_driver_info starpu_driver_info[STARPU_NARCH];
 void starpu_driver_info_register(enum starpu_worker_archtype archtype, const struct starpu_driver_info *info);
 
 /** Provides information for a memory node driver */
-struct starpu_memory_driver_info {
+struct starpu_memory_driver_info
+{
 	const char *name_upper;	/**< Name of memory in upper case */
 	enum starpu_worker_archtype worker_archtype;	/**< Kind of device */
 };

+ 4 - 2
src/datawizard/memalloc.c

@@ -1513,7 +1513,8 @@ static starpu_ssize_t _starpu_allocate_interface(starpu_data_handle_t handle, st
 			/* First try to flush data explicitly marked for freeing */
 			size_t freed = flush_memchunk_cache(dst_node, reclaim);
 
-			if (freed >= reclaim) {
+			if (freed >= reclaim)
+			{
 				/* That freed enough data, retry allocating */
 				prefetch_out_of_memory[dst_node] = 0;
 				continue;
@@ -1550,7 +1551,8 @@ static starpu_ssize_t _starpu_allocate_interface(starpu_data_handle_t handle, st
 			_starpu_memory_reclaim_generic(dst_node, 0, reclaim);
 			_STARPU_TRACE_END_MEMRECLAIM(dst_node,is_prefetch);
 			prefetch_out_of_memory[dst_node] = 0;
-		} else
+		}
+		else
 			prefetch_out_of_memory[dst_node] = 0;
 	}
 	while((allocated_memory == -ENOMEM) && attempts++ < 2);

+ 2 - 1
src/datawizard/memory_nodes.c

@@ -180,7 +180,8 @@ int starpu_memory_node_get_devid(unsigned node)
 	return _starpu_descr.devid[node];
 }
 
-enum starpu_worker_archtype starpu_memory_node_get_worker_archtype(enum starpu_node_kind node_kind) {
+enum starpu_worker_archtype starpu_memory_node_get_worker_archtype(enum starpu_node_kind node_kind)
+{
 	enum starpu_worker_archtype archtype = starpu_memory_driver_info[node_kind].worker_archtype;
 	STARPU_ASSERT_MSG(archtype != (enum starpu_worker_archtype) -1, "ambiguous memory node kind %d", node_kind);
 	return archtype;

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

@@ -193,7 +193,8 @@ static void task_dump(struct task_info *task, struct starpu_fxt_options *options
 		fprintf(tasks_file, "Name: %s\n", task->name);
 	if (task->model_name)
 		fprintf(tasks_file, "Model: %s\n", task->model_name);
-	if (task->file) {
+	if (task->file)
+	{
 		fprintf(tasks_file, "File: %s\n", task->file);
 		fprintf(tasks_file, "Line: %d\n", task->line);
 	}
@@ -4129,7 +4130,8 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 
 	if (out_paje_file && !options->no_bus)
 	{
-		while (!_starpu_communication_list_empty(&communication_list)) {
+		while (!_starpu_communication_list_empty(&communication_list))
+		{
 			struct _starpu_communication*itor;
 			itor = _starpu_communication_list_pop_front(&communication_list);
 

+ 4 - 2
src/drivers/cpu/driver_cpu.c

@@ -59,7 +59,8 @@
 #include <windows.h>
 #endif
 
-static struct starpu_driver_info driver_info = {
+static struct starpu_driver_info driver_info =
+{
 	.name_upper = "CPU",
 	.name_var = "CPU",
 	.name_lower = "cpu",
@@ -67,7 +68,8 @@ static struct starpu_driver_info driver_info = {
 	.alpha = 0.5f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info = {
+static struct starpu_memory_driver_info memory_driver_info =
+{
 	.name_upper = "NUMA",
 	.worker_archtype = STARPU_CPU_WORKER,
 };

+ 4 - 2
src/drivers/cuda/driver_cuda_init.c

@@ -17,7 +17,8 @@
 #include <core/workers.h>
 #include <drivers/cuda/driver_cuda.h>
 
-static struct starpu_driver_info driver_info = {
+static struct starpu_driver_info driver_info =
+{
 	.name_upper = "CUDA",
 	.name_var = "CUDA",
 	.name_lower = "cuda",
@@ -25,7 +26,8 @@ static struct starpu_driver_info driver_info = {
 	.alpha = 13.33f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info = {
+static struct starpu_memory_driver_info memory_driver_info =
+{
 	.name_upper = "CUDA",
 	.worker_archtype = STARPU_CUDA_WORKER,
 };

+ 2 - 1
src/drivers/disk/driver_disk.c

@@ -23,7 +23,8 @@
 #include <datawizard/coherency.h>
 #include <datawizard/memory_nodes.h>
 
-static struct starpu_memory_driver_info memory_driver_info = {
+static struct starpu_memory_driver_info memory_driver_info =
+{
 	.name_upper = "Disk",
 	.worker_archtype = (enum starpu_worker_archtype) -1,
 };

+ 4 - 2
src/drivers/mic/driver_mic_init.c

@@ -17,7 +17,8 @@
 #include <core/workers.h>
 #include <drivers/mic/driver_mic_source.h>
 
-static struct starpu_driver_info driver_info = {
+static struct starpu_driver_info driver_info =
+{
 	.name_upper = "MIC",
 	.name_var = "MIC",
 	.name_lower = "mic",
@@ -25,7 +26,8 @@ static struct starpu_driver_info driver_info = {
 	.alpha = 0.5f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info = {
+static struct starpu_memory_driver_info memory_driver_info =
+{
 	.name_upper = "MIC",
 	.worker_archtype = STARPU_MIC_WORKER,
 };

+ 4 - 2
src/drivers/mpi/driver_mpi_init.c

@@ -17,7 +17,8 @@
 #include <core/workers.h>
 #include <drivers/mpi/driver_mpi_source.h>
 
-static struct starpu_driver_info driver_info = {
+static struct starpu_driver_info driver_info =
+{
 	.name_upper = "MPI_MS",
 	.name_var = "MPI_MS",
 	.name_lower = "mpi_ms",
@@ -25,7 +26,8 @@ static struct starpu_driver_info driver_info = {
 	.alpha = 1.0f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info = {
+static struct starpu_memory_driver_info memory_driver_info =
+{
 	.name_upper = "MPI_MS",
 	.worker_archtype = STARPU_MPI_MS_WORKER,
 };

+ 4 - 2
src/drivers/opencl/driver_opencl_init.c

@@ -17,7 +17,8 @@
 #include <core/workers.h>
 #include <drivers/opencl/driver_opencl.h>
 
-static struct starpu_driver_info driver_info = {
+static struct starpu_driver_info driver_info =
+{
 	.name_upper = "OpenCL",
 	.name_var = "OPENCL",
 	.name_lower = "opencl",
@@ -25,7 +26,8 @@ static struct starpu_driver_info driver_info = {
 	.alpha = 12.22f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info = {
+static struct starpu_memory_driver_info memory_driver_info =
+{
 	.name_upper = "OpenCL",
 	.worker_archtype = STARPU_OPENCL_WORKER,
 };

+ 2 - 1
src/sched_policies/work_stealing_policy.c

@@ -145,7 +145,8 @@ static int select_victim_round_robin(struct _starpu_work_stealing_data *ws, unsi
 		if (!ws->per_worker[workerids[worker]].notask)
 		{
 			if (ws->per_worker[workerids[worker]].busy
-						   || starpu_worker_is_blocked_in_parallel(workerids[worker])) {
+			    || starpu_worker_is_blocked_in_parallel(workerids[worker]))
+			{
 				ntasks = 1;
 				break;
 			}

+ 6 - 4
src/util/starpu_data_cpy.c

@@ -86,7 +86,7 @@ void mp_cpy_kernel(void *descr[], void *cl_arg)
 
 	const struct starpu_data_interface_ops *interface_ops = _starpu_data_interface_get_ops(interface_id);
 	const struct starpu_data_copy_methods *copy_methods = interface_ops->copy_methods;
-	
+
 	void *dst_interface = descr[0];
 	void *src_interface = descr[1];
 
@@ -151,7 +151,7 @@ int _starpu_data_cpy(starpu_data_handle_t dst_handle, starpu_data_handle_t src_h
 
 	unsigned *interface_id;
 	_STARPU_MALLOC(interface_id, sizeof(*interface_id));
-	*interface_id = dst_handle->ops->interfaceid; 
+	*interface_id = dst_handle->ops->interfaceid;
 	task->cl_arg = interface_id;
 	task->cl_arg_size = sizeof(*interface_id);
 	task->cl_arg_free = 1;
@@ -181,7 +181,8 @@ int starpu_data_cpy(starpu_data_handle_t dst_handle, starpu_data_handle_t src_ha
 int starpu_data_dup_ro(starpu_data_handle_t *dst_handle, starpu_data_handle_t src_handle, int asynchronous)
 {
 	_starpu_spin_lock(&src_handle->header_lock);
-	if (src_handle->readonly_dup) {
+	if (src_handle->readonly_dup)
+	{
 		/* Already a ro duplicate, just return it with one more ref */
 		*dst_handle = src_handle->readonly_dup;
 		_starpu_spin_unlock(&src_handle->header_lock);
@@ -190,7 +191,8 @@ int starpu_data_dup_ro(starpu_data_handle_t *dst_handle, starpu_data_handle_t sr
 		_starpu_spin_unlock(&(*dst_handle)->header_lock);
 		return 0;
 	}
-	if (src_handle->readonly) {
+	if (src_handle->readonly)
+	{
 		src_handle->aliases++;
 		_starpu_spin_unlock(&src_handle->header_lock);
 		*dst_handle = src_handle;

+ 2 - 1
tests/datawizard/bcsr.c

@@ -123,7 +123,8 @@ int main(int argc, char **argv)
 	if (starpu_initialize(&conf, &argc, &argv) == -ENODEV)
 		return STARPU_TEST_SKIPPED;
 
-	if (starpu_cpu_worker_get_count() == 0 || starpu_memory_nodes_get_count() > 1) {
+	if (starpu_cpu_worker_get_count() == 0 || starpu_memory_nodes_get_count() > 1)
+	{
 		starpu_shutdown();
 		return STARPU_TEST_SKIPPED;
 	}

+ 2 - 1
tests/microbenchs/bandwidth.c

@@ -170,7 +170,8 @@ static unsigned interleave(unsigned i)
 		return 0;
 }
 
-enum sleep_type {
+enum sleep_type
+{
 	PAUSE,
 	NOP,
 	SYNC,