-
Notifications
You must be signed in to change notification settings - Fork 149
Description
Describe the bug
I am piloting using QMCPack on my university's HPC by running the "QMCPack Summer School 2025" tutorials. While executing the lih_workflow.py in "session3_statistics_and_workflows/02_lih_hf_vmc" on my HPC, in the I get the following error when the script tries to read in the *.xml in the vmc step:
"ValueError: could not convert string '3.0139241961e+00' to int64 at row 1, column 1."
I have identified that the issue comes from the "qmcpack_input.py" script (directory: qmcpack-4.1.0/nexus/lib) [Line 1610]. When reading the structure xml document, the "read" function calls to another custom function called "is_int" to check if the value is an int before parsing it as an int type. The float test comes afterwards.
To Reproduce
The custom "is_int" uses Python's built in int() function to see if the passed value turns into a int or not. If the variable becomes an int, the test passes. For my system's Python 3.12.2 version, a Python variable assigned a value like "3.0139241961e+00" will automatically get read as a float, which can get turned into an integer with int(). (See custom Python test output attached where I checked this.) Since the tests passes, the "read" function in qmcpack_input.py assumes the value read in from the structure value is an int64 type, and subsequently fails when trying to read in the float value.
Expected behavior
I assume that some Python int() versions will give scientific notation a value error so the float condition gets accepted next (i.e., the one used in the summer school virtual box).
However, in case this is an issue for later Python versions, could an updated read-in filter that can handle scientific notation get created? Also, does anyone know of any short-term fixes in case I run into this for other tests?
System:
- system name: Prime (located at NDSU's CCAST)
- modules loaded: 1) DefaultModules 9) mkl/2023.2.0 2) openpbs/openpbs/22.05.11 10) openblas/dynamic/0.3.18
- gcc/11.2.0 11) lapack/gcc/64/3.10.0 4) tbb/2021.10.0 12) boost/1.88.0
- compiler-rt/2023.0.0 13) fftw/3.3.10 6) oclfpga/2023.2.0 14) cmake/3.30.3
- compiler/2023.0.0 15) hdf5/1.12.1-intel 8) mpi/2021.10.0 16) libxml2/2.9.10-intel-ab5p
---Loaded and execute in a Python Virtual environment which includes all needed modules; Python 3.12.2; note that
int() is a default Python function
- other systems where this is reproducible [none; virtual box does not do this]
Additional context
I am the first person testing QMCPack on the the Prime HPC system.