Ignore:
Timestamp:
Mar 29, 2013, 5:03:13 PM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
f57182
Parents:
5ba22b
Message:

vmg: Work on output verbosity.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@2845 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/comm/comm_mpi.cpp

    r5ba22b rd13e27  
    344344}
    345345
    346 void CommMPI::PrintString(const char* format, ...)
    347 {
    348   va_list args;
    349   va_start(args, format);
    350   vsprintf(print_buffer, format, args);
    351   printf("VMG: Rank %d: %s\n", GlobalRank(), print_buffer);
    352   va_end(args);
    353 }
    354 
    355 void CommMPI::PrintStringOnce(const char* format, ...)
    356 {
    357   if (GlobalRank() == 0) {
     346void CommMPI::Print(const OutputLevel level, const char* format, ...)
     347{
     348  bool print = (level == Output);
     349
     350#ifdef OUTPUT_INFO
     351  print |= (level == Info);
     352#endif
     353#ifdef OUTPUT_DEBUG
     354  print |= (level == Debug);
     355#endif
     356#ifdef OUTPUT_TIMING
     357  print |= (level == Timing);
     358#endif
     359
     360  if (print) {
     361    va_list args;
     362    va_start(args, format);
     363    vsprintf(print_buffer, format, args);
     364    printf("VMG: Rank %d: %s\n", GlobalRank(), print_buffer);
     365    va_end(args);
     366  }
     367}
     368
     369void CommMPI::PrintOnce(const OutputLevel level, const char* format, ...)
     370{
     371  bool print = (level == Output);
     372
     373#ifdef OUTPUT_INFO
     374  print |= (level == Info);
     375#endif
     376#ifdef OUTPUT_DEBUG
     377  print |= (level == Debug);
     378#endif
     379#ifdef OUTPUT_TIMING
     380  print |= (level == Timing);
     381#endif
     382
     383  if (GlobalRank() == 0 && print) {
    358384    va_list args;
    359385    va_start(args, format);
     
    900926    }
    901927
    902 #ifdef DEBUG_OUTPUT
     928#ifdef OUTPUT_DEBUG
    903929    if (rank == 0)
    904       std::printf("Dims: %d %d %d\n", dims[0], dims[1], dims[2]);
     930      std::printf("Process grid: %d %d %d\n", dims[0], dims[1], dims[2]);
    905931#endif
    906932
Note: See TracChangeset for help on using the changeset viewer.