CmPA / iPic3D

Particle-in-Cell code using the implicit moment method
72 stars 55 forks source link

create dprint* macros for efficient debug #16

Open alecjohnson opened 11 years ago

alecjohnson commented 11 years ago

I have implemented macros such as

  dprintf(format_string, ....)

which print the function, file, line, and message when debug is turned on. Processor rank is prefixed to the message.

In addition, I have implemented

  dprint(intvar)
  dprint(doublevar)

macros which are equivalent to

  dprintf("intvar==%d", intvar)
  dprintf("doublevar==%24.16e", doublevar)

More details remain to be specified, such as restricting to lead mpi process (rank 0) and selecting debug level.

murci3lag0 commented 11 years ago

This one would be great if you can select the processor (rank) you want to print. And also if in addition to print to STDOUT you can chose to print to a file.