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#if defined(__INTEL_LLVM_COMPILER)
105 flags = trim(flags)//
" ifx"
108 flags = trim(flags)//
" libint"
111 flags = trim(flags)//
" fftw3"
114 flags = trim(flags)//
" libxc"
117 flags = trim(flags)//
" gauxc"
119#if defined(GAUXC_HAS_MPI)
120 flags = trim(flags)//
" gauxc_mpi"
122#if defined(GAUXC_HAS_ONEDFT)
123 flags = trim(flags)//
" gauxc_onedft"
125#if defined(GAUXC_HAS_HOST)
126 flags = trim(flags)//
" gauxc_host"
128#if defined(GAUXC_HAS_DEVICE)
129 flags = trim(flags)//
" gauxc_device"
131#if defined(GAUXC_HAS_CUDA)
132 flags = trim(flags)//
" gauxc_cuda"
134#if defined(GAUXC_HAS_CUTLASS)
135 flags = trim(flags)//
" gauxc_cutlass"
137#if defined(GAUXC_HAS_HDF5)
138 flags = trim(flags)//
" gauxc_hdf5"
141 flags = trim(flags)//
" pexsi"
144 flags = trim(flags)//
" elpa"
146#if defined(__parallel)
147#if defined(__SCALAPACK_NO_WA)
148 flags = trim(flags)//
" parallel scalapack"
150 flags = trim(flags)//
" parallel scalapack"
153#if defined(__MPI_F08)
154 flags = trim(flags)//
" mpi_f08"
157 flags = trim(flags)//
" cosma"
160 flags = trim(flags)//
" ace"
163 flags = trim(flags)//
" deepmd"
165#if defined(__PW_FPGA)
166 flags = trim(flags)//
" pw_fpga"
168#if defined(__PW_FPGA_SP)
169 flags = trim(flags)//
" pw_fpga_sp"
172 flags = trim(flags)//
" libxs"
174#if defined(__LIBXSMM)
175 flags = trim(flags)//
" libxsmm"
177#if defined(__LIBXSTREAM)
178 flags = trim(flags)//
" libxstream"
180#if defined(__CRAY_PM_ACCEL_ENERGY)
181 flags = trim(flags)//
" cray_pm_accel_energy"
183#if defined(__CRAY_PM_ENERGY)
184 flags = trim(flags)//
" cray_pm_energy"
186#if defined(__CRAY_PM_FAKE_ENERGY)
187 flags = trim(flags)//
" cray_pm_fake_energy"
189#if defined(__DBCSR_ACC)
190 flags = trim(flags)//
" dbcsr_acc"
192#if defined(__MAX_CONTR)
194 flags = trim(flags)//
" max_contr="//trim(tmp_str)
196#if defined(__NO_SOCKETS)
197 flags = trim(flags)//
" no_sockets"
199#if defined(__NO_STATM_ACCESS)
200 flags = trim(flags)//
" no_statm_access"
202#if defined(__PW_CUDA_NO_HOSTALLOC)
203 flags = trim(flags)//
" pw_cuda_no_hostalloc"
205#if defined(__STATM_RESIDENT)
206 flags = trim(flags)//
" statm_resident"
208#if defined(__STATM_TOTAL)
209 flags = trim(flags)//
" statm_total"
211#if defined(__PLUMED2)
212 flags = trim(flags)//
" plumed2"
214#if defined(__HAS_IEEE_EXCEPTIONS)
215 flags = trim(flags)//
" has_ieee_exceptions"
217#if defined(__NO_ABORT)
218 flags = trim(flags)//
" no_abort"
221 flags = trim(flags)//
" spglib"
223#if defined(__ACCELERATE)
224 flags = trim(flags)//
" accelerate"
227 flags = trim(flags)//
" mkl"
229#if defined(__OPENBLAS)
230 flags = trim(flags)//
" openblas"
233 flags = trim(flags)//
" libdftd4"
235#if defined(__S_DFTD3)
236 flags = trim(flags)//
" s_dftd3"
239 flags = trim(flags)//
" mctc-lib"
240 flags = trim(flags)//
" tblite"
242#if defined(__TBLITE_DEBUG_DIAGNOSTICS)
243 flags = trim(flags)//
" tblite_debug_diagnostics"
246 flags = trim(flags)//
" sirius"
248#if defined(__SIRIUS_NLCG)
249 flags = trim(flags)//
" sirius_nlcg"
251#if defined(__SIRIUS_DFTD3)
252 flags = trim(flags)//
" sirius_dftd3"
254#if defined(__SIRIUS_DFTD4)
255 flags = trim(flags)//
" sirius_dftd4"
257#if defined(__SIRIUS_VCSQNM)
258 flags = trim(flags)//
" sirius_vcsqnm"
260#if defined(__CHECK_DIAG)
261 flags = trim(flags)//
" check_diag"
263#if defined(__LIBVORI)
264 flags = trim(flags)//
" libvori"
265 flags = trim(flags)//
" libbqb"
267#if defined(__LIBMAXWELL)
268 flags = trim(flags)//
" libmaxwell"
270#if defined(__LIBTORCH)
271 flags = trim(flags)//
" libtorch"
273#if defined(__LIBTORCH_CUDA)
274 flags = trim(flags)//
" libtorch_cuda"
277 flags = trim(flags)//
" mimic"
279#if defined(__OFFLOAD_CUDA)
280 flags = trim(flags)//
" offload_cuda"
282#if defined(__OFFLOAD_HIP)
283 flags = trim(flags)//
" offload_hip"
285#if defined(__OFFLOAD_OPENCL)
286 flags = trim(flags)//
" offload_opencl"
288#if defined(__NO_OFFLOAD_ELPA)
289 flags = trim(flags)//
" no_offload_elpa"
291#if defined(__NO_OFFLOAD_GRID)
292 flags = trim(flags)//
" no_offload_grid"
294#if defined(__NO_OFFLOAD_DBM)
295 flags = trim(flags)//
" no_offload_dbm"
297#if defined(__NO_OFFLOAD_PW)
298 flags = trim(flags)//
" no_offload_pw"
300#if defined(__OFFLOAD_PROFILING)
301 flags = trim(flags)//
" offload_profiling"
303#if defined(__SPLA) && defined(__OFFLOAD_GEMM)
304 flags = trim(flags)//
" spla_gemm_offloading"
306#if defined(__CUSOLVERMP)
307 flags = trim(flags)//
" cusolvermp"
309#if defined(__CUSOLVERMP_NCCL)
310 flags = trim(flags)//
" cusolvermp_nccl"
313 flags = trim(flags)//
" dlaf"
315#if defined(__LIBVDWXC)
316 flags = trim(flags)//
" libvdwxc"
319 flags = trim(flags)//
" hdf5"
322 flags = trim(flags)//
" trexio"
325 flags = trim(flags)//
" libfci"
327#if defined(__OFFLOAD_UNIFIED_MEMORY)
328 flags = trim(flags)//
" offload_unified_memory"
330#if defined(__SMEAGOL)
331 flags = trim(flags)//
" libsmeagol"
334 flags = trim(flags)//
" greenx"
337#if defined(__OPENPMD)
338 flags = trim(flags)//
" openpmd"
341#if defined(__LIBGINT)
342 flags = trim(flags)//
" libGint"
354 WRITE (unit=iunit, fmt=
"(T2,A)") &
355 "******************************************************************************", &
357 "* CP2K: A general program to perform molecular dynamics simulations *", &
358 "* Copyright (C) 2000-2026 CP2K developer group <https://www.cp2k.org/> *", &
360 "* This program is free software: you can redistribute it and/or modify *", &
361 "* it under the terms of the GNU General Public License as published by *", &
362 "* the Free Software Foundation, either version 2 of the License, or *", &
363 "* (at your option) any later version. *", &
365 "* This program is distributed in the hope that it will be useful, *", &
366 "* but WITHOUT ANY WARRANTY; without even the implied warranty of *", &
367 "* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *", &
368 "* GNU General Public License for more details. *", &
370 "* You should have received a copy of the GNU General Public License *", &
371 "* along with this program. If not, see <https://www.gnu.org/licenses/>. *", &
373 "******************************************************************************"
404 INTEGER,
INTENT(IN) :: iunit
406 CHARACTER(LEN=256) :: cwd
407 CHARACTER(LEN=timestamp_length) :: timestamp
412 WRITE (unit=iunit, fmt=
"(T2,A)")
"# Version information for this restart file "
413 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current date "//timestamp
414 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current working dir "//trim(cwd)
416 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
417 "# Program compiled at", &
419 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
420 "# Program compiled on", &
422 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
423 "# Program compiled for", &
425 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
426 "# Source code revision number", &
427 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,...