Parcourir la source

Clear bound data at shutdown

Samuel Thibault il y a 5 ans
Parent
commit
b8a1169ada
3 fichiers modifiés avec 20 ajouts et 5 suppressions
  1. 3 1
      src/core/workers.c
  2. 13 3
      src/profiling/bound.c
  3. 4 1
      src/profiling/bound.h

+ 3 - 1
src/core/workers.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2019                                Inria
- * Copyright (C) 2008-2019                                Université de Bordeaux
+ * Copyright (C) 2008-2020                                Université de Bordeaux
  * Copyright (C) 2010-2019                                CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis
@@ -36,6 +36,7 @@
 #include <core/detect_combined_workers.h>
 #include <datawizard/malloc.h>
 #include <profiling/profiling.h>
+#include <profiling/bound.h>
 #include <sched_policies/sched_component.h>
 #include <datawizard/memory_nodes.h>
 #include <common/knobs.h>
@@ -1871,6 +1872,7 @@ void starpu_shutdown(void)
 
 	starpu_profiling_bus_helper_display_summary();
 	starpu_profiling_worker_helper_display_summary();
+	starpu_bound_clear();
 
 	_starpu_deinitialize_registered_performance_models();
 

+ 13 - 3
src/profiling/bound.c

@@ -127,8 +127,7 @@ static int recordprio;
 
 static starpu_pthread_mutex_t mutex = STARPU_PTHREAD_MUTEX_INITIALIZER;
 
-/* Initialization */
-void starpu_bound_start(int deps, int prio)
+static void _starpu_bound_clear(int record, int deps, int prio)
 {
 	struct bound_task_pool *tp;
 	struct bound_task *t;
@@ -146,7 +145,7 @@ void starpu_bound_start(int deps, int prio)
 	td = tag_deps;
 	tag_deps = NULL;
 
-	_starpu_bound_recording = 1;
+	_starpu_bound_recording = record;
 	recorddeps = deps;
 	recordprio = prio;
 
@@ -174,6 +173,17 @@ void starpu_bound_start(int deps, int prio)
 	}
 }
 
+void starpu_bound_clear(void)
+{
+	_starpu_bound_clear(0, 0, 0);
+}
+
+/* Initialization */
+void starpu_bound_start(int deps, int prio)
+{
+	_starpu_bound_clear(1, deps, prio);
+}
+
 /* Whether we will include it in the computation */
 static int good_job(struct _starpu_job *j)
 {

+ 4 - 1
src/profiling/bound.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011,2017                                CNRS
- * Copyright (C) 2010-2012,2014                           Université de Bordeaux
+ * Copyright (C) 2010-2012,2014,2020                      Université de Bordeaux
  *
  * 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
@@ -37,4 +37,7 @@ extern void _starpu_bound_task_dep(struct _starpu_job *j, struct _starpu_job *de
 /* Record job id dependency: j depends on job_id */
 extern void _starpu_bound_job_id_dep(starpu_data_handle_t handle, struct _starpu_job *dep_j, unsigned long job_id);
 
+/* Clear recording */
+extern void starpu_bound_clear(void);
+
 #endif // __BOUND_H__