Преглед на файлове

Add missing PAPI_shutdown call

Samuel Thibault преди 4 години
родител
ревизия
92f74bec85
променени са 2 файла, в които са добавени 5 реда и са изтрити 3 реда
  1. 0 3
      src/core/perfmodel/energy_model.c
  2. 5 0
      src/profiling/profiling.c

+ 0 - 3
src/core/perfmodel/energy_model.c

@@ -153,9 +153,6 @@ int starpu_energy_stop(struct starpu_perfmodel *model, struct starpu_task *task,
     if ( (retval = PAPI_destroy_eventset(&EventSet)) != PAPI_OK)
       ERROR_RETURN(retval);
 
-    /* free the resources used by PAPI */
-        PAPI_shutdown();
-
 return retval;
  
 }

+ 5 - 0
src/profiling/profiling.c

@@ -240,6 +240,11 @@ void _starpu_profiling_terminate(void)
 	{
 		STARPU_PTHREAD_MUTEX_DESTROY(&worker_info_mutex[worker]);
 	}
+#ifdef STARPU_PAPI
+	/* free the resources used by PAPI */
+	PAPI_shutdown();
+#endif
+
 }
 
 /*