qmcpack icon indicating copy to clipboard operation
qmcpack copied to clipboard

EnergyDensity fails in HEG

Open Paul-St-Young opened this issue 2 years ago • 1 comments

Describe the bug When EnergyDensity estimator is requested, the heg_14_gamma example seg. faults.

To Reproduce Steps to reproduce the behavior:

  1. add EnergyDensity estimator (and ion0) to heg_14_gamma VMC example.

  2. run vmc.xml (serial or parallel)

<simulation>
  <project id="qmc" series="0">
</project>

<qmcsystem>
  <simulationcell>
  <parameter name="rs" condition="14">5</parameter>
  <parameter name="bconds">p p p</parameter>
  <parameter name="LR_dim_cutoff">6</parameter>
  </simulationcell>

  <particleset name="e" random="yes">
  <group name="u" size="7">
  <parameter name="charge">-1</parameter>
  </group>
  <group name="d" size="7">
  <parameter name="charge">-1</parameter>
  </group>
  </particleset>

  <particleset name="ion0" random="yes">
  <group name="H0" size="7">
  <parameter name="charge">0</parameter>
  </group>
  <group name="H1" size="7">
  <parameter name="charge">0</parameter>
  </group>
  </particleset>

  <wavefunction name="psi0" target="e">
    <jastrow name="J2" type="Two-Body" function="Bspline" optimize="yes">
    <correlation speciesA="u" speciesB="u" size="5">
    <coefficients id="uu" type="Array" optimize="yes"> 1.082858193 0.6653279375 0.4358910287 0.2243616172 0.1102948764</coefficients>
    </correlation>
    <correlation speciesA="u" speciesB="d" size="5">
    <coefficients id="ud" type="Array" optimize="yes"> 1.696171854 1.047722154 0.6275148566 0.3175982878 0.1446706214</coefficients>
    </correlation>
    </jastrow>
  </wavefunction>

  <hamiltonian name="h0" type="generic" target="e">
    <pairpot name="ElecElec" type="coulomb" source="e" target="e"/>
    <estimator type="EnergyDensity" name="EDcell" dynamic="e" static="ion0">
       <spacegrid coord="cartesian">
         <origin p1="zero"/>
         <axis p1="a1" scale="0.5" label="x" grid="-1 (0.1) 1"/>
         <axis p1="a2" scale="0.5" label="y" grid="-1 (0.1) 1"/>
         <axis p1="a3" scale="0.5" label="z" grid="-1 (0.1) 1"/>
       </spacegrid>
    </estimator>
  </hamiltonian>
</qmcsystem>

<traces array="yes" write="no"/>

<qmc method="vmc" move="pbyp">
<parameter name="blocks">100</parameter>
<parameter name="steps">10</parameter>
<parameter name="warmupsteps"> 100 </parameter>
<parameter name="tau">5.0</parameter>
<estimator name="LocalEnergy" hdf5="no"/>
</qmc>

</simulation>

backtrace shows

Thread 1 "qmcpack" received signal SIGSEGV, Segmentation fault.
0x00000000005acf54 in qmcplusplus::CombinedTraceSample<double>::combine (this=0x0) at /rc/Estimators/TraceManager.h:709
709	    std::fill(this->sample.begin(), this->sample.end(), T(0));
(gdb) bt
#0  0x00000000005acf54 in qmcplusplus::CombinedTraceSample<double>::combine (this=0x0)
    at src/Estimators/TraceManager.h:709
#1  0x00000000006d5ee7 in qmcplusplus::EnergyDensityEstimator::evaluate (this=0x174f5b0, P=...)
    at src/QMCHamiltonians/EnergyDensityEstimator.cpp:301
#2  0x0000000000631d49 in qmcplusplus::QMCHamiltonian::auxHevaluate (this=0x1741f90, P=..., ThisWalker=...)
    at src/QMCHamiltonians/QMCHamiltonian.cpp:795
#3  0x00000000005ab471 in qmcplusplus::VMCUpdatePbyP::advanceWalker (this=0x1769660, thisWalker=..., recompute=false)
    at src/QMCDrivers/VMC/VMCUpdatePbyP.cpp:129
#4  0x00000000005a8407 in qmcplusplus::QMCUpdateBase::advanceWalkers (this=0x1769660, it=..., it_end=..., recompute=false)
    at src/QMCDrivers/QMCUpdateBase.cpp:351
#5  0x000000000055635a in _ZN11qmcplusplus3VMC3runEv._omp_fn.0(void) () at src/QMCDrivers/VMC/VMC.cpp:94
#6  0x00007fffef59c812 in GOMP_parallel (fn=0x5560a8 <_ZN11qmcplusplus3VMC3runEv._omp_fn.0(void)>, data=0x7fffffff52f0, num_threads=1, flags=0)
    at /dev/shm/nix-build-gcc-10.4.0.drv-0/nixbld1/spack-stage-gcc-10.4.0-ym0r2w4dnzd0fg0pnlipazv3ww9a3j6w/spack-src/libgomp/parallel.c:171
#7  0x00000000005542f9 in qmcplusplus::VMC::run (this=0x174e8b0) at src/QMCDrivers/VMC/VMC.cpp:77
#8  0x0000000000421616 in qmcplusplus::QMCMain::runQMC (this=0x13ed3e0, cur=0x17228b0, reuse=false)
    at src/QMCApp/QMCMain.cpp:634
#9  0x0000000000421f7c in qmcplusplus::QMCMain::executeQMCSection (this=0x13ed3e0, cur=0x17228b0, reuse=false)
    at src/QMCApp/QMCMain.cpp:699
#10 0x000000000041f74b in qmcplusplus::QMCMain::execute (this=0x13ed3e0) at src/QMCApp/QMCMain.cpp:260
#11 0x00000000004114e4 in main (argc=2, argv=0x7fffffff6278) at src/QMCApp/qmcapp.cpp:215

Expected behavior no seg. fault

System:

  • Intel workstation

Paul-St-Young avatar Jun 12 '23 20:06 Paul-St-Young

Without the energy density estimator, TraceManager does run without crashing in parallel. The thing that's crashing #4527 is triggered by write="yes".

Paul-St-Young avatar Jun 12 '23 20:06 Paul-St-Young