Przeglądaj źródła

starpu_mpi_private.h: only display debug messages if environment variable STARPU_SILENT is not set

Nathalie Furmento 14 lat temu
rodzic
commit
9c9a683354
1 zmienionych plików z 15 dodań i 12 usunięć
  1. 15 12
      mpi/starpu_mpi_private.h

+ 15 - 12
mpi/starpu_mpi_private.h

@@ -29,23 +29,26 @@
 //#define STARPU_MPI_VERBOSE	1
 
 #ifdef STARPU_MPI_VERBOSE
-#  define _STARPU_MPI_DEBUG(fmt, args ...) { int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);                        \
-                                             int yyy; for(yyy=0 ; yyy<=rank ; yyy++) fprintf(stderr, "    ");    \
-                                             fprintf(stderr, "[%d][starpu_mpi][%s] " fmt , rank, __func__ ,##args); \
-                                             fflush(stderr); }
+#  define _STARPU_MPI_DEBUG(fmt, args ...) { if (!getenv("STARPU_SILENT")) { \
+    						int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);                     \
+                                                int yyy; for(yyy=0 ; yyy<=rank ; yyy++) fprintf(stderr, "    ");    \
+                                                fprintf(stderr, "[%d][starpu_mpi][%s] " fmt , rank, __func__ ,##args); \
+                                                fflush(stderr); }}
 #else
 #  define _STARPU_MPI_DEBUG(fmt, args ...)
 #endif
 
 #ifdef STARPU_MPI_VERBOSE0
-#  define _STARPU_MPI_LOG_IN()             { int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);                        \
-                                             int yyy; for(yyy=0 ; yyy<=rank ; yyy++) fprintf(stderr, "    ");      \
-                                             fprintf(stderr, "[%d][starpu_mpi][%s] -->\n", rank, __func__ ); \
-                                             fflush(stderr); }
-#  define _STARPU_MPI_LOG_OUT()            { int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);                        \
-                                             int yyy; for(yyy=0 ; yyy<=rank ; yyy++) fprintf(stderr, "    ");      \
-                                             fprintf(stderr, "[%d][starpu_mpi][%s] <--\n", rank, __func__ ); \
-                                             fflush(stderr); }
+#  define _STARPU_MPI_LOG_IN()             { if (!getenv("STARPU_SILENT")) { \
+                                               int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);                        \
+                                               int yyy; for(yyy=0 ; yyy<=rank ; yyy++) fprintf(stderr, "    ");      \
+                                               fprintf(stderr, "[%d][starpu_mpi][%s] -->\n", rank, __func__ ); \
+                                               fflush(stderr); }}
+#  define _STARPU_MPI_LOG_OUT()            { if (!getenv("STARPU_SILENT")) { \
+                                               int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);                        \
+                                               int yyy; for(yyy=0 ; yyy<=rank ; yyy++) fprintf(stderr, "    ");      \
+                                               fprintf(stderr, "[%d][starpu_mpi][%s] <--\n", rank, __func__ ); \
+                                               fflush(stderr); }}
 #else
 #  define _STARPU_MPI_LOG_IN()
 #  define _STARPU_MPI_LOG_OUT()