9#include "gauxc/gauxc_config.f"
12#include "cp2k_build_info.h"
24 USE iso_fortran_env,
ONLY: compiler_options,&
43#if defined(__COMPILE_REVISION)
44 CHARACTER(LEN=*),
PARAMETER :: compile_revision = __compile_revision
46 CHARACTER(LEN=*),
PARAMETER :: compile_revision =
"unknown"
50 CHARACTER(LEN=*),
PARAMETER ::
cp2k_version =
"CP2K version 2026.2 (Development Version)"
52 CHARACTER(LEN=*),
PARAMETER ::
cp2k_home =
"https://www.cp2k.org/"
56#if defined(__COMPILE_ARCH)
57 CHARACTER(LEN=*),
PARAMETER ::
compile_arch = __compile_arch
59 CHARACTER(LEN=*),
PARAMETER ::
compile_arch =
"unknown: -D__COMPILE_ARCH=?"
62#if defined(__COMPILE_DATE)
63 CHARACTER(LEN=default_string_length),
SAVE ::
compile_date = __compile_date
65 CHARACTER(LEN=default_string_length),
SAVE ::
compile_date =
"unknown: -D__COMPILE_DATE=?"
68#if defined(__COMPILE_HOST)
69 CHARACTER(LEN=*),
PARAMETER ::
compile_host = __compile_host
71 CHARACTER(LEN=*),
PARAMETER ::
compile_host =
"unknown: -D__COMPILE_HOST=?"
75 CHARACTER(LEN=default_path_length),
PUBLIC ::
r_cwd
80 CHARACTER(len=*),
PARAMETER,
PRIVATE :: modulen =
'cp2k_info'
89 CHARACTER(len=10*default_string_length) :: flags
91 CHARACTER(len=default_string_length) :: tmp_str
97 flags = trim(flags)//trim(tmp_str)
99 IF (index(compiler_options(),
"-fsanitize=leak") > 0)
THEN
100 flags = trim(flags)//
" lsan"
106#if defined(__INTEL_LLVM_COMPILER)
107 flags = trim(flags)//
" ifx"
110 flags = trim(flags)//
" libint"
113 flags = trim(flags)//
" fftw3"
116 flags = trim(flags)//
" libxc"
118#if defined(__LIBXC) && !defined(__NO_OFFLOAD_LIBXC)
119 flags = trim(flags)//
" libxc_gpu"
121#if defined(__NO_OFFLOAD_LIBXC)
122 flags = trim(flags)//
" no_offload_libxc"
125 flags = trim(flags)//
" gauxc"
127#if defined(GAUXC_HAS_MPI)
128 flags = trim(flags)//
" gauxc_mpi"
130#if defined(GAUXC_HAS_ONEDFT)
131 flags = trim(flags)//
" gauxc_onedft"
133#if defined(__GAUXC) && defined(__GAUXC_ONEDFT_GRADIENT_FIX)
134 flags = trim(flags)//
" gauxc_onedft_gradients"
136#if defined(GAUXC_HAS_HOST)
137 flags = trim(flags)//
" gauxc_host"
139#if defined(GAUXC_HAS_DEVICE)
140 flags = trim(flags)//
" gauxc_device"
142#if defined(GAUXC_HAS_CUDA)
143 flags = trim(flags)//
" gauxc_cuda"
145#if defined(GAUXC_HAS_CUTLASS)
146 flags = trim(flags)//
" gauxc_cutlass"
148#if defined(GAUXC_HAS_HDF5)
149 flags = trim(flags)//
" gauxc_hdf5"
152 flags = trim(flags)//
" skala"
155 flags = trim(flags)//
" pexsi"
158 flags = trim(flags)//
" elpa"
160#if defined(__parallel)
161#if defined(__SCALAPACK_NO_WA)
162 flags = trim(flags)//
" parallel scalapack"
164 flags = trim(flags)//
" parallel scalapack"
167#if defined(__MPI_F08)
168 flags = trim(flags)//
" mpi_f08"
171 flags = trim(flags)//
" cosma"
174 flags = trim(flags)//
" ace"
177 flags = trim(flags)//
" deepmd"
179#if defined(__PW_FPGA)
180 flags = trim(flags)//
" pw_fpga"
182#if defined(__PW_FPGA_SP)
183 flags = trim(flags)//
" pw_fpga_sp"
186 flags = trim(flags)//
" libxs"
188#if defined(__LIBXSMM)
189 flags = trim(flags)//
" libxsmm"
191#if defined(__LIBXSTREAM)
192 flags = trim(flags)//
" libxstream"
194#if defined(__CRAY_PM_ACCEL_ENERGY)
195 flags = trim(flags)//
" cray_pm_accel_energy"
197#if defined(__CRAY_PM_ENERGY)
198 flags = trim(flags)//
" cray_pm_energy"
200#if defined(__CRAY_PM_FAKE_ENERGY)
201 flags = trim(flags)//
" cray_pm_fake_energy"
203#if defined(__DBCSR_ACC)
204 flags = trim(flags)//
" dbcsr_acc"
206#if defined(__MAX_CONTR)
208 flags = trim(flags)//
" max_contr="//trim(tmp_str)
210#if defined(__NO_SOCKETS)
211 flags = trim(flags)//
" no_sockets"
213#if defined(__NO_STATM_ACCESS)
214 flags = trim(flags)//
" no_statm_access"
216#if defined(__PW_CUDA_NO_HOSTALLOC)
217 flags = trim(flags)//
" pw_cuda_no_hostalloc"
219#if defined(__STATM_RESIDENT)
220 flags = trim(flags)//
" statm_resident"
222#if defined(__STATM_TOTAL)
223 flags = trim(flags)//
" statm_total"
225#if defined(__PLUMED2)
226 flags = trim(flags)//
" plumed2"
228#if defined(__HAS_IEEE_EXCEPTIONS)
229 flags = trim(flags)//
" has_ieee_exceptions"
231#if defined(__NO_ABORT)
232 flags = trim(flags)//
" no_abort"
235 flags = trim(flags)//
" spglib"
237#if defined(__ACCELERATE)
238 flags = trim(flags)//
" accelerate"
241 flags = trim(flags)//
" mkl"
243#if defined(__OPENBLAS)
244 flags = trim(flags)//
" openblas"
247 flags = trim(flags)//
" libdftd4"
249#if defined(__S_DFTD3)
250 flags = trim(flags)//
" s_dftd3"
253 flags = trim(flags)//
" mctc-lib"
254 flags = trim(flags)//
" tblite"
257 flags = trim(flags)//
" sirius"
259#if defined(__SIRIUS_NLCG)
260 flags = trim(flags)//
" sirius_nlcg"
262#if defined(__SIRIUS_DFTD3)
263 flags = trim(flags)//
" sirius_dftd3"
265#if defined(__SIRIUS_DFTD4)
266 flags = trim(flags)//
" sirius_dftd4"
268#if defined(__SIRIUS_VCSQNM)
269 flags = trim(flags)//
" sirius_vcsqnm"
271#if defined(__CHECK_DIAG)
272 flags = trim(flags)//
" check_diag"
274#if defined(__LIBVORI)
275 flags = trim(flags)//
" libvori"
276 flags = trim(flags)//
" libbqb"
278#if defined(__LIBMAXWELL)
279 flags = trim(flags)//
" libmaxwell"
281#if defined(__LIBTORCH)
282 flags = trim(flags)//
" libtorch"
284#if defined(__LIBTORCH_CUDA)
285 flags = trim(flags)//
" libtorch_cuda"
287#if defined(__SKALA_FTORCH)
288 flags = trim(flags)//
" skala_ftorch"
291 flags = trim(flags)//
" mimic"
293#if defined(__OFFLOAD_CUDA)
294 flags = trim(flags)//
" offload_cuda"
296#if defined(__OFFLOAD_HIP)
297 flags = trim(flags)//
" offload_hip"
299#if defined(__OFFLOAD_OPENCL)
300 flags = trim(flags)//
" offload_opencl"
302#if defined(__NO_OFFLOAD_ELPA)
303 flags = trim(flags)//
" no_offload_elpa"
305#if defined(__NO_OFFLOAD_GRID)
306 flags = trim(flags)//
" no_offload_grid"
308#if defined(__NO_OFFLOAD_DBM)
309 flags = trim(flags)//
" no_offload_dbm"
311#if defined(__NO_OFFLOAD_PW)
312 flags = trim(flags)//
" no_offload_pw"
314#if defined(__OFFLOAD_PROFILING)
315 flags = trim(flags)//
" offload_profiling"
317#if defined(__SPLA) && defined(__OFFLOAD_GEMM)
318 flags = trim(flags)//
" spla_gemm_offloading"
320#if defined(__CUSOLVERMP)
321 flags = trim(flags)//
" cusolvermp"
323#if defined(__CUSOLVERMP_NCCL)
324 flags = trim(flags)//
" cusolvermp_nccl"
327 flags = trim(flags)//
" dlaf"
329#if defined(__LIBVDWXC)
330 flags = trim(flags)//
" libvdwxc"
333 flags = trim(flags)//
" hdf5"
336 flags = trim(flags)//
" trexio"
339 flags = trim(flags)//
" libfci"
341#if defined(__OFFLOAD_UNIFIED_MEMORY)
342 flags = trim(flags)//
" offload_unified_memory"
344#if defined(__SMEAGOL)
345 flags = trim(flags)//
" libsmeagol"
348 flags = trim(flags)//
" greenx"
351#if defined(__OPENPMD)
352 flags = trim(flags)//
" openpmd"
355#if defined(__LIBGINT)
356 flags = trim(flags)//
" libGint"
359 flags = trim(flags)//
" libwignernj"
370 WRITE (unit=iunit, fmt=
"(T2,A)") &
371 "******************************************************************************", &
373 "* CP2K: A general program to perform molecular dynamics simulations *", &
374 "* Copyright (C) 2000-2026 CP2K developer group <https://www.cp2k.org/> *", &
376 "* This program is free software: you can redistribute it and/or modify *", &
377 "* it under the terms of the GNU General Public License as published by *", &
378 "* the Free Software Foundation, either version 2 of the License, or *", &
379 "* (at your option) any later version. *", &
381 "* This program is distributed in the hope that it will be useful, *", &
382 "* but WITHOUT ANY WARRANTY; without even the implied warranty of *", &
383 "* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *", &
384 "* GNU General Public License for more details. *", &
386 "* You should have received a copy of the GNU General Public License *", &
387 "* along with this program. If not, see <https://www.gnu.org/licenses/>. *", &
389 "******************************************************************************"
420 INTEGER,
INTENT(IN) :: iunit
422 CHARACTER(LEN=256) :: cwd
423 CHARACTER(LEN=timestamp_length) :: timestamp
428 WRITE (unit=iunit, fmt=
"(T2,A)")
"# Version information for this restart file "
429 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current date "//timestamp
430 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current working dir "//trim(cwd)
432 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
433 "# Program compiled at", &
435 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
436 "# Program compiled on", &
438 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
439 "# Program compiled for", &
441 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
442 "# Source code revision number", &
443 adjustr(compile_revision)
some minimal info about CP2K, including its version and license
character(len=default_string_length), save, public compile_date
character(len=default_string_length), public r_host_name
character(len= *), parameter, public cp2k_home
character(len= *), parameter, public compile_host
character(len= *), parameter, public compile_arch
subroutine, public print_cp2k_license(iunit)
...
subroutine, public write_restart_header(iunit)
Writes the header for the restart file.
character(len= *), parameter, public compile_with
character(len= *), parameter, public compile_revision
character(len=timestamp_length), public r_timestamp
character(len= *), parameter, public cp2k_year
character(len=10 *default_string_length) function, public cp2k_flags()
list all compile time options that influence the capabilities of cp2k. All new flags should be added ...
character(len= *), parameter, public cp2k_version
character(len=default_path_length), public r_cwd
subroutine, public get_runtime_info()
...
character(len=default_string_length), public r_user_name
Defines the basic variable types.
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_getpid(pid)
...
integer, parameter, public timestamp_length
subroutine, public m_timestamp(timestamp)
Returns a human readable timestamp.
subroutine, public m_getcwd(curdir)
...
subroutine, public m_getlog(user)
...
subroutine, public m_hostnm(hname)
...
Utilities for string manipulations.
subroutine, public integer_to_string(inumber, string)
Converts an integer number to a string. The WRITE statement will return an error message,...