Skip to content

Commit

Permalink
docker: switch to predefined nproc
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Apr 18, 2023
1 parent f706b1b commit 31b695e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions docker/Dockerfile.amd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
##############################################################
# This Dockerfile contains AMD compilers
# Based on https://github.com/amd/InfinityHub-CI/tree/main/base-gpu-mpi-rocm-docker
##############################################################

ARG ROCM_VERSION=5.4.2
Expand Down Expand Up @@ -78,8 +79,8 @@ RUN cd /tmp/ \
--disable-logging \
--disable-debug \
--disable-examples \
&& make -j $(( $(lscpu | awk '/^Socket\(s\)/{ print $2 }') * $(lscpu | awk '/^Core\(s\) per socket/{ print $4 }') )) \
&& make install \
&& make -j ${nproc} \
&& make install

# Install OpenMPI
RUN cd /tmp \
Expand All @@ -95,7 +96,7 @@ RUN cd /tmp \
--enable-mpi \
--enable-mpi-fortran=yes \
--disable-debug \
&& make -j $(( $(lscpu | awk '/^Socket\(s\)/{ print $2 }') * $(lscpu | awk '/^Core\(s\) per socket/{ print $4 }') )) \
&& make -j ${nproc} \
&& make install

# Cleanup
Expand All @@ -117,7 +118,6 @@ ENV OMPI_ALLOW_RUN_AS_ROOT=1 \
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
OMPI_MCA_pml=ucx


##############################################################
# Additional Devito requirements
##############################################################
Expand All @@ -127,13 +127,11 @@ RUN apt-get update && \
apt-get install -y dh-autoreconf python3-venv python3-dev python3-pip

# Build mpi4py against amdclang
RUN which mpicc && \
python3 -m venv /venv && \
RUN python3 -m venv /venv && \
/venv/bin/pip install --no-cache-dir --upgrade pip && \
/venv/bin/pip install --no-cache-dir mpi4py && \
rm -rf ~/.cache/pip


########################################################################
# AOMP for GPUs (OpenMP offloading)
########################################################################
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ RUN cd /llvm-project/build && \
-DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_86 \
-DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=all \
-DCMAKE_INSTALL_PREFIX=/llvm && \
make -j $(( $(lscpu | awk '/^Socket\(s\)/{ print $2 }') * $(lscpu | awk '/^Core\(s\) per socket/{ print $4 }') )) && \
make -j ${nproc} && \
make install

# Set path
Expand Down

0 comments on commit 31b695e

Please sign in to comment.