Giter Site home page Giter Site logo

dev-zero / cp2k Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cp2k/cp2k

0.0 0.0 0.0 229.89 MB

Quantum chemistry and solid state physics software package

Home Page: https://www.cp2k.org

License: GNU General Public License v2.0

Makefile 0.04% Fortran 96.91% Cuda 0.17% C++ 0.06% C 0.91% Shell 0.63% Python 0.65% PHP 0.07% Assembly 0.08% Dockerfile 0.01% Perl 0.05% Emacs Lisp 0.02% XSLT 0.06% JavaScript 0.05% HTML 0.01% M4 0.22% Pascal 0.04%

cp2k's People

Contributors

abussy avatar agloess avatar alazzaro avatar cjmundy avatar cschran avatar dcm-uni-paderborn avatar dev-zero avatar dgolze avatar hfp avatar juerghutter avatar jwilhelm avatar linalinalinalinalina avatar marci73 avatar mattiatj avatar michaellass avatar mkrack avatar mtaillefumier avatar obfiscator avatar oschuett avatar pappnasenpappmeister avatar pseewald avatar robertschade avatar rybkinjr avatar sandermatt87 avatar schulkov avatar seyedb avatar shoshijak avatar tlaino avatar uborstnik avatar vondele avatar

Watchers

 avatar  avatar

Forkers

sxm13

cp2k's Issues

cmake: basic libgrid support

includes CMake flag and detection

I would not bother about that one. the grid module will most probably never be a standalone library at least not in its current form. What is there is sufficient for now.

cmake: Github CI support for CMake

see also what we have for DBCSR, minimal version just to verify the CMakeLists.txt with the target CMake and Ninja version would be useful

should also include cmake-format and/or cmake-lint

cmake: basic libxc support

includes CMake flag and detection

libxc has cmake module already when we compile it (both libxc 4.3.4 and libxc 5.0.0) so I will include it in the cmake directory just in case.

spack cmake package.

I've tried to build this feature/cmake branch with spack. My package currently looks like this:

# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *


class Cp2kCmake(CMakePackage):
    """CP2K is a quantum chemistry and solid state physics software package
    that can perform atomistic simulations of solid state, liquid, molecular,
    periodic, material, crystal, and biological systems
    """

    homepage = "https://www.cp2k.org"
    url      = "https://github.com/dev-zero/cp2k"
    git      = "https://github.com/dev-zero/cp2k.git"

    version('develop', branch='feature/cmake')

    build_directory = 'spack-build'

    variant('mpi', default=True, description='Enable MPI support')
    variant('smm', default='libxsmm', values=('libxsmm', 'libsmm', 'blas'),
            description='Library for small matrix multiplications')

    depends_on('blas')
    depends_on('lapack')
    depends_on('fftw-api@3')
    depends_on('mpi@2:', when='+mpi')

    depends_on('dbcsr')
    depends_on('[email protected]:~header-only', when='smm=libxsmm')

    # Build dependencies
    depends_on('python', type='build')
    depends_on("py-fypp", type="build")
    depends_on("pkgconfig", type='build')

    conflicts('smm=libxsmm',  when='target=aarch64:', msg='libxsmm is not available on arm')
    
    # Make sure dependencies use openmp threading
    conflicts('^fftw~openmp')
    conflicts('^openblas threads=none')
    conflicts('^openblas threads=pthreads')

    def cmake_args(self):
        return [
            self.define_from_variant('USE_MPI', 'mpi'),
        ]

I had to fix:

  • two build errors, one about get_accdrv_active_device_id not being exported from dbcsr, so I patched dbcsr locally. And another one about truncated lines due to CPABORT calls, which is just trimmed a bit.
  • adding a make install target: #41

I create the following environment file in the parent folder where I had cloned both cp2k and dbcsr:

$ ls
cp2k  dbcsr  spack.yaml
$ cat spack.yaml 
spack:
  specs: 
    - cp2k-cmake@develop %gcc@:9 ^openblas threads=openmp ^dbcsr@develop +openmp +cuda cuda_arch=70 ^cuda@:11.0 ^fftw +openmp
  develop:
    cp2k-cmake:
      path: ./cp2k
      spec: cp2k-cmake@develop
    dbcsr:
      path: ./dbcsr
      spec: dbcsr@develop
$ spack -e . install -v
...
[+] /home/harmen/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/cp2k-cmake-develop-aytliij634jsqmkoybvbefdm6qojl3dy

and it works just fine. I wonder if the spack package would get a lot shorter after migration to cmake.

I'm just leaving this here, cause I don't know where else to share it.

cmake: ScaLAPACK support

includes CMake flag and detection. Question here: should we allow for an MPI-build without ScaLAPACK at all? Seems untested and I would vote 'no'.

cmake: libvori support

includes CMake flag and detection, it may make sense to extend libvori's CMakeLists.txt by an Export like we have for DBCSR such that one only has to set the CMake include path to get the lib

cmake: require specific DBCSR configuration and version

There are numerous combinations on how to build CP2K and DBCSR and the combination of them. At the moment, building DBCSR as a submodule inside the current build system restricts the combinations and ensures that options are used consistently (for example MPI, CUDA, etc.).
Since we cannot test all combinations it may be a good idea to check for consistent options rigorously. DBCSR possibly has to be extended to export them in a parseable fashion.

cmake: QUIP support

includes CMake flag and detection, possibly adding -fallow-argument-mismatch is needed for older QUIP versions and with GCC-10+

cmake: add CUDA/HIP support

some of this can be taken from DBCSR, but may need to be revisited since CMake gained a couple of feats/bugfixes since it started over there. Also: it may be useful to use sub-CMakeLists.txt for the dirs where this applies to avoid a mess.

also include CUDA Profiling support, see DBCSR for that part

cmake: support tools/ building

we have a couple of interesting tools/ which may be built with CMake as well to ensure they still work, add support for those extra targets, possibly ensuring that their CMakeLists.txt can be easily used standalone (similar to DBCSRs examples CMakeLists.txt which with ~3 line changes can be used standalone)

cmake: document multi-version building

the current build system allows to build multiple ARCHs and VERSIONs at the same time, of this multi-version may be worthwhile and should be doable when using Ninja (?). The least we need is some documentation that people have to have different build dirs for now and/or a script to automate multi-version builds like before

cmake: FPGA support

includes CMake flag and detection, probably have to contact original devs for verification of this, and maybe update deps since Intels oneAPI

cmake: support various dependency-less flags

everything not covered elsewhere:

  • __MKL (while not dependency-less, we always get BLAS/LAPACK(/ScaLAPACK) and simply have to detect the vendor
  • __GRID_CORE
  • __PILAENV_BLOCKSIZE
  • __CRAY_PM_ACCEL_ENERGY and __CRAY_PM_ENERGY
  • __NO_MPI_THREAD_SUPPORT_CHECK
  • __HAS_IEEE_EXCEPTIONS
  • __CHECK_DIAG

cmake: check for ELPA version

ELPA has a working runtime detection and maintained the API for some time, nevertheless we should check for an ELPA version which has this API. Detecting a too old ELPA version should lead to a warning when linking dynamically, and an error when linking statically

cmake: upstream FindBLAS.cmake changes

currently there is a patched FindBLAS (and thus FindLAPACK) module, this is made such that we can detect a separately provided OpenMP-safe OpenBLAS. Ideally we should factor that out as a COMPONENTS argument for FindBLAS and send it to upstream for inclusion. At the same time possibly also implement the same for Intel MKL (which also provides different sets of threaded/non-thread libraries).

cmake: FFTW support

includes flag and detection, but we may have to check the lib further for threading and MPI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.