CmPA / iPic3D

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

code diagnostics should be atomic per thread #63

Open alecjohnson opened 10 years ago

alecjohnson commented 10 years ago

This is about code diagnostics fixes that I want to be merged into the main code.

error, debug, and warning messages available by including

  debug.h
  errors.h
  asserts.h

were not implemented in an atomic manner. As a consequence, output from code diagnostic messages from multiple processes is often interleaved, making it difficult to determine what output is coming from what thread.

I am fixing this by first writing the message to a string and then printing the string to standard output with a single call to fprintf.

Note that I have also changed the output format so that messages indicate process and thread number when appropriate.