mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 14:15:19 -04:00
pexsi: ignore floating point exceptions
svn-origin-rev: 18453
This commit is contained in:
parent
d7e8ce0e34
commit
efa9ed11cd
1 changed files with 21 additions and 0 deletions
|
|
@ -20,6 +20,11 @@ MODULE pexsi_interface
|
|||
f_ppexsi_plan_initialize, &
|
||||
f_ppexsi_retrieve_real_dft_matrix, &
|
||||
f_ppexsi_set_default_options
|
||||
#endif
|
||||
#if defined (__HAS_IEEE_EXCEPTIONS)
|
||||
USE ieee_exceptions, ONLY: ieee_get_halting_mode, &
|
||||
ieee_set_halting_mode, &
|
||||
ieee_all
|
||||
#endif
|
||||
USE kinds, ONLY: int_8, &
|
||||
real_8
|
||||
|
|
@ -380,11 +385,27 @@ CONTAINS
|
|||
|
||||
#ifdef __LIBPEXSI
|
||||
INTEGER :: handle, info
|
||||
#if defined (__HAS_IEEE_EXCEPTIONS)
|
||||
LOGICAL, DIMENSION(5) :: halt
|
||||
#endif
|
||||
|
||||
CALL timeset(routineN, handle)
|
||||
|
||||
! Unfortuntatelly, some PEXSI kernels raise IEEE754 exceptions.
|
||||
! 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 f_ppexsi_dft_driver(plan, pexsi_options%options, numElectronExact, muPEXSI, &
|
||||
numElectronPEXSI, muMinInertia, muMaxInertia, &
|
||||
numTotalInertiaIter, numTotalPEXSIIter, info)
|
||||
|
||||
#if defined (__HAS_IEEE_EXCEPTIONS)
|
||||
CALL ieee_set_halting_mode(IEEE_ALL, halt)
|
||||
#endif
|
||||
|
||||
IF (info .NE. 0) &
|
||||
CPABORT("Pexsi returned an error. Consider logPEXSI0 for details.")
|
||||
CALL timestop(handle)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue