Browse Source

tools: minor fixes to follow coding conventions

Nathalie Furmento 7 years ago
parent
commit
3846498570
2 changed files with 30 additions and 17 deletions
  1. 12 7
      tools/starpu_perfmodel_recdump.c
  2. 18 10
      tools/starpu_replay.c

+ 12 - 7
tools/starpu_perfmodel_recdump.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2017                                     Inria
- * Copyright (C) 2011-2014,2016-2017                      CNRS
+ * Copyright (C) 2011-2014,2016-2018                      CNRS
  * Copyright (C) 2011,2013-2014,2017                      Université de Bordeaux
  * Copyright (C) 2011                                     Télécom-SudParis
  *
@@ -92,21 +92,26 @@ void print_archs(FILE* output)
 		struct starpu_perfmodel_arch* arch = starpu_worker_get_perf_archtype(workerid, STARPU_NMAX_SCHED_CTXS);
 		comb = starpu_perfmodel_arch_comb_get(arch->ndevices, arch->devices);
 		STARPU_ASSERT(comb >= 0);
-		if(comb != old_comb) {
-			if(nb_workers > 0) {
+		if(comb != old_comb)
+		{
+			if(nb_workers > 0)
+			{
 				char name[32];
 				get_comb_name(old_comb, name, 32);
 				fprintf(output, "Architecture: %s\n", name);
 				fprintf(output, "NbWorkers: %d\n\n", nb_workers);
 			}
 			old_comb = comb;
-			nb_workers = 1; 
-		} else {
-			nb_workers += 1; 
+			nb_workers = 1;
+		}
+		else
+		{
+			nb_workers += 1;
 		}
 	}
 
-	if(nb_workers > 0) {
+	if(nb_workers > 0)
+	{
 		char name[32];
 		get_comb_name(old_comb, name, 32);
 		fprintf(output, "Architecture: %s\n", name);

+ 18 - 10
tools/starpu_replay.c

@@ -354,7 +354,7 @@ int submit_tasks(void)
 			{
 				struct starpu_task * taskdeps[currentTask->ndependson];
 				unsigned i, j = 0;
-				
+
 				for (i = 0; i < currentTask->ndependson; i++)
 				{
 					struct task * taskdep;
@@ -362,9 +362,10 @@ int submit_tasks(void)
 					/*  Get the ith jobid of deps_jobid */
 					HASH_FIND(hh, tasks, &currentTask->deps[i], sizeof(jobid), taskdep);
 
-					if(taskdep) {
+					if(taskdep)
+					{
 						taskdeps[j] = &taskdep->task;
-						j ++; 
+						j ++;
 					}
 				}
 
@@ -380,7 +381,8 @@ int submit_tasks(void)
 			if (!(currentTask->iteration == -1))
 				starpu_iteration_pop();
 
-			if (ret_val != 0) {
+			if (ret_val != 0)
+			{
 				printf("\nWhile submitting task %lu: return %d\n", currentTask->submit_order, ret_val);
 				return -1;
 			}
@@ -436,7 +438,8 @@ int main(int argc, char **argv)
 	_STARPU_MALLOC(dependson, dependson_size * sizeof (* dependson));
 	alloc_mode = 1;
 
-	for (i = 1; i < (unsigned) argc; i++) {
+	for (i = 1; i < (unsigned) argc; i++)
+	{
 		if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h"))
 		{
 			usage(argv[0]);
@@ -475,8 +478,8 @@ int main(int argc, char **argv)
 	/* Read line by line, and on empty line submit the task with the accumulated information */
 	reset();
 
-	double start = starpu_timing_now(); 
-	
+	double start = starpu_timing_now();
+
 	while(1)
 	{
 		char *ln;
@@ -546,7 +549,8 @@ int main(int argc, char **argv)
 				{
 					task->task.priority = priority;
 					task->task.cl = &cl;
-					if (static_workerid) {
+					if (static_workerid)
+					{
 						task->task.workerid = workerid;
 						task->task.execute_on_a_specific_worker = 1;
 					}
@@ -686,9 +690,13 @@ int main(int argc, char **argv)
 			}
 		}
 		else if (TEST("Tag"))
+		{
 			tag = strtol(s+5, NULL, 16);
+		}
 		else if (TEST("WorkerId"))
+		{
 			workerid = atoi(s+10);
+		}
 		else if (TEST("Footprint"))
 		{
 			footprint = strtoul(s+11, NULL, 16);
@@ -822,8 +830,8 @@ eof:
 
 	starpu_task_wait_for_all();
 
-	printf("Simulation ended. Elapsed time: %g µs\n", starpu_timing_now() - start); 
-	
+	printf("Simulation ended. Elapsed time: %g µs\n", starpu_timing_now() - start);
+
 	/* FREE allocated memory */
 
 	free(dependson);