LCOV - code coverage report
Current view: top level - src/common - callgraph.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:4dc10b3) Lines: 9 10 90.0 %
Date: 2024-11-21 06:45:46 Functions: 9 19 47.4 %

          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             : MODULE callgraph
       8             :    USE kinds, ONLY: int_4, int_8
       9             :    USE timings_base_type, ONLY: call_stat_type
      10             : #include "../base/base_uses.f90"
      11             : 
      12             :    IMPLICIT NONE
      13             :    PRIVATE
      14             : 
      15             :    #:include 'hash_map.fypp'
      16             : 
      17  2305164383 :    #:call hash_map(prefix='callgraph', &
      18             :       key_type='INTEGER(kind=int_4), DIMENSION(2)', &
      19             :       value_type='TYPE(call_stat_type), POINTER', &
      20             :       key_default_init=' = 0_int_4', &
      21             :       value_default_init=' => NULL()')
      22             :    #:endcall hash_map
      23             : 
      24             : ! **************************************************************************************************
      25             : !> \brief ...
      26             : !> \param key ...
      27             : !> \return ...
      28             : ! **************************************************************************************************
      29  1535563799 :    PURE FUNCTION callgraph_hash_function(key) RESULT(hash)
      30             :       INTEGER(kind=int_4), DIMENSION(2), INTENT(in)      :: key
      31             :       INTEGER(KIND=int_8)                                :: hash
      32             : 
      33             :       INTEGER(kind=int_8)                                :: k1, k2
      34  1535563799 :       k1 = key(1) ! cast to int_8
      35  1535563799 :       k2 = key(2)
      36  1535563799 :       hash = IOR(k1, ISHFT(k2, 32))
      37  1535563799 :    END FUNCTION callgraph_hash_function
      38             : 
      39             : ! **************************************************************************************************
      40             : !> \brief ...
      41             : !> \param key ...
      42             : !> \return ...
      43             : ! **************************************************************************************************
      44  1522769679 :    PURE FUNCTION callgraph_keys_equal(key1, key2) RESULT(res)
      45             :       INTEGER(kind=int_4), DIMENSION(2), INTENT(in)      :: key1, key2
      46             :       LOGICAL                                            :: res
      47             : 
      48  4568309037 :       res = ALL(key1 == key2)
      49  1522769679 :    END FUNCTION callgraph_keys_equal
      50             : 
      51           0 : END MODULE callgraph

Generated by: LCOV version 1.15