9#include "gauxc/gauxc_config.f"
12#include "cp2k_build_info.h"
24 USE iso_fortran_env,
ONLY: compiler_options
42#if defined(__COMPILE_REVISION)
43 CHARACTER(LEN=*),
PARAMETER :: compile_revision = __compile_revision
45 CHARACTER(LEN=*),
PARAMETER :: compile_revision =
"unknown"
49 CHARACTER(LEN=*),
PARAMETER ::
cp2k_version =
"CP2K version 2026.2 (Development Version)"
51 CHARACTER(LEN=*),
PARAMETER ::
cp2k_home =
"https://www.cp2k.org/"
54#if defined(__COMPILE_ARCH)
55 CHARACTER(LEN=*),
PARAMETER ::
compile_arch = __compile_arch
57 CHARACTER(LEN=*),
PARAMETER ::
compile_arch =
"unknown: -D__COMPILE_ARCH=?"
60#if defined(__COMPILE_DATE)
61 CHARACTER(LEN=default_string_length),
SAVE ::
compile_date = __compile_date
63 CHARACTER(LEN=default_string_length),
SAVE ::
compile_date =
"unknown: -D__COMPILE_DATE=?"
66#if defined(__COMPILE_HOST)
67 CHARACTER(LEN=*),
PARAMETER ::
compile_host = __compile_host
69 CHARACTER(LEN=*),
PARAMETER ::
compile_host =
"unknown: -D__COMPILE_HOST=?"
73 CHARACTER(LEN=default_path_length),
PUBLIC ::
r_cwd
78 CHARACTER(len=*),
PARAMETER,
PRIVATE :: modulen =
'cp2k_info'
87 CHARACTER(len=10*default_string_length) :: flags
89 CHARACTER(len=default_string_length) :: tmp_str
95 flags = trim(flags)//trim(tmp_str)
97 IF (index(compiler_options(),
"-fsanitize=leak") > 0)
THEN
98 flags = trim(flags)//
" lsan"
104 flags = trim(flags)//
" macos"
108#if defined(__INTEL_LLVM_COMPILER)
109 flags = trim(flags)//
" ifx"
112 flags = trim(flags)//
" libint"
115 flags = trim(flags)//
" fftw3"
118 flags = trim(flags)//
" libxc"
121 flags = trim(flags)//
" gauxc"
123#if defined(GAUXC_HAS_MPI)
124 flags = trim(flags)//
" gauxc_mpi"
126#if defined(GAUXC_HAS_ONEDFT)
127 flags = trim(flags)//
" gauxc_onedft"
129#if defined(GAUXC_HAS_HOST)
130 flags = trim(flags)//
" gauxc_host"
132#if defined(GAUXC_HAS_DEVICE)
133 flags = trim(flags)//
" gauxc_device"
135#if defined(GAUXC_HAS_CUDA)
136 flags = trim(flags)//
" gauxc_cuda"
138#if defined(GAUXC_HAS_CUTLASS)
139 flags = trim(flags)//
" gauxc_cutlass"
141#if defined(GAUXC_HAS_HDF5)
142 flags = trim(flags)//
" gauxc_hdf5"
145 flags = trim(flags)//
" pexsi"
148 flags = trim(flags)//
" elpa"
150#if defined(__parallel)
151#if defined(__SCALAPACK_NO_WA)
152 flags = trim(flags)//
" parallel scalapack"
154 flags = trim(flags)//
" parallel scalapack"
157#if defined(__MPI_F08)
158 flags = trim(flags)//
" mpi_f08"
161 flags = trim(flags)//
" cosma"
164 flags = trim(flags)//
" ace"
167 flags = trim(flags)//
" deepmd"
169#if defined(__PW_FPGA)
170 flags = trim(flags)//
" pw_fpga"
172#if defined(__PW_FPGA_SP)
173 flags = trim(flags)//
" pw_fpga_sp"
176 flags = trim(flags)//
" libxs"
178#if defined(__LIBXSMM)
179 flags = trim(flags)//
" libxsmm"
181#if defined(__LIBXSTREAM)
182 flags = trim(flags)//
" libxstream"
184#if defined(__CRAY_PM_ACCEL_ENERGY)
185 flags = trim(flags)//
" cray_pm_accel_energy"
187#if defined(__CRAY_PM_ENERGY)
188 flags = trim(flags)//
" cray_pm_energy"
190#if defined(__CRAY_PM_FAKE_ENERGY)
191 flags = trim(flags)//
" cray_pm_fake_energy"
193#if defined(__DBCSR_ACC)
194 flags = trim(flags)//
" dbcsr_acc"
196#if defined(__MAX_CONTR)
198 flags = trim(flags)//
" max_contr="//trim(tmp_str)
200#if defined(__NO_SOCKETS)
201 flags = trim(flags)//
" no_sockets"
203#if defined(__NO_STATM_ACCESS)
204 flags = trim(flags)//
" no_statm_access"
206#if defined(__PW_CUDA_NO_HOSTALLOC)
207 flags = trim(flags)//
" pw_cuda_no_hostalloc"
209#if defined(__STATM_RESIDENT)
210 flags = trim(flags)//
" statm_resident"
212#if defined(__STATM_TOTAL)
213 flags = trim(flags)//
" statm_total"
215#if defined(__PLUMED2)
216 flags = trim(flags)//
" plumed2"
218#if defined(__HAS_IEEE_EXCEPTIONS)
219 flags = trim(flags)//
" has_ieee_exceptions"
221#if defined(__NO_ABORT)
222 flags = trim(flags)//
" no_abort"
225 flags = trim(flags)//
" spglib"
227#if defined(__ACCELERATE)
228 flags = trim(flags)//
" accelerate"
231 flags = trim(flags)//
" mkl"
233#if defined(__OPENBLAS)
234 flags = trim(flags)//
" openblas"
237 flags = trim(flags)//
" libdftd4"
239#if defined(__S_DFTD3)
240 flags = trim(flags)//
" s_dftd3"
243 flags = trim(flags)//
" mctc-lib"
244 flags = trim(flags)//
" tblite"
246#if defined(__TBLITE_DEBUG_DIAGNOSTICS)
247 flags = trim(flags)//
" tblite_debug_diagnostics"
250 flags = trim(flags)//
" sirius"
252#if defined(__SIRIUS_NLCG)
253 flags = trim(flags)//
" sirius_nlcg"
255#if defined(__SIRIUS_DFTD3)
256 flags = trim(flags)//
" sirius_dftd3"
258#if defined(__SIRIUS_DFTD4)
259 flags = trim(flags)//
" sirius_dftd4"
261#if defined(__SIRIUS_VCSQNM)
262 flags = trim(flags)//
" sirius_vcsqnm"
264#if defined(__CHECK_DIAG)
265 flags = trim(flags)//
" check_diag"
267#if defined(__LIBVORI)
268 flags = trim(flags)//
" libvori"
269 flags = trim(flags)//
" libbqb"
271#if defined(__LIBMAXWELL)
272 flags = trim(flags)//
" libmaxwell"
274#if defined(__LIBTORCH)
275 flags = trim(flags)//
" libtorch"
277#if defined(__LIBTORCH_CUDA)
278 flags = trim(flags)//
" libtorch_cuda"
281 flags = trim(flags)//
" mimic"
283#if defined(__OFFLOAD_CUDA)
284 flags = trim(flags)//
" offload_cuda"
286#if defined(__OFFLOAD_HIP)
287 flags = trim(flags)//
" offload_hip"
289#if defined(__OFFLOAD_OPENCL)
290 flags = trim(flags)//
" offload_opencl"
292#if defined(__NO_OFFLOAD_ELPA)
293 flags = trim(flags)//
" no_offload_elpa"
295#if defined(__NO_OFFLOAD_GRID)
296 flags = trim(flags)//
" no_offload_grid"
298#if defined(__NO_OFFLOAD_DBM)
299 flags = trim(flags)//
" no_offload_dbm"
301#if defined(__NO_OFFLOAD_PW)
302 flags = trim(flags)//
" no_offload_pw"
304#if defined(__OFFLOAD_PROFILING)
305 flags = trim(flags)//
" offload_profiling"
307#if defined(__SPLA) && defined(__OFFLOAD_GEMM)
308 flags = trim(flags)//
" spla_gemm_offloading"
310#if defined(__CUSOLVERMP)
311 flags = trim(flags)//
" cusolvermp"
313#if defined(__CUSOLVERMP_NCCL)
314 flags = trim(flags)//
" cusolvermp_nccl"
317 flags = trim(flags)//
" dlaf"
319#if defined(__LIBVDWXC)
320 flags = trim(flags)//
" libvdwxc"
323 flags = trim(flags)//
" hdf5"
326 flags = trim(flags)//
" trexio"
329 flags = trim(flags)//
" libfci"
331#if defined(__OFFLOAD_UNIFIED_MEMORY)
332 flags = trim(flags)//
" offload_unified_memory"
334#if defined(__SMEAGOL)
335 flags = trim(flags)//
" libsmeagol"
338 flags = trim(flags)//
" greenx"
341#if defined(__OPENPMD)
342 flags = trim(flags)//
" openpmd"
345#if defined(__LIBGINT)
346 flags = trim(flags)//
" libGint"
358 WRITE (unit=iunit, fmt=
"(T2,A)") &
359 "******************************************************************************", &
361 "* CP2K: A general program to perform molecular dynamics simulations *", &
362 "* Copyright (C) 2000-2026 CP2K developer group <https://www.cp2k.org/> *", &
364 "* This program is free software: you can redistribute it and/or modify *", &
365 "* it under the terms of the GNU General Public License as published by *", &
366 "* the Free Software Foundation, either version 2 of the License, or *", &
367 "* (at your option) any later version. *", &
369 "* This program is distributed in the hope that it will be useful, *", &
370 "* but WITHOUT ANY WARRANTY; without even the implied warranty of *", &
371 "* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *", &
372 "* GNU General Public License for more details. *", &
374 "* You should have received a copy of the GNU General Public License *", &
375 "* along with this program. If not, see <https://www.gnu.org/licenses/>. *", &
377 "******************************************************************************"
408 INTEGER,
INTENT(IN) :: iunit
410 CHARACTER(LEN=256) :: cwd
411 CHARACTER(LEN=timestamp_length) :: timestamp
416 WRITE (unit=iunit, fmt=
"(T2,A)")
"# Version information for this restart file "
417 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current date "//timestamp
418 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current working dir "//trim(cwd)
420 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
421 "# Program compiled at", &
423 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
424 "# Program compiled on", &
426 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
427 "# Program compiled for", &
429 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
430 "# Source code revision number", &
431 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_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,...