Skip to content

Conversation

@stefabat
Copy link
Contributor

@stefabat stefabat commented Dec 3, 2024

This PR enables support for writing TREXIO files from a SCF run.
TREXIO is a library that support interoperability between quantum chemistry codes, especially for programs implementing post-SCF methods such as QMC.

The PR adds an external library dependency, which itself depends on HDF5.

Currently, we only support writing trexio files, and not reading them (e.g. to restart a calculation previously run with a different code support trexio).

@stefabat
Copy link
Contributor Author

stefabat commented Dec 3, 2024

Tests simply run and make sure that the code written is executed without mistakes, but do not test the genuinity of the trexio file content.
Tests with dbg executables fail because of a bug in HDF5 1.14.3 (see HDFGroup/hdf5#3831). The problem is the flag -ffpe-trap=invalid.

@oschuett
Copy link
Member

oschuett commented Dec 3, 2024

Tests with dbg executables fail because of a bug in HDF5 1.14.3...

The workaround for this is to temporarily disable the trapping:

cp2k/src/fm/cp_fm_diag.F

Lines 621 to 633 in 2de90c3

! Scalapack takes advantage of IEEE754 exceptions for speedup.
! Therefore, we disable floating point traps temporarily.
#if defined (__HAS_IEEE_EXCEPTIONS)
CALL ieee_get_halting_mode(IEEE_ALL, halt)
CALL ieee_set_halting_mode(IEEE_ALL, .FALSE.)
#endif
CALL pdsyevd('V', 'U', n, m(1, 1), 1, 1, descm, eigenvalues(1), v(1, 1), 1, 1, descv, &
work(1), lwork, iwork(1), liwork, myinfo)
#if defined (__HAS_IEEE_EXCEPTIONS)
CALL ieee_set_halting_mode(IEEE_ALL, halt)
#endif

Copy link
Member

@oschuett oschuett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments, generally LGTM.

@stefabat
Copy link
Contributor Author

stefabat commented Dec 4, 2024

Tests with dbg executables fail because of a bug in HDF5 1.14.3...

The workaround for this is to temporarily disable the trapping:

cp2k/src/fm/cp_fm_diag.F

Lines 621 to 633 in 2de90c3

! Scalapack takes advantage of IEEE754 exceptions for speedup.
! Therefore, we disable floating point traps temporarily.
#if defined (__HAS_IEEE_EXCEPTIONS)
CALL ieee_get_halting_mode(IEEE_ALL, halt)
CALL ieee_set_halting_mode(IEEE_ALL, .FALSE.)
#endif
CALL pdsyevd('V', 'U', n, m(1, 1), 1, 1, descm, eigenvalues(1), v(1, 1), 1, 1, descv, &
work(1), lwork, iwork(1), liwork, myinfo)
#if defined (__HAS_IEEE_EXCEPTIONS)
CALL ieee_set_halting_mode(IEEE_ALL, halt)
#endif

Actually, with 1.14.5 this is not a problem anymore, so I don't need to disable the trapping.

@oschuett oschuett merged commit 8644137 into cp2k:master Dec 6, 2024
36 checks passed
@stefabat stefabat deleted the trexio branch January 27, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants