libAtoms / QUIP

libAtoms/QUIP molecular dynamics framework: https://libatoms.github.io
346 stars 122 forks source link

Progress timer overwrite with MPI #343

Open Sideboard opened 2 years ago

Sideboard commented 2 years ago

The progress timer does not work correctly if there is more than one process via MPI. On screen the most recent timer output is visible leading to the time jumping to different numbers (and back when it's the original process's turn). The differences are minor in the cases I have seen but I may lead to irritation and further problems under different circumstances.

Possible solutions:

  1. Only one process (e.g. root) should print the timer. a. Its own time; or b. The max time among processes.
  2. All timers should be written below each other (probably more complicated).
jameskermode commented 2 years ago

Normally only the root process would write output to stdout. Would that be equivalent to your first proposed solution?

Sideboard commented 2 years ago

Yes, the root process printing only its own time (1a) is what I would have expected. I have not looked further into it yet why this is different. Maybe it circumvents the print routine that takes care of MPI for line rewriting shenanigans.