From c9ef117521fed588ab8e28c37909a44e0744bbc7 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Wed, 21 Jun 2017 13:59:37 +0200
Subject: [PATCH] Propose a second more complete patch to Fix #38

---
 include/chameleon_config.h.in            | 5 ++++-
 include/runtime.h                        | 5 -----
 runtime/parsec/control/runtime_control.c | 4 +---
 runtime/quark/control/runtime_control.c  | 4 +---
 runtime/starpu/control/runtime_control.c | 3 +--
 5 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/include/chameleon_config.h.in b/include/chameleon_config.h.in
index d6c819fc6..229c8cd32 100644
--- a/include/chameleon_config.h.in
+++ b/include/chameleon_config.h.in
@@ -42,7 +42,10 @@
 #cmakedefine CHAMELEON_USE_CUBLAS
 #cmakedefine CHAMELEON_USE_CUBLAS_V2
 
-/* Simulating */
+/* Simulation */
 #cmakedefine CHAMELEON_SIMULATION
 
+/* Tracing support */
+#cmakedefine CHAMELEON_ENABLE_TRACING
+
 #endif  /* CHAMELEON_CONFIG_H_HAS_BEEN_INCLUDED */
diff --git a/include/runtime.h b/include/runtime.h
index ff6728d68..ee20cfe36 100644
--- a/include/runtime.h
+++ b/include/runtime.h
@@ -52,13 +52,8 @@ int   RUNTIME_rank               (MORSE_context_t*);
 int   RUNTIME_init_scheduler     (MORSE_context_t*, int, int, int);
 void  RUNTIME_finalize_scheduler (MORSE_context_t*);
 void  RUNTIME_barrier            (MORSE_context_t*);
-#ifdef CHAMELEON_ENABLE_TRACING
 void  RUNTIME_iteration_push     (MORSE_context_t*, unsigned long iteration);
 void  RUNTIME_iteration_pop      (MORSE_context_t*);
-#else
-#define RUNTIME_iteration_push(c,i) ((void)0)
-#define RUNTIME_iteration_pop(c)    ((void)0)
-#endif
 void  RUNTIME_pause              (MORSE_context_t*);
 void  RUNTIME_resume             (MORSE_context_t*);
 void  RUNTIME_comm_rank          (int*);
diff --git a/runtime/parsec/control/runtime_control.c b/runtime/parsec/control/runtime_control.c
index ff6f31ab5..9e6c2a3b1 100644
--- a/runtime/parsec/control/runtime_control.c
+++ b/runtime/parsec/control/runtime_control.c
@@ -70,10 +70,9 @@ void RUNTIME_barrier(MORSE_context_t *morse)
 /*******************************************************************************
  *  Set iteration numbers for traces
  **/
-#ifdef CHAMELEON_ENABLE_TRACING
 void RUNTIME_iteration_push( MORSE_context_t *morse, unsigned long iteration )
 {
-    (void)morse;
+    (void)morse; (void)iteration;
     return;
 }
 void RUNTIME_iteration_pop( MORSE_context_t *morse )
@@ -81,7 +80,6 @@ void RUNTIME_iteration_pop( MORSE_context_t *morse )
     (void)morse;
     return;
 }
-#endif
 
 /*******************************************************************************
  *  To suspend the processing of new tasks by workers
diff --git a/runtime/quark/control/runtime_control.c b/runtime/quark/control/runtime_control.c
index 61a7c2c11..fc4639fbe 100644
--- a/runtime/quark/control/runtime_control.c
+++ b/runtime/quark/control/runtime_control.c
@@ -71,10 +71,9 @@ void RUNTIME_finalize_scheduler(MORSE_context_t *morse)
 /*******************************************************************************
  *  Set iteration numbers for traces
  **/
-#ifdef CHAMELEON_ENABLE_TRACING
 void RUNTIME_iteration_push( MORSE_context_t *morse, unsigned long iteration )
 {
-    (void)morse;
+    (void)morse; (void)iteration;
     return;
 }
 void RUNTIME_iteration_pop( MORSE_context_t *morse )
@@ -82,7 +81,6 @@ void RUNTIME_iteration_pop( MORSE_context_t *morse )
     (void)morse;
     return;
 }
-#endif
 
 /*******************************************************************************
  *  To suspend the processing of new tasks by workers
diff --git a/runtime/starpu/control/runtime_control.c b/runtime/starpu/control/runtime_control.c
index 86dc16905..c1c83499b 100644
--- a/runtime/starpu/control/runtime_control.c
+++ b/runtime/starpu/control/runtime_control.c
@@ -172,7 +172,6 @@ void RUNTIME_barrier( MORSE_context_t *morse )
 /*******************************************************************************
  *  Set iteration numbers for traces
  **/
-#ifdef CHAMELEON_ENABLE_TRACING
 void RUNTIME_iteration_push( MORSE_context_t *morse, unsigned long iteration )
 {
     (void)morse;
@@ -180,6 +179,7 @@ void RUNTIME_iteration_push( MORSE_context_t *morse, unsigned long iteration )
     starpu_iteration_push(iteration);
 #endif
 }
+
 void RUNTIME_iteration_pop( MORSE_context_t *morse )
 {
     (void)morse;
@@ -187,7 +187,6 @@ void RUNTIME_iteration_pop( MORSE_context_t *morse )
     starpu_iteration_pop();
 #endif
 }
-#endif
 
 /*******************************************************************************
  *  To suspend the processing of new tasks by workers
-- 
GitLab