Skip to content

Commit

Permalink
Better overflow protection in csf_solver (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewRHermes committed Sep 18, 2024
1 parent eb17fdf commit b044b7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion my_pyscf/fci/csf.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def make_hdiag_csf (h1e, eri, norb, nelec, transformer, hdiag_det=None, max_memo
# calculation.
mem_remaining = max_memory - lib.current_memory ()[0]
safety_factor = 1.2
nfloats = nconf*ndet*ndet + det_addr.size
nfloats = float(nconf)*ndet*ndet + float(det_addr.size)
mem_floats = nfloats * np.dtype (float).itemsize / 1e6
mem_ints = det_addr.dtype.itemsize * det_addr.size * 3 / 1e6
mem = safety_factor * (mem_floats + mem_ints)
Expand Down

0 comments on commit b044b7c

Please sign in to comment.