From cdd68c9a77a1c44e1d7e7ddb9e53055a284e2126 Mon Sep 17 00:00:00 2001 From: Raymond Clay Date: Fri, 7 Apr 2017 14:31:00 -0600 Subject: [PATCH] Add ctests for RMC. Also eliminate multithread chatter from RMCUpdate --- CMake/macros.cmake | 4 +- src/QMCDrivers/RMC/RMCUpdateAll.cpp | 12 ++- src/QMCDrivers/RMC/RMCUpdatePbyP.cpp | 12 ++- .../bccH_1x1x1_ae/qmc_long_vmc_rmc.in.xml | 102 ++++++++++++++++++ .../bccH_1x1x1_ae/qmc_short_vmc_rmc.in.xml | 102 ++++++++++++++++++ tests/system/CMakeLists.txt | 37 ++++++- utils/check_scalars.py | 6 ++ 7 files changed, 264 insertions(+), 11 deletions(-) create mode 100644 tests/solids/bccH_1x1x1_ae/qmc_long_vmc_rmc.in.xml create mode 100644 tests/solids/bccH_1x1x1_ae/qmc_short_vmc_rmc.in.xml diff --git a/CMake/macros.cmake b/CMake/macros.cmake index b0553f330..14daf9fe5 100644 --- a/CMake/macros.cmake +++ b/CMake/macros.cmake @@ -286,8 +286,8 @@ ENDFUNCTION() FUNCTION(QMC_RUN_AND_CHECK BASE_NAME BASE_DIR PREFIX INPUT_FILE PROCS THREADS SCALAR_VALUES SERIES SHOULD_SUCCEED) # Map from name of check to appropriate flag for check_scalars.py - LIST(APPEND SCALAR_CHECK_TYPE "kinetic" "totenergy" "eeenergy" "samples" "potential" "ionion" "localecp" "nonlocalecp" "flux") - LIST(APPEND CHECK_SCALAR_FLAG "--ke" "--le" "--ee" "--ts" "--lp" "--ii" "--lpp" "--nlpp" "--fl") + LIST(APPEND SCALAR_CHECK_TYPE "kinetic" "totenergy" "eeenergy" "samples" "potential" "ionion" "localecp" "nonlocalecp" "flux" "kinetic_mixed" "kinetic_pure" "eeenergy_mixed" "eeenergy_pure" "potential_pure") + LIST(APPEND CHECK_SCALAR_FLAG "--ke" "--le" "--ee" "--ts" "--lp" "--ii" "--lpp" "--nlpp" "--fl" "--ke_m" "--ke_p" "--ee_m" "--ee_p" "--lp_p") SET( TEST_ADDED FALSE ) SET( FULL_NAME "${BASE_NAME}-${PROCS}-${THREADS}" ) diff --git a/src/QMCDrivers/RMC/RMCUpdateAll.cpp b/src/QMCDrivers/RMC/RMCUpdateAll.cpp index 07feb3ed8..8a4d339cd 100644 --- a/src/QMCDrivers/RMC/RMCUpdateAll.cpp +++ b/src/QMCDrivers/RMC/RMCUpdateAll.cpp @@ -83,22 +83,26 @@ namespace qmcplusplus if (driftoption) { scaleDrift = true; - app_log () << " Using Umrigar scaled drift\n"; + if (omp_get_thread_num()==0) + app_log () << " Using Umrigar scaled drift\n"; // H.rejectedMove(W,thisWalker); } else { - app_log () << " Using non-scaled drift\n"; + if (omp_get_thread_num()==0) + app_log () << " Using non-scaled drift\n"; } if (action == "DMC") { actionType = DMC_ACTION; - app_log () << " Using DMC link-action\n"; + if (omp_get_thread_num()==0) + app_log () << " Using DMC link-action\n"; } else { - app_log () << " Using Symmetrized Link-Action\n"; + if (omp_get_thread_num()==0) + app_log () << " Using Symmetrized Link-Action\n"; } return true; diff --git a/src/QMCDrivers/RMC/RMCUpdatePbyP.cpp b/src/QMCDrivers/RMC/RMCUpdatePbyP.cpp index faf80271d..f856a7a1a 100644 --- a/src/QMCDrivers/RMC/RMCUpdatePbyP.cpp +++ b/src/QMCDrivers/RMC/RMCUpdatePbyP.cpp @@ -124,21 +124,25 @@ namespace qmcplusplus if (usedrift == true) { - app_log () << " Using Umrigar scaled drift\n"; + if (omp_get_thread_num()==0) + app_log () << " Using Umrigar scaled drift\n"; } else { - app_log () << " Using non-scaled drift\n"; + if (omp_get_thread_num()==0) + app_log () << " Using non-scaled drift\n"; } if (action == "DMC") { actionType = DMC_ACTION; - app_log () << " Using DMC link-action\n"; + if (omp_get_thread_num()==0) + app_log () << " Using DMC link-action\n"; } else { - app_log () << " Using Symmetrized Link-Action\n"; + if (omp_get_thread_num()==0) + app_log () << " Using Symmetrized Link-Action\n"; } return true; diff --git a/tests/solids/bccH_1x1x1_ae/qmc_long_vmc_rmc.in.xml b/tests/solids/bccH_1x1x1_ae/qmc_long_vmc_rmc.in.xml new file mode 100644 index 000000000..aabc5e1dc --- /dev/null +++ b/tests/solids/bccH_1x1x1_ae/qmc_long_vmc_rmc.in.xml @@ -0,0 +1,102 @@ + + + + + + + + + 3.77945227 0.00000000 0.00000000 + -0.00000000 3.77945227 0.00000000 + -0.00000000 -0.00000000 3.77945227 + + + p p p + + 15 + + + + -1 + 1.0 + + + -1 + 1.0 + + + + + 1 + 1 + 1 + 1837.36221934 + + 0.00000000 0.00000000 0.00000000 + 1.88972614 1.88972614 1.88972614 + + + + + + + + + + + + + + + + + +0.00206602038 -0.002841926986 0.0036266191 -0.001913930279 8.457152991e-06 +0.0007380321824 3.635172529e-05 0.0001299635851 + + + + + + +0.4253416809 0.3693526685 0.2834952374 0.1923310728 0.1153317679 0.06112792407 +0.02863622256 0.01185687423 + + + + +0.5954603818 0.5062051797 0.3746940461 0.2521010502 0.1440163317 0.07796688253 +0.03804420551 0.01449320872 + + + + + + + + + + + + + + + 256 + 1 + 100 + 1 + 1 + 0.3 + no + + + + 40000 + 0.008 + 400 + 10000 + 1000 + no + + + diff --git a/tests/solids/bccH_1x1x1_ae/qmc_short_vmc_rmc.in.xml b/tests/solids/bccH_1x1x1_ae/qmc_short_vmc_rmc.in.xml new file mode 100644 index 000000000..a0e69177d --- /dev/null +++ b/tests/solids/bccH_1x1x1_ae/qmc_short_vmc_rmc.in.xml @@ -0,0 +1,102 @@ + + + + + + + + + 3.77945227 0.00000000 0.00000000 + -0.00000000 3.77945227 0.00000000 + -0.00000000 -0.00000000 3.77945227 + + + p p p + + 15 + + + + -1 + 1.0 + + + -1 + 1.0 + + + + + 1 + 1 + 1 + 1837.36221934 + + 0.00000000 0.00000000 0.00000000 + 1.88972614 1.88972614 1.88972614 + + + + + + + + + + + + + + + + + +0.00206602038 -0.002841926986 0.0036266191 -0.001913930279 8.457152991e-06 +0.0007380321824 3.635172529e-05 0.0001299635851 + + + + + + +0.4253416809 0.3693526685 0.2834952374 0.1923310728 0.1153317679 0.06112792407 +0.02863622256 0.01185687423 + + + + +0.5954603818 0.5062051797 0.3746940461 0.2521010502 0.1440163317 0.07796688253 +0.03804420551 0.01449320872 + + + + + + + + + + + + + + + 256 + 1 + 100 + 1 + 1 + 0.3 + no + + + + 2000 + 0.008 + 400 + 400 + 200 + no + + + diff --git a/tests/system/CMakeLists.txt b/tests/system/CMakeLists.txt index e15517791..cf9b387ab 100644 --- a/tests/system/CMakeLists.txt +++ b/tests/system/CMakeLists.txt @@ -272,7 +272,27 @@ ENDIF() 1 # DMC TRUE) + LIST(APPEND BCC_H_RMC_SCALARS "totenergy" "-1.8420 0.0011") + #check RMC on 16 cores. 1 MPI + QMC_RUN_AND_CHECK(short-bccH_1x1x1_ae-rmc_sdj + "${CMAKE_SOURCE_DIR}/tests/solids/bccH_1x1x1_ae" + qmc_short_vmc_rmc + qmc_short_vmc_rmc.in.xml + 1 16 + BCC_H_RMC_SCALARS + 1 #series# + TRUE) + #check RMC on 4 cores, 4 mpi + QMC_RUN_AND_CHECK(short-bccH_1x1x1_ae-rmc_sdj + "${CMAKE_SOURCE_DIR}/tests/solids/bccH_1x1x1_ae" + qmc_short_vmc_rmc + qmc_short_vmc_rmc.in.xml + 4 4 + BCC_H_RMC_SCALARS + 1 #series# + TRUE) + # Plane wave test of bccH (no pp, so faster than typical solids) # Reduced number of blocks and samples compared to other short bccH tests LIST(APPEND BCC_H_PW_SCALARS "totenergy" "-1.834032 0.001") @@ -431,8 +451,23 @@ ENDIF() 1 # DMC TRUE) + LIST(APPEND LONG_BCC_H_RMC_SCALARS "totenergy" "-1.84150 0.00011") + LIST(APPEND LONG_BCC_H_RMC_SCALARS "potential" "-2.01964 0.00072") + LIST(APPEND LONG_BCC_H_RMC_SCALARS "potential_pure" "-2.01907 0.00085") + LIST(APPEND LONG_BCC_H_RMC_SCALARS "kinetic_mixed" "0.17814 0.00073") + LIST(APPEND LONG_BCC_H_RMC_SCALARS "kinetic_pure" "0.17063 0.00086") + LIST(APPEND LONG_BCC_H_RMC_SCALARS "eeenergy_mixed" "-0.77991 0.00016") + LIST(APPEND LONG_BCC_H_RMC_SCALARS "eeenergy_pure" "-0.78335 0.00019") + QMC_RUN_AND_CHECK(long-bccH_1x1x1_ae-rmc_sdj + "${CMAKE_SOURCE_DIR}/tests/solids/bccH_1x1x1_ae" + qmc_long_vmc_rmc + qmc_long_vmc_rmc.in.xml + 1 16 + LONG_BCC_H_RMC_SCALARS + 1 # DMC + TRUE) - + LIST(APPEND LONG_DIAMOND_SCALARS "totenergy" "-10.491445 0.000065") LIST(APPEND LONG_DIAMOND_SCALARS "samples" "122880000 0.0") LIST(APPEND LONG_DIAMOND_SCALARS "flux" "0.0 0.03") diff --git a/utils/check_scalars.py b/utils/check_scalars.py index 5b9f40496..c0dbfdebd 100755 --- a/utils/check_scalars.py +++ b/utils/check_scalars.py @@ -171,6 +171,12 @@ def read_command_line(): bw = 'BlockWeight', ts = 'TotalSamples', fl = 'Flux', +#now for some RMC estimators + ke_m = "Kinetic_m", + ke_p = "Kinetic_p", + ee_m = "ElecElec_m", + ee_p = "ElecElec_p", + lp_p = "LocalPotential_pure" ) for qshort in sorted(quantities.keys()):