dev:codestructure
This is an old revision of the document!
CP2K Code Structure
CP2K is a large, complex application which has many features, methods and algorithms implemented. When looking at the code for the first time it can be very challenging to understand how it all works, or even where to start looking! This page is intended for novice developers who have read and understood the literature and wish to locate the relevant algorithms and data structures in the code.
File Names
Source files should have prefixes corresponding to their main functionalities. For example:
qs_*
for Quickstep related source codes (Hamiltonian construction, integration, collocation, energy minimisation and SCF cycle etc)xc_*
for Exchange-Correlation functionals used by Quickstepmd_*
for Molecular Dynamics related source codesmc_*
for Quantum Monte Carlo related source codesfist_*
for FIST classical MD related source codesinput_*
for general input functions of CP2Kqmmm_*
for QM/MM related source codesmesssage_*
for MPI message passing related source codesmachine_*
for architecture dependent codesadmm_*
for auxilliary density matrix (ADMM) method related codesai_*
for integrals of the primitive cartesian Gaussiansatomic_*
for datatypes related to information on atoms in a simulationatom_*
for atomic calculations
These prefixes are not exclusive, nor are they always logical. There are exceptions in code naming conventions, for example:
realspace_grid_types.F
andrealspace_grid_cube.F
are both used in Quickstep, but do not have the correspondingqs_
prefix
Overall Structure
- Extensive use of Fortran modules, and there are no global variables
- Major parts of the CP2K code are compiled into separate libraries, for example:
cp2k_lib
,cp2k_base_lib
,cp2k_dbcsr_lib
,cp2k_ft_lib
etc.
dev/codestructure.1381405194.txt.gz · Last modified: 2020/08/21 10:14 (external edit)