(git:d18deda)
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_initialize
17#endif
18
19 IMPLICIT NONE
20
21 PRIVATE
22
23 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cp_dlaf_utils_api'
24
27
28CONTAINS
29
30! **************************************************************************************************
31!> \brief Initialize DLA-Future and pika runtime
32!> \author Rocco Meli
33!> \author Mikael Simberg
34!> \author Mathieu Taillefumier
35! **************************************************************************************************
36 SUBROUTINE cp_dlaf_initialize()
37 CHARACTER(len=*), PARAMETER :: routinen = 'cp_dlaf_initialize'
38
39 INTEGER :: handle
40
41 CALL timeset(routinen, handle)
42#if defined(__DLAF)
43 CALL dlaf_initialize()
44#endif
45 CALL timestop(handle)
46 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 SUBROUTINE cp_dlaf_finalize()
55 CHARACTER(len=*), PARAMETER :: routinen = 'cp_dlaf_finalize'
56
57 INTEGER :: handle
58
59 CALL timeset(routinen, handle)
60#if defined(__DLAF)
61 CALL dlaf_finalize()
62#endif
63 CALL timestop(handle)
64 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 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 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 cpabort("CP2K compiled without the DLA-Future library.")
86#endif
87 CALL timestop(handle)
88 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 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 CALL timeset(routinen, handle)
105#if defined(__DLAF)
106 CALL dlaf_free_grid(blacs_context)
107#else
108 mark_used(blacs_context)
109 cpabort("CP2K compiled without the DLA-Future library.")
110#endif
111 CALL timestop(handle)
112 END SUBROUTINE cp_dlaf_free_grid
113
114END 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_initialize()
Initialize DLA-Future and pika runtime.