(git:e5b1968)
Loading...
Searching...
No Matches
cp_dlaf_utils_api.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
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_free_all_grids, &
17 dlaf_initialize
18#endif
19
20 IMPLICIT NONE
21
22 PRIVATE
23
24 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cp_dlaf_utils_api'
25
28
29CONTAINS
30
31! **************************************************************************************************
32!> \brief Initialize DLA-Future and pika runtime
33!> \author Rocco Meli
34!> \author Mikael Simberg
35!> \author Mathieu Taillefumier
36! **************************************************************************************************
37 SUBROUTINE cp_dlaf_initialize()
38 CHARACTER(len=*), PARAMETER :: routinen = 'cp_dlaf_initialize'
39
40 INTEGER :: handle
41
42 CALL timeset(routinen, handle)
43#if defined(__DLAF)
44 CALL dlaf_initialize()
45#endif
46 CALL timestop(handle)
47 END SUBROUTINE cp_dlaf_initialize
48
49! **************************************************************************************************
50!> \brief Finalize DLA-Future and pika runtime
51!> \author Rocco Meli
52!> \author Mikael Simberg
53!> \author Mathieu Taillefumier
54! **************************************************************************************************
55 SUBROUTINE cp_dlaf_finalize()
56 CHARACTER(len=*), PARAMETER :: routinen = 'cp_dlaf_finalize'
57
58 INTEGER :: handle
59
60 CALL timeset(routinen, handle)
61#if defined(__DLAF)
62 CALL dlaf_finalize()
63#endif
64 CALL timestop(handle)
65 END SUBROUTINE cp_dlaf_finalize
66
67! **************************************************************************************************
68!> \brief Create DLA-Future grid from BLACS context
69!> \param blacs_context ...
70!> \author Rocco Meli
71!> \author Mikael Simberg
72!> \author Mathieu Taillefumier
73! **************************************************************************************************
74 SUBROUTINE cp_dlaf_create_grid(blacs_context)
75 INTEGER, INTENT(IN) :: blacs_context
76
77 CHARACTER(len=*), PARAMETER :: routinen = 'cp_dlaf_create_grid'
78
79 INTEGER :: handle
80
81 CALL timeset(routinen, handle)
82#if defined(__DLAF)
83 CALL dlaf_create_grid_from_blacs(blacs_context)
84#else
85 mark_used(blacs_context)
86 cpabort("CP2K compiled without the DLA-Future library.")
87#endif
88 CALL timestop(handle)
89 END SUBROUTINE cp_dlaf_create_grid
90
91! **************************************************************************************************
92!> \brief Free DLA-Future grid corresponding to BLACS context
93!> \param blacs_context ...
94!> \author Rocco Meli
95!> \author Mikael Simberg
96!> \author Mathieu Taillefumier
97! **************************************************************************************************
98 SUBROUTINE cp_dlaf_free_grid(blacs_context)
99 INTEGER, INTENT(IN) :: blacs_context
100
101 CHARACTER(len=*), PARAMETER :: routinen = 'cp_dlaf_free_grid'
102
103 INTEGER :: handle
104
105 CALL timeset(routinen, handle)
106#if defined(__DLAF)
107 CALL dlaf_free_grid(blacs_context)
108#else
109 mark_used(blacs_context)
110 cpabort("CP2K compiled without the DLA-Future library.")
111#endif
112 CALL timestop(handle)
113 END SUBROUTINE cp_dlaf_free_grid
114
115! **************************************************************************************************
116!> \brief Free all DLA-Future grids
117!> \author Rocco Meli
118! **************************************************************************************************
120 CHARACTER(len=*), PARAMETER :: routinen = 'cp_dlaf_free_all_grids'
121
122 INTEGER :: handle
123
124 CALL timeset(routinen, handle)
125#if defined(__DLAF)
126 CALL dlaf_free_all_grids()
127#endif
128 CALL timestop(handle)
129 END SUBROUTINE cp_dlaf_free_all_grids
130
131END MODULE cp_dlaf_utils_api
subroutine, public cp_dlaf_create_grid(blacs_context)
Create DLA-Future grid from BLACS context.
subroutine, public cp_dlaf_finalize()
Finalize DLA-Future and pika runtime.
subroutine, public cp_dlaf_free_grid(blacs_context)
Free DLA-Future grid corresponding to BLACS context.
subroutine, public cp_dlaf_free_all_grids()
Free all DLA-Future grids.
subroutine, public cp_dlaf_initialize()
Initialize DLA-Future and pika runtime.