dev:codingconventions
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dev:codingconventions [2018/01/11 15:31] – [Use existing infrastructure] 130.60.136.207 | dev:codingconventions [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Coding Conventions ====== | ====== Coding Conventions ====== | ||
| + | |||
| ===== Stick to the standard ===== | ===== Stick to the standard ===== | ||
| - | | + | |
| - | * Avoid using new OOP aspects, because compilers do not yet support them well enough. | + | |
| - | * OpenMP code should follow | + | * OpenMP code should follow version 3.X of the standard |
| - | * MPI should should follow | + | * MPI should should follow version |
| - | * Extended functionality should match [[wp> | + | * Extended functionality should match [[wp> |
| ===== Write explicit code ===== | ===== Write explicit code ===== | ||
| Line 21: | Line 22: | ||
| ===== Don't use poorly designed language features ===== | ===== Don't use poorly designed language features ===== | ||
| * Do not use the '' | * Do not use the '' | ||
| - | * Do not use left-hand-side (lhs) reallocations of allocatables [-Wrealloc-lhs-all]. [[http://www.tddft.org/pipermail/octopus-devel/2012-February/005510.html | + | * Do not use left-hand-side (lhs) reallocations of allocatables [-Wrealloc-lhs]. [[https://github.com/cp2k/cp2k/issues/726 | Why? ]] |
| * Do not use '' | * Do not use '' | ||
| * Do not use '' | * Do not use '' | ||
| Line 38: | Line 39: | ||
| ===== Use existing infrastructure ===== | ===== Use existing infrastructure ===== | ||
| + | |||
| + | Always prefer [[https:// | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | |||
| For many common operations there exist wrappers in CP2K to prevent usage errors and to allow for central redirections, | For many common operations there exist wrappers in CP2K to prevent usage errors and to allow for central redirections, | ||
| + | |||
| * Use the routines from '' | * Use the routines from '' | ||
| * Use the routines from the full-matrix '' | * Use the routines from the full-matrix '' | ||
dev/codingconventions.1515684669.txt.gz · Last modified: (external edit)
