miniqmc icon indicating copy to clipboard operation
miniqmc copied to clipboard

Better testing of miniqmc

Open markdewing opened this issue 7 years ago • 4 comments

This was brought up in the miniqmc meeting, and I'm putting it here to organize further discussion.

Currently, testing for correctness is done by comparing against a reference implementation for the SPO's, Jastrow factors, and determinant update.

Missing are checks that the higher level algorithms in miniqmc are correct. One possible solution is to run a step or two with a rigged RNG and check the results against known good results (similar to what is done with the driver unit tests in QMCPACK)

Another issue is debugging problems once the check_* drivers report a problem. Two possible solutions:

  • add unit testing to test smaller pieces of functionality
  • create a simpler kernel driver. For example, this driver evaluates the SPO at one point and prints out the values for the trial and reference implementations.

markdewing avatar Jul 17 '18 15:07 markdewing

For me personally, I would much rather have decent unit tests than simple kernel drivers for debugging purposes. Simple drivers are nice too, and would definitely complement the existing checks... but I feel like decent unit tests would have made implementation of something like GPU offload a bit more straightforward.

rcclay avatar Jul 17 '18 16:07 rcclay

For an example of simple kernel driver, this is the SPO driver I wrote to help with debugging the GA implementation https://github.com/markdewing/miniqmc-1/blob/kernel_drivers/src/Drivers/spo_driver.cpp

markdewing avatar Jul 17 '18 17:07 markdewing

I think tests at SPO level and WavefunctionComponent level is good so we only need to maintain one no matter the underlying implementation changes. The test code body can added directly in the check_XXX.

ye-luo avatar Jul 17 '18 17:07 ye-luo

As an example for unit testing, this branch (unit_test) adds Catch2 as a unit test framework and one test (src/Particle/test/test_bcond.cpp)

It builds a single unit test executable, bin/unit_test.

https://github.com/markdewing/miniqmc-1/tree/unit_test/

markdewing avatar Jul 19 '18 19:07 markdewing