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.1 (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_HDF5)
135 flags = trim(flags)//
" gauxc_hdf5"
138 flags = trim(flags)//
" pexsi"
141 flags = trim(flags)//
" elpa"
143#if defined(__parallel)
144#if defined(__SCALAPACK_NO_WA)
145 flags = trim(flags)//
" parallel scalapack"
147 flags = trim(flags)//
" parallel scalapack"
150#if defined(__MPI_F08)
151 flags = trim(flags)//
" mpi_f08"
154 flags = trim(flags)//
" cosma"
157 flags = trim(flags)//
" ace"
160 flags = trim(flags)//
" deepmd"
162#if defined(__PW_FPGA)
163 flags = trim(flags)//
" pw_fpga"
165#if defined(__PW_FPGA_SP)
166 flags = trim(flags)//
" pw_fpga_sp"
169 flags = trim(flags)//
" libxs"
171#if defined(__LIBXSMM)
172 flags = trim(flags)//
" libxsmm"
174#if defined(__LIBXSTREAM)
175 flags = trim(flags)//
" libxstream"
177#if defined(__CRAY_PM_ACCEL_ENERGY)
178 flags = trim(flags)//
" cray_pm_accel_energy"
180#if defined(__CRAY_PM_ENERGY)
181 flags = trim(flags)//
" cray_pm_energy"
183#if defined(__CRAY_PM_FAKE_ENERGY)
184 flags = trim(flags)//
" cray_pm_fake_energy"
186#if defined(__DBCSR_ACC)
187 flags = trim(flags)//
" dbcsr_acc"
189#if defined(__MAX_CONTR)
191 flags = trim(flags)//
" max_contr="//trim(tmp_str)
193#if defined(__NO_SOCKETS)
194 flags = trim(flags)//
" no_sockets"
196#if defined(__NO_STATM_ACCESS)
197 flags = trim(flags)//
" no_statm_access"
199#if defined(__PW_CUDA_NO_HOSTALLOC)
200 flags = trim(flags)//
" pw_cuda_no_hostalloc"
202#if defined(__STATM_RESIDENT)
203 flags = trim(flags)//
" statm_resident"
205#if defined(__STATM_TOTAL)
206 flags = trim(flags)//
" statm_total"
208#if defined(__PLUMED2)
209 flags = trim(flags)//
" plumed2"
211#if defined(__HAS_IEEE_EXCEPTIONS)
212 flags = trim(flags)//
" has_ieee_exceptions"
214#if defined(__NO_ABORT)
215 flags = trim(flags)//
" no_abort"
218 flags = trim(flags)//
" spglib"
220#if defined(__ACCELERATE)
221 flags = trim(flags)//
" accelerate"
224 flags = trim(flags)//
" mkl"
227 flags = trim(flags)//
" libdftd4"
229#if defined(__DFTD4_V3)
230 flags = trim(flags)//
" dftd4_v3"
232#if defined(__DFTD4_V4_2)
233 flags = trim(flags)//
" dftd4_v4_2"
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"
274 flags = trim(flags)//
" mimic"
276#if defined(__OFFLOAD_CUDA)
277 flags = trim(flags)//
" offload_cuda"
279#if defined(__OFFLOAD_HIP)
280 flags = trim(flags)//
" offload_hip"
282#if defined(__OFFLOAD_OPENCL)
283 flags = trim(flags)//
" offload_opencl"
285#if defined(__NO_OFFLOAD_ELPA)
286 flags = trim(flags)//
" no_offload_elpa"
288#if defined(__NO_OFFLOAD_GRID)
289 flags = trim(flags)//
" no_offload_grid"
291#if defined(__NO_OFFLOAD_DBM)
292 flags = trim(flags)//
" no_offload_dbm"
294#if defined(__NO_OFFLOAD_PW)
295 flags = trim(flags)//
" no_offload_pw"
297#if defined(__OFFLOAD_PROFILING)
298 flags = trim(flags)//
" offload_profiling"
300#if defined(__SPLA) && defined(__OFFLOAD_GEMM)
301 flags = trim(flags)//
" spla_gemm_offloading"
303#if defined(__CUSOLVERMP)
304 flags = trim(flags)//
" cusolvermp"
306#if defined(__CUSOLVERMP_NCCL)
307 flags = trim(flags)//
" cusolvermp_nccl"
310 flags = trim(flags)//
" dlaf"
312#if defined(__LIBVDWXC)
313 flags = trim(flags)//
" libvdwxc"
316 flags = trim(flags)//
" hdf5"
319 flags = trim(flags)//
" trexio"
322 flags = trim(flags)//
" libfci"
324#if defined(__OFFLOAD_UNIFIED_MEMORY)
325 flags = trim(flags)//
" offload_unified_memory"
327#if defined(__SMEAGOL)
328 flags = trim(flags)//
" libsmeagol"
331 flags = trim(flags)//
" greenx"
334#if defined(__OPENPMD)
335 flags = trim(flags)//
" openpmd"
348 WRITE (unit=iunit, fmt=
"(T2,A)") &
349 "******************************************************************************", &
351 "* CP2K: A general program to perform molecular dynamics simulations *", &
352 "* Copyright (C) 2000-2026 CP2K developer group <https://www.cp2k.org/> *", &
354 "* This program is free software: you can redistribute it and/or modify *", &
355 "* it under the terms of the GNU General Public License as published by *", &
356 "* the Free Software Foundation, either version 2 of the License, or *", &
357 "* (at your option) any later version. *", &
359 "* This program is distributed in the hope that it will be useful, *", &
360 "* but WITHOUT ANY WARRANTY; without even the implied warranty of *", &
361 "* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *", &
362 "* GNU General Public License for more details. *", &
364 "* You should have received a copy of the GNU General Public License *", &
365 "* along with this program. If not, see <https://www.gnu.org/licenses/>. *", &
367 "******************************************************************************"
398 INTEGER,
INTENT(IN) :: iunit
400 CHARACTER(LEN=256) :: cwd
401 CHARACTER(LEN=timestamp_length) :: timestamp
406 WRITE (unit=iunit, fmt=
"(T2,A)")
"# Version information for this restart file "
407 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current date "//timestamp
408 WRITE (unit=iunit, fmt=
"(T2,A)")
"# current working dir "//trim(cwd)
410 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
411 "# Program compiled at", &
413 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
414 "# Program compiled on", &
416 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
417 "# Program compiled for", &
419 WRITE (unit=iunit, fmt=
"(T2,A,T31,A50)") &
420 "# Source code revision number", &
421 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,...