dbcsr_init_lib_hooks Subroutine

private subroutine dbcsr_init_lib_hooks(mp_comm, in_timeset_hook, in_timestop_hook, in_abort_hook, in_warn_hook, io_unit, accdrv_active_device_id)

Initialize the DBCSR library using external loggers and timer callbacks

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: mp_comm
procedure(timeset_interface), intent(in), POINTER:: in_timeset_hook
procedure(timestop_interface), intent(in), POINTER:: in_timestop_hook
procedure(dbcsr_abort_interface), intent(in), POINTER:: in_abort_hook
procedure(dbcsr_warn_interface), intent(in), POINTER:: in_warn_hook
integer, intent(in), optional :: io_unit
integer, intent(in), optional :: accdrv_active_device_id

Contents

Source Code


Source Code

   SUBROUTINE dbcsr_init_lib_hooks(mp_comm, &
                                   in_timeset_hook, in_timestop_hook, &
                                   in_abort_hook, in_warn_hook, io_unit, &
                                   accdrv_active_device_id)
      !! Initialize the DBCSR library using external loggers and timer callbacks
      INTEGER, INTENT(IN)  :: mp_comm
      PROCEDURE(timeset_interface), INTENT(IN), POINTER :: in_timeset_hook
      PROCEDURE(timestop_interface), INTENT(IN), POINTER :: in_timestop_hook
      PROCEDURE(dbcsr_abort_interface), INTENT(IN), POINTER :: in_abort_hook
      PROCEDURE(dbcsr_warn_interface), INTENT(IN), POINTER :: in_warn_hook
      INTEGER, INTENT(IN), OPTIONAL :: io_unit, accdrv_active_device_id

      IF (is_initialized) THEN
         ! Update ext_io_unit
         IF (.NOT. ASSOCIATED(logger) .AND. PRESENT(io_unit)) ext_io_unit = io_unit
         RETURN
      END IF
      CALL dbcsr_init_lib_pre(mp_comm, io_unit, accdrv_active_device_id)
      ! abort/warn hooks
      dbcsr_abort_hook => in_abort_hook
      dbcsr_warn_hook => in_warn_hook
      ! timeset/timestop hooks
      timeset_hook => in_timeset_hook
      timestop_hook => in_timestop_hook
      ! timer environment is assumed
      !
      CALL dbcsr_init_lib_low()
   END SUBROUTINE dbcsr_init_lib_hooks