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

src/common/utils.h: _STARPU_DEBUG does not display any message if the environment variable STARPU_SILENT is set

Nathalie Furmento преди 14 години
родител
ревизия
943e64c831
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      src/common/utils.h

+ 2 - 1
src/common/utils.h

@@ -23,9 +23,10 @@
 #include <string.h>
 #include <pthread.h>
 #include <common/barrier.h>
+#include <stdlib.h>
 
 #ifdef STARPU_VERBOSE
-#  define _STARPU_DEBUG(fmt, args ...) fprintf(stderr, "[starpu][%s] " fmt ,__func__ ,##args)
+#  define _STARPU_DEBUG(fmt, args ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%s] " fmt ,__func__ ,##args); }} while(0)
 #else
 #  define _STARPU_DEBUG(fmt, args ...)
 #endif