Skip to content

Commit

Permalink
set MKL environment variables in the container
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed Dec 29, 2024
1 parent 8d6f2e0 commit 6518b11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions podman/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ RUN conda install -y -c conda-forge \

RUN conda install -y -c conda-forge \
libblas=*=*mkl \
# also tried mkl_fft<1.3.9
mkl_fft \
intel-cmplr-lib-rt \
&& conda clean --all -y
Expand All @@ -106,14 +107,20 @@ RUN pip install git+https://github.com/desihub/desimodel.git@${DESIMODEL_VERSION
RUN pip install git+https://github.com/desihub/desitarget.git@${DESITARGET_VERSION}#egg=desitarget
RUN pip install git+https://github.com/desihub/desispec.git@${DESISPEC_VERSION}#egg=desispec
RUN pip install git+https://github.com/desihub/speclite.git@${SPECLITE_VERSION}#egg=speclite
RUN pip install git+https://github.com/desihub/fastspecfit.git@${FASTSPECFIT_VERSION}#egg=fastspecfit & echo 1
RUN pip install git+https://github.com/desihub/fastspecfit.git@${FASTSPECFIT_VERSION}#egg=fastspecfit

ENV DESI_SPECTRO_REDUX=/dvs_ro/cfs/cdirs/desi/spectro/redux
ENV DUST_DIR=/dvs_ro/cfs/cdirs/cosmo/data/dust/v0_1
ENV FPHOTO_DIR=/dvs_ro/cfs/cdirs/desi/external/legacysurvey/dr9
ENV FTEMPLATES_DIR=/dvs_ro/cfs/cdirs/desi/public/external/templates/fastspecfit

# set up the numba cache
# Some environment variables to ensure good performance with MKL.
# https://www.diracprogram.org/doc/master/installation/mkl.html
ENV MKL_NUM_THREADS=1
ENV MKL_DYNAMIC="FALSE"
ENV OMP_NUM_THREADS=1

# Create the numba cache.
ENV HOME=/homedir
ENV NUMBA_CACHE_DIR=$HOME/numba_cache

Expand Down
8 changes: 4 additions & 4 deletions podman/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ podman-hpc login docker.io
## Build the container

The production container has a custom installation of
[MPICH](https://www.mpich.org/) and (linked)
[mpi4py](https://mpi4py.readthedocs.io/en/stable/), and pulls in tagged versions
of all the requisite Python dependencies. In addition, we pre-compile and cache
all the `numba` functions in the `FastSpecFit` code base.
[MPICH](https://www.mpich.org/) and pulls in appropriate versions of all the
requisite Python dependencies, particularly
[mpi4py](https://mpi4py.readthedocs.io/en/stable/). In addition, we pre-compile
and cache all the `numba` functions in the `FastSpecFit` code base.

To build, tag, migrate, and push the container to `dockerhub`, execute the
following commands:
Expand Down

0 comments on commit 6518b11

Please sign in to comment.