LCOV - code coverage report
Current view: top level - src/fm - cp_dlaf_utils_api.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:b8e0b09) Lines: 8 18 44.4 %
Date: 2024-08-31 06:31:37 Functions: 2 4 50.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : MODULE cp_dlaf_utils_api
       9             : 
      10             : #include "../base/base_uses.f90"
      11             : 
      12             : #if defined(__DLAF)
      13             :    USE dlaf_fortran, ONLY: dlaf_create_grid_from_blacs, &
      14             :                            dlaf_finalize, &
      15             :                            dlaf_free_grid, &
      16             :                            dlaf_initialize
      17             : #endif
      18             : 
      19             :    IMPLICIT NONE
      20             : 
      21             :    PRIVATE
      22             : 
      23             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cp_dlaf_utils_api'
      24             : 
      25             :    PUBLIC :: cp_dlaf_initialize, cp_dlaf_finalize
      26             :    PUBLIC :: cp_dlaf_create_grid, cp_dlaf_free_grid
      27             : 
      28             : CONTAINS
      29             : 
      30             : ! **************************************************************************************************
      31             : !> \brief Initialize DLA-Future and pika runtime
      32             : !> \author Rocco Meli
      33             : !> \author Mikael Simberg
      34             : !> \author Mathieu Taillefumier
      35             : ! **************************************************************************************************
      36       16974 :    SUBROUTINE cp_dlaf_initialize()
      37             :       CHARACTER(len=*), PARAMETER :: routineN = 'cp_dlaf_initialize'
      38             : 
      39             :       INTEGER                                            :: handle
      40             : 
      41       16974 :       CALL timeset(routineN, handle)
      42             : #if defined(__DLAF)
      43             :       CALL dlaf_initialize()
      44             : #endif
      45       16974 :       CALL timestop(handle)
      46       16974 :    END SUBROUTINE cp_dlaf_initialize
      47             : 
      48             : ! **************************************************************************************************
      49             : !> \brief Finalize DLA-Future and pika runtime
      50             : !> \author Rocco Meli
      51             : !> \author Mikael Simberg
      52             : !> \author Mathieu Taillefumier
      53             : ! **************************************************************************************************
      54       16998 :    SUBROUTINE cp_dlaf_finalize()
      55             :       CHARACTER(len=*), PARAMETER                        :: routineN = 'cp_dlaf_finalize'
      56             : 
      57             :       INTEGER                                            :: handle
      58             : 
      59       16998 :       CALL timeset(routineN, handle)
      60             : #if defined(__DLAF)
      61             :       CALL dlaf_finalize()
      62             : #endif
      63       16998 :       CALL timestop(handle)
      64       16998 :    END SUBROUTINE cp_dlaf_finalize
      65             : 
      66             : ! **************************************************************************************************
      67             : !> \brief Create DLA-Future grid from BLACS context
      68             : !> \param blacs_context ...
      69             : !> \author Rocco Meli
      70             : !> \author Mikael Simberg
      71             : !> \author Mathieu Taillefumier
      72             : ! **************************************************************************************************
      73           0 :    SUBROUTINE cp_dlaf_create_grid(blacs_context)
      74             :       INTEGER, INTENT(IN)                                :: blacs_context
      75             : 
      76             :       CHARACTER(len=*), PARAMETER :: routineN = 'cp_dlaf_create_grid'
      77             : 
      78             :       INTEGER                                            :: handle
      79             : 
      80           0 :       CALL timeset(routineN, handle)
      81             : #if defined(__DLAF)
      82             :       CALL dlaf_create_grid_from_blacs(blacs_context)
      83             : #else
      84             :       MARK_USED(blacs_context)
      85           0 :       CPABORT("CP2K compiled without the DLA-Future library.")
      86             : #endif
      87           0 :       CALL timestop(handle)
      88           0 :    END SUBROUTINE cp_dlaf_create_grid
      89             : 
      90             : ! **************************************************************************************************
      91             : !> \brief Free DLA-Future grid corresponding to BLACS context
      92             : !> \param blacs_context ...
      93             : !> \author Rocco Meli
      94             : !> \author Mikael Simberg
      95             : !> \author Mathieu Taillefumier
      96             : ! **************************************************************************************************
      97           0 :    SUBROUTINE cp_dlaf_free_grid(blacs_context)
      98             :       INTEGER, INTENT(IN)                                :: blacs_context
      99             : 
     100             :       CHARACTER(len=*), PARAMETER                        :: routineN = 'cp_dlaf_free_grid'
     101             : 
     102             :       INTEGER                                            :: handle
     103             : 
     104           0 :       CALL timeset(routineN, handle)
     105             : #if defined(__DLAF)
     106             :       CALL dlaf_free_grid(blacs_context)
     107             : #else
     108             :       MARK_USED(blacs_context)
     109           0 :       CPABORT("CP2K compiled without the DLA-Future library.")
     110             : #endif
     111           0 :       CALL timestop(handle)
     112           0 :    END SUBROUTINE cp_dlaf_free_grid
     113             : 
     114             : END MODULE cp_dlaf_utils_api

Generated by: LCOV version 1.15