QMCPACK / qmcpack

Main repository for QMCPACK, an open-source production level many-body ab initio Quantum Monte Carlo code for computing the electronic structure of atoms, molecules, and solids with full performance portable GPU support
http://www.qmcpack.org
Other
283 stars 135 forks source link

Improve the integration of WalkerLog classes in batched drivers #5039

Closed ye-luo closed 2 weeks ago

ye-luo commented 3 weeks ago

Proposed changes

Made the following changes.

  1. WalkerLogCollector now captures 'state' during construction. No more copy and update. This modification also requires WalkerLogCollector created via WalkerLogManager which provides 'state'.
  2. WalkerLogManager acquires a list of references of WalkerLogCollector from crowds at startRun and releases the reference at stopRun. Not using pointers directly any more
  3. wlogcollector are uniuqe_ptr in Crowd. I would like to eventually moving away it way from state.logs_active a deeply hidden state.
  4. wlog_manager is a function scoped object now.

What type(s) of changes does this code introduce?

Does this introduce a breaking change?

What systems has this change been tested on?

epyc-server

Checklist

ye-luo commented 2 weeks ago

@jtkrogel could you review?

ye-luo commented 2 weeks ago

writebuffer requires the same set of collectors as startRun. Since the code has be changed to capture the set of references at the startRun, writebuffer doesn't need to take the set again as argument any longer. startRun stopRun and writeBuffer are the only three public APIs. With PR, only startRun takes a set of references to collectors. So less error-prone. Regarding private functions, I tried to leave the set of references to collectors as an argument if it helps making the function const. Such functions are more like free functions preferably not pulling member variables directly for exmaple checkCollectors. Regarding the other private member functions openFile openHDFFile, I feel there is some design but the implementation is incomplete and thus leave them as they are.

ye-luo commented 2 weeks ago

Test this please