Skip to content

Commit

Permalink
Simplify way to specify build args
Browse files Browse the repository at this point in the history
  • Loading branch information
tikk3r committed Jul 22, 2024
1 parent 65f143f commit 9651125
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
20 changes: 14 additions & 6 deletions singularity/Singularity.amd_aocl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ From: fedora:38
export INSTALLDIR=/opt/lofar
. $INSTALLDIR/init.sh

%arguments
HAS_CUDA=true
MARCH=znver2
MTUNE=znver2
NOAVX512=false
DEBUG=false
OPENBLASTARGET=ZEN

%post
# General environment settings.
export J=`nproc`
Expand Down Expand Up @@ -46,18 +54,18 @@ From: fedora:38
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

export HAS_CUDA=true
export MARCH='znver2'
export MTUNE='znver2'
export NOAVX512=false
export DEBUG=true
export HAS_CUDA={{ HAS_CUDA }}
export MARCH={{ MARCH }}
export MTUNE={{ MTUNE }}
export NOAVX512={{ NOAVX512 }}
export DEBUG={{ DEBUG }}

export CPPSTD=c++17
export OMP_NUM_THREADS=1
export OMP_MAX_THREADS=1
export OPENBLAS_NUM_THREADS=1
export NUM_THREADS=128
export OPENBLAS_TARGET=ZEN
export OPENBLAS_TARGET={{ OPENBLASTARGET }}

if [ $NOAVX512 = true ]; then
export CFLAGS="-march=${MARCH} -mtune=${MTUNE} -mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512ifma -mno-avx512vbmi"
Expand Down
23 changes: 16 additions & 7 deletions singularity/Singularity.intel_mkl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ From: fedora:38
export INSTALLDIR=/opt/lofar
. $INSTALLDIR/init.sh

%arguments
HAS_CUDA=true
HAS_MKL=true
MARCH=sandybridge
MTUNE=sandybridge
NOAVX512=true
DEBUG=false
OPENBLASTARGET=SANDYBRIDGE

%post
# General environment settings.
export J=`nproc`
Expand Down Expand Up @@ -46,20 +55,20 @@ From: fedora:38
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

export HAS_CUDA=true
export HAS_MKL=true
export MARCH='sandybridge'
export MTUNE='sandybridge'
export NOAVX512=true
export DEBUG=false
export HAS_CUDA={{ HAS_CUDA }}
export HAS_MKL={{ HAS_MKL }}
export MARCH={{ MARCH }}
export MTUNE={{ MTUNE }}
export NOAVX512={{ NOAVX512 }}
export DEBUG={{ DEBUG }}

export CPPSTD=c++17
export OMP_NUM_THREADS=1
export OMP_MAX_THREADS=1
export OPENBLAS_NUM_THREADS=1
export MKL_NUM_THREADS=1
export NUM_THREADS=128
export OPENBLAS_TARGET=SANDYBRIDGE
export OPENBLAS_TARGET={{ OPENBLASTARGET }}

if [ $NOAVX512 = true ]; then
export CFLAGS="-Wno-dev -march=${MARCH} -mtune=${MTUNE} -mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512ifma -mno-avx512vbmi"
Expand Down

0 comments on commit 9651125

Please sign in to comment.