diff --git a/Dockerfile b/Dockerfile index 2e18dc8..767d073 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Discover the sha by removing the @sha part and running: timeout 5 docker buildx build --pull --no-cache . # Dockerhub does not show the overall sha https://github.com/docker/roadmap/issues/262 -FROM fedora:37@sha256:f99efcddc4dd6736d8a88cc1ab6722098ec1d77dbf7aed9a7a514fc997ca08e0 +FROM fedora:38@sha256:8285246bd5fad4e76e17a71c88dee34c49e2f227dab4ce7df704b592f8e72d41 # https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope ARG TARGETPLATFORM @@ -13,8 +13,8 @@ RUN echo uname -m $(uname -m) LABEL name="GPAW Openmpi" \ url="https://wiki.fysik.dtu.dk/gpaw/" -ENV GPAW_VERSION 22.8.0 -ENV FEDORA_RELEASE 2.fc37 +ENV GPAW_VERSION 23.6.0 +ENV FEDORA_RELEASE 1.fc38 RUN set -x \ && dnf install -y \ diff --git a/README.md b/README.md index e94fdd4..3f95f47 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ First, make sure you are able to run the `docker run hello-world` example https: Then test the basic GPAW functionality ```sh -docker run --rm -it marcindulak/gpaw-openmpi:latest bash -c '. /etc/profile.d/modules.sh&& module use /usr/share/modulefiles&& module load mpi/openmpi && mpiexec --allow-run-as-root -np 2 python3 -c "import gpaw.mpi; print(gpaw.mpi.rank)"' +docker run --rm -it marcindulak/gpaw-openmpi:latest bash -c '. /etc/profile.d/modules.sh&& module use /usr/share/modulefiles&& module load mpi/openmpi && PYTHONPATH=$MPI_PYTHON3_SITEARCH OMP_NUM_THREADS=1 mpiexec --allow-run-as-root -np 2 python3 -c "import gpaw.mpi; print(gpaw.mpi.rank)"' ``` **Note**: if on MS Windows you are getting 'image operating system "linux" cannot be used on this platform' follow https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers @@ -48,7 +48,7 @@ docker compose -f docker-compose.myjob.yml down ## Run a job manually ```sh -docker run --name myjob --rm -it -v "$(pwd)/myjob:/mnt" marcindulak/gpaw-openmpi:latest bash -c '. /etc/profile.d/modules.sh&& module use /usr/share/modulefiles&& module load mpi/openmpi && cd /mnt&& mpiexec --allow-run-as-root -np 2 python3 h2.py' +docker run --name myjob --rm -it -v "$(pwd)/myjob:/mnt" marcindulak/gpaw-openmpi:latest bash -c '. /etc/profile.d/modules.sh&& module use /usr/share/modulefiles&& module load mpi/openmpi && cd /mnt&& PYTHONPATH=$MPI_PYTHON3_SITEARCH OMP_NUM_THREADS=1 mpiexec --allow-run-as-root -np 2 python3 h2.py' ``` ## Examine the created output file diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index 73b16bc..d7aaf28 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -12,4 +12,6 @@ services: module use /usr/share/modulefiles module load mpi/openmpi cd /mnt + export PYTHONPATH=$MPI_PYTHON3_SITEARCH + export OMP_NUM_THREADS=1 mpiexec --allow-run-as-root -np 1 python3 h2.py && grep "Free energy" h2.txt diff --git a/docker-compose.myjob.yml b/docker-compose.myjob.yml index 282d198..03e4b1b 100644 --- a/docker-compose.myjob.yml +++ b/docker-compose.myjob.yml @@ -12,4 +12,6 @@ services: module use /usr/share/modulefiles module load mpi/openmpi cd /mnt + export PYTHONPATH=$MPI_PYTHON3_SITEARCH + export OMP_NUM_THREADS=1 mpiexec --allow-run-as-root -np 2 python3 h2.py && grep "Free energy" h2.txt diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 7b445c7..d91da14 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -9,6 +9,8 @@ services: . /etc/profile.d/modules.sh module use /usr/share/modulefiles module load mpi/openmpi + export PYTHONPATH=$MPI_PYTHON3_SITEARCH + export OMP_NUM_THREADS=1 python3 -c "import gpaw.mpi; print(gpaw.mpi.rank)" cat <<'EOF' > h2.py from ase import Atoms