diff --git a/Dockerfile.cp2k b/Dockerfile.cp2k index e7c0872..afb5c29 100644 --- a/Dockerfile.cp2k +++ b/Dockerfile.cp2k @@ -1,7 +1,7 @@ # # This file was created by generate_docker_files.py # -# Usage: docker build -f ./2023.2_openmpi_generic_psmp.Dockerfile -t cp2k/cp2k:2023.2_openmpi_generic_psmp . +# Usage: docker build -f ./2024.1_mpich_generic_psmp.Dockerfile -t cp2k/cp2k:2024.1_mpich_generic_psmp . # Stage 1: build step FROM ubuntu:22.04 AS build @@ -9,22 +9,22 @@ FROM ubuntu:22.04 AS build # Install packages required for the CP2K toolchain build RUN apt-get update -qq && apt-get install -qq --no-install-recommends \ - g++ gcc gfortran openssh-client python3 \ + g++ gcc gfortran libmpich-dev mpich openssh-client python3 \ bzip2 ca-certificates git make patch pkg-config unzip wget zlib1g-dev # Download CP2K -RUN git clone --recursive -b support/v2023.2 https://github.com/cp2k/cp2k.git /opt/cp2k +RUN git clone --recursive -b support/v2024.1 https://github.com/cp2k/cp2k.git /opt/cp2k # Build CP2K toolchain for target CPU generic WORKDIR /opt/cp2k/tools/toolchain RUN /bin/bash -c -o pipefail \ - "./install_cp2k_toolchain.sh -j 8 \ + "./install_cp2k_toolchain.sh -j 12 \ --install-all \ --enable-cuda=no \ --target-cpu=generic \ --with-cusolvermp=no \ --with-gcc=system \ - --with-openmpi=install \ + --with-mpich=system \ --with-libtorch=no" # Build CP2K for target CPU generic @@ -32,7 +32,7 @@ WORKDIR /opt/cp2k RUN /bin/bash -c -o pipefail \ "cp ./tools/toolchain/install/arch/local.psmp ./arch/; \ source ./tools/toolchain/install/setup; \ - make -j 8 ARCH=local VERSION=psmp" + make -j 12 ARCH=local VERSION=psmp" # Collect components for installation and remove symbolic links RUN /bin/bash -c -o pipefail \ @@ -52,7 +52,7 @@ FROM ubuntu:22.04 AS install # Install required packages RUN apt-get update -qq && apt-get install -qq --no-install-recommends \ - g++ gcc gfortran openssh-client python3 && rm -rf /var/lib/apt/lists/* + g++ gcc gfortran libmpich-dev mpich openssh-client python3 && rm -rf /var/lib/apt/lists/* # Install CP2K binaries COPY --from=build /opt/cp2k/exe/local/ /opt/cp2k/exe/local/ @@ -83,9 +83,6 @@ RUN /bin/bash -c -o pipefail \ RUN printf "#!/bin/bash\n\ ulimit -c 0 -s unlimited\n\ \ -export OMPI_ALLOW_RUN_AS_ROOT=1\n\ -export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1\n\ -export OMPI_MCA_btl_vader_single_copy_mechanism=none\n\ export OMP_STACKSIZE=16M\n\ export PATH=/opt/cp2k/exe/local:\${PATH}\n\ source /opt/cp2k/tools/toolchain/install/setup\n\ @@ -93,7 +90,7 @@ source /opt/cp2k/tools/toolchain/install/setup\n\ >/opt/entry.sh && chmod 755 /opt/entry.sh # Create shortcut for regression test -RUN printf "/opt/cp2k/tools/regtesting/do_regtest.py --mpiexec \"mpiexec --bind-to none\" --maxtasks 8 --workbasedir /mnt \$* local psmp" \ +RUN printf "/opt/cp2k/tests/do_regtest.py --maxtasks 8 --workbasedir /mnt \$* local psmp" \ >/usr/local/bin/run_tests && chmod 755 /usr/local/bin/run_tests # Define entrypoint @@ -103,7 +100,7 @@ CMD ["cp2k", "--help"] # Label docker image LABEL author="CP2K Developers" \ - cp2k_version="2023.2" \ + cp2k_version="2024.1" \ dockerfile_generator_version="0.2" # EOF diff --git a/build_containers.sh b/build_containers.sh index 76aa046..4da394a 100644 --- a/build_containers.sh +++ b/build_containers.sh @@ -67,7 +67,7 @@ if [ "$psiflow" = "true" ]; then fi if [ "$cp2k" = "true" ]; then - TAG="cp2k:2023.2" + TAG="cp2k:2024.1" docker build \ -t ghcr.io/molmod/$TAG \ -f Dockerfile.cp2k . diff --git a/configs/threadpool.yaml b/configs/threadpool.yaml index 23edc30..2e8f698 100644 --- a/configs/threadpool.yaml +++ b/configs/threadpool.yaml @@ -11,20 +11,17 @@ ModelTraining: CP2K: cores_per_worker: 2 max_evaluation_time: 0.3 - launch_command: 'mpirun -np 2 -x OMP_NUM_THREADS=1 cp2k.psmp -i cp2k.inp' - use_threadpool: true + launch_command: 'apptainer exec -e --no-init oras://ghcr.io/molmod/cp2k:2024.1 /opt/entry.sh mpirun -bind-to core -np 2 -env OMP_NUM_THREADS 1 cp2k.psmp -i cp2k.inp' CP2K_container: cores_per_worker: 2 max_evaluation_time: 0.3 - launch_command: 'apptainer exec -e --no-init oras://ghcr.io/molmod/cp2k:2023.2 /opt/entry.sh mpirun -np 2 -x OMP_NUM_THREADS=1 cp2k.psmp -i cp2k.inp' - use_threadpool: true + launch_command: 'apptainer exec -e --no-init oras://ghcr.io/molmod/cp2k:2024.1 /opt/entry.sh mpirun -bind-to core -np 2 -env OMP_NUM_THREADS 1 cp2k.psmp -i cp2k.inp' GPAW: cores_per_worker: 2 max_evaluation_time: 0.3 - use_threadpool: true + launch_command: 'apptainer exec -e --no-init oras://ghcr.io/molmod/gpaw:24.1 /opt/entry.sh mpirun -np 2 gpaw python /opt/run_gpaw.py input.json' GPAW_container: cores_per_worker: 2 max_evaluation_time: 0.3 launch_command: 'apptainer exec -e --no-init oras://ghcr.io/molmod/gpaw:24.1 /opt/entry.sh mpirun -np 2 gpaw python /opt/run_gpaw.py input.json' - use_threadpool: true ...