Skip to content

Commit

Permalink
Merge branch 'develop' into feature_uncertainty
Browse files Browse the repository at this point in the history
  • Loading branch information
elcorto committed Jul 29, 2024
2 parents cbca55c + 0fed9cc commit 4041871
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 24 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/cpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: '1'

- name: Set environment variables
run: |
Expand Down Expand Up @@ -62,7 +64,7 @@ jobs:
fi
- name: Pull latest image from container registry
run: docker pull $IMAGE_REPO/$IMAGE_NAME || true
run: docker pull $IMAGE_REPO/$IMAGE_NAME --quiet || true

- name: Build temporary Docker image
run: |
Expand Down Expand Up @@ -131,12 +133,12 @@ jobs:

- name: "Prepare environment: Load Docker image from cache"
if: env.DOCKER_TAG != 'latest'
run: docker load -i $DOCKER_CACHE_PATH/docker-image.tar.gz
run: docker load -i $DOCKER_CACHE_PATH/docker-image.tar.gz --quiet

- name: "Prepare environment: Pull latest image from container registry"
if: env.DOCKER_TAG == 'latest'
run: |
docker pull $IMAGE_REPO/$IMAGE_NAME:latest
docker pull $IMAGE_REPO/$IMAGE_NAME:latest --quiet
docker image tag $IMAGE_REPO/$IMAGE_NAME:latest $IMAGE_NAME:latest
- name: "Prepare environment: Run Docker container"
Expand All @@ -155,6 +157,8 @@ jobs:
- name: Check out repository (mala)
uses: actions/checkout@v4
with:
fetch-depth: '1'

- name: Install mala package
# Exec all commands inside the mala-cpu container
Expand All @@ -174,7 +178,13 @@ jobs:
# if comparison fails, `install/mala_cpu_[base]_environment.yml` needs to be aligned with
# `requirements.txt` and/or extra dependencies are missing in the Docker Conda environment
diff --side-by-side --color=always env_before.yml env_after.yml
if diff --brief env_before.yml env_after.yml
then
echo "Files env_before.yml and env_after.yml do not differ."
else
diff --side-by-side --color-always env_before.yml env_after.yml
fi
- name: Download test data repository from RODARE
shell: 'bash -c "docker exec -i mala-cpu python < {0}"'
Expand Down Expand Up @@ -229,9 +239,6 @@ jobs:
((contains(github.ref_name, 'develop') || contains(github.ref_name, 'master')) && needs.build-docker-image-cpu.outputs.docker-tag != 'latest')
|| startsWith(github.ref, 'refs/tags/')
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: "Prepare environment: Restore cache"
if: env.DOCKER_TAG != 'latest'
uses: actions/cache@v4
Expand All @@ -242,21 +249,19 @@ jobs:

- name: "Prepare environment: Load Docker image from cache"
if: env.DOCKER_TAG != 'latest'
run: docker load -i $DOCKER_CACHE_PATH/docker-image.tar.gz
run: docker load -i $DOCKER_CACHE_PATH/docker-image.tar.gz --quiet

- name: "Prepare environment: Pull latest image from container registry"
if: env.DOCKER_TAG == 'latest'
run: docker pull $IMAGE_REPO/$IMAGE_NAME:latest
run: docker pull $IMAGE_REPO/$IMAGE_NAME:latest --quiet

- name: Tag Docker image
run: |
# Execute on change of Docker image
if [[ "$DOCKER_TAG" != 'latest' ]]; then
GIT_SHA=${GITHUB_REF_NAME}-$(git rev-parse --short "$GITHUB_SHA")
echo "GIT_SHA=$GIT_SHA"
docker tag $IMAGE_NAME:$GITHUB_RUN_ID $IMAGE_REPO/$IMAGE_NAME:latest
docker tag $IMAGE_NAME:$GITHUB_RUN_ID $IMAGE_REPO/$IMAGE_NAME:$GIT_SHA
docker tag $IMAGE_NAME:$GITHUB_RUN_ID $IMAGE_REPO/$IMAGE_NAME:${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}
fi
# Execute on push of git tag
Expand All @@ -272,4 +277,4 @@ jobs:
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push Docker image
run: docker push $IMAGE_REPO/$IMAGE_NAME --all-tags
run: docker push $IMAGE_REPO/$IMAGE_NAME --all-tags | grep -v -E 'Waiting|Layer already|Preparing|Pushed'
3 changes: 2 additions & 1 deletion docs/source/advanced_usage/predictions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Likewise, you can adjust the inference temperature via
calculator.data_handler.target_calculator.temperature = ...
.. _production_gpu:

Predictions on GPU
*******************

Expand Down Expand Up @@ -137,4 +139,3 @@ With the exception of the electronic density, which is saved into the ``.cube``
format for visualization with regular electronic structure visualization
software, all of these observables can be plotted with Python based
visualization libraries such as ``matplotlib``.

10 changes: 8 additions & 2 deletions docs/source/install/installing_lammps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,24 @@ The MALA team recommends to build LAMMPS with ``cmake``. To do so
* ``Kokkos_ARCH_GPUARCH=???``: Your GPU architecture (see see `Kokkos instructions <https://docs.lammps.org/Build_extras.html#kokkos-package>`_)
* ``CMAKE_CXX_COMPILER=???``: Path to the ``nvcc_wrapper`` executable
shipped with the LAMMPS code, should be at ``/your/path/to/lammps/lib/kokkos/bin/nvcc_wrapper``
* For example, this configures the LAMMPS cmake build with Kokkos support
for an Intel Haswell CPU and an Nvidia Volta GPU, with MPI support:

For example, this configures the LAMMPS cmake build with Kokkos support
for an Intel Haswell CPU and an Nvidia Volta GPU, with MPI support:

.. code-block:: bash
cmake ../cmake -D PKG_KOKKOS=yes -D BUILD_MPI=yes -D PKG_ML-SNAP=yes -D Kokkos_ENABLE_CUDA=yes -D Kokkos_ARCH_HSW=yes -D Kokkos_ARCH_VOLTA70=yes -D CMAKE_CXX_COMPILER=/path/to/lammps/lib/kokkos/bin/nvcc_wrapper -D BUILD_SHARED_LIBS=yes
.. note::
When using a GPU by setting ``parameters.use_gpu = True``, you *need* to
have a GPU version of ``LAMMPS`` installed. See :ref:`production_gpu` for
details.

* Build the library and executable with ``cmake --build .``
(Add ``--parallel=8`` for a faster build)



Installing the Python extension
********************************

Expand Down
23 changes: 15 additions & 8 deletions docs/source/install/installing_qe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ Installing Quantum ESPRESSO (total energy module)
Prerequisites
*************

To run the total energy module, you need a full Quantum ESPRESSO installation,
for which to install the Python bindings. This module has been tested with
version ``7.2.``, the most recent version at the time of this release of MALA.
Newer versions may work (untested), but installation instructions may vary.
To build and run the total energy module, you need a full Quantum ESPRESSO
installation, for which to install the Python bindings. This module has been
tested with version ``7.2.``, the most recent version at the time of this
release of MALA. Newer versions may work (untested), but installation
instructions may vary.

Make sure you have an (MPI-aware) F90 compiler such as ``mpif90`` (e.g.
Debian-ish machine: ``apt install openmpi-bin``, on an HPC cluster something
like ``module load openmpi gcc``). Make sure to use the same compiler
for QE and the extension. This should be the default case, but if problems
arise you can manually select the compiler via
``--f90exec=`` in ``build_total_energy_energy_module.sh``
``--f90exec=`` in ``build_total_energy_module.sh``

We assume that QE's ``configure`` script will find your system libs, e.g. use
``-lblas``, ``-llapack`` and ``-lfftw3``. We use those by default in
``build_total_energy_energy_module.sh``. If you have, say, the MKL library,
``build_total_energy_module.sh``. If you have, say, the MKL library,
you may see ``configure`` use something like ``-lmkl_intel_lp64 -lmkl_sequential -lmkl_core``
when building QE. In this case you have to modify
``build_total_energy_energy_module.sh`` to use the same libraries!
``build_total_energy_module.sh`` to use the same libraries!

Build Quantum ESPRESSO
**********************
Expand All @@ -35,10 +36,16 @@ Build Quantum ESPRESSO
* Change to the ``external_modules/total_energy_module`` directory of the
MALA repository

.. note::
At the moment, building QE using ``cmake`` `doesn't work together with the
build_total_energy_module.sh script
<https://github.com/mala-project/mala/issues/468>`_. Please use the
``configure`` + ``make`` build workflow.

Installing the Python extension
********************************

* Run ``build_total_energy_energy_module.sh /path/to/your/q-e``.
* Run ``build_total_energy_module.sh /path/to/your/q-e``.

* If the build is successful, a file named something like
``total_energy.cpython-39m-x86_64-linux-gnu.so`` will be generated. This is
Expand Down

0 comments on commit 4041871

Please sign in to comment.