wiki:Software/OpenFOAM/config_knl

!!! WORK IN PROGRESS !!!
Last Update 02.2017, Authors: Jens Henrik Göbbert, ...

OpenFOAM Settings for Xeon Phi

Set Environment

The environment must be set up according to where the source code directories are located.

INST_DIR=/homeb/zam/${USER}/my_OpenFOAM_knl # must not end with a '/', or build will fail with "touch [...] permission denied"
cd $INST_DIR

# load modules
#module --force purge
#module load Stages/Devel
#module load Intel/2017.0.098-GCC-5.4.0
#module load IntelMPI/2017.0.098

# use thirdparty libs compiled for KNL
export EBVERSIONBOOST=1.61.0
export EBROOTBOOST=${BASE}/deps/Boost/install/knl
export EBROOTMPFR=${BASE}/deps/MPFR/install/knl  
export  EBROOTGMP=${BASE}/deps/GMP/install/knl 
export EBROOTCGAL=${BASE}/deps/CGAL/install/knl 
#export EBROOTMETIS=${BASE}/deps/METIS/install/knl 

# configure environment
export FOAM_INST_DIR=$INST_DIR
export WM_COMPILER=Icc
export WM_MPLIB=EASYBUILDMPI
export MPICC=mpicc
export MPICXX=mpiicpc
export CC=icc
export CXX=icpc
export OPTFLAGS="-qopt-streaming-stores-always -qopt-prefetch-distance=72"
export CFLAGS="-no-prec-div -O3 -xMIC-AVX512 -diag-disable 654,1125 ${OPTCFLAGS}"
export CXXFLAGS="-O3 -xMIC-AVX512 -diag-disable 654,1125 ${OPTFLAGS} -DMPICH_SKIP_MPICXX"

export WM_NCOMPPROCS=8  # parallel build
export WM_LABEL_SIZE=32 # 32bit for labels/indices - relevant for METIS (if 64 needed patch METIS first)

# load environment
VERSION=3.0.1
source OpenFOAM-${VERSION}/etc/bashrc
foam
foamSystemCheck

wmake/rules/linux64Icc/c++

CC = ${MPICXX} -O3 -xMIC-avx512 -DvectorMachine -std=c++11 -fp-trap=common -fp-model precise -fp-speculation=safe -opt-streaming-stores-always -qopt-prefetch-distance=72

Scotch

Patch $WM_THIRD_PARTY_DIR/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int32

# scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int32
+ AR             = ${CC}
+ CCS            = ${CC}
+ CCP            = ${MPICC}
+ CCD            = ${MPICC}
+ CFLAGS         = -O3 -xMIC-AVX512 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict

CGAL

Boost

CFLAGS="-xMIC-AVX512"
CXXFLAGS="-xMIC-AVX512"
LDFLAGS="-xMIC-AVX512"

./bootstrap.sh --with-toolset=intel-linux --prefix=${BASE}/deps/Boost/install/knl
./bjam toolset=intel -j 8 --disable-icu \
  cflags="$CFLAGS" cxxflags="$CXXFLAGS" linkflags="$LDFLAGS" \
  --without-iostreams --without-python
./b2 install --prefix=${BASE}/deps/Boost/install/knl

GMP

./configure CC=icc CXX=icpc \
       CFLAGS="-fPIC -O2 -xMIC-AVX512" \
     CXXFLAGS="-fPIC -O2 -xMIC-AVX512" \
     --host=x86_64-k1om-linux \
     --enable-cxx \
     --prefix=${BASE}/deps/GMP/install/knl

MPFR

./configure CC=icc CXX=icpc \
     CFLAGS="-fPIC -O2 -xMIC-AVX512" \
   CXXFLAGS="-fPIC -O2 -xMIC-AVX512" \
   --host=x86_64-k1om-linux \
   --prefix=${BASE}/deps/MPFR/install/knl \
   --with-gmp=${BASE}/deps/GMP/install/knl \
   --prefix=${BASE}/deps/MPFR/install/knl

CGAL

export CC=icc
export CXX=icpc
export   CFLAGS="-O2 -xMIC-AVX512 "
export CXXFLAGS="-O2 -xMIC-AVX512 "
cmake -DCMAKE_VERBOSE_MAKEFILE=ON \
      -DBOOST_ROOT=${BASE}/deps/Boost/install/knl \
      -DMPFR_INCLUDE_DIR=${BASE}/deps/MPFR/install/knl/include/ -DMPFR_LIBRARIES=${BASE}/deps/MPFR/install/knl/lib/ \
      -DGMP_INCLUDE_DIR=${BASE}/deps/GMP/install/knl/include/   -DGMP_LIBRARIES=${BASE}/deps/GMP/install/knl/lib/  \
      -DCMAKE_INSTALL_PREFIX=${BASE}/deps/CGAL/install/knl \
      ../cgal-releases-CGAL-4.8.2

Reference

Last modified 7 years ago Last modified on 02/17/17 21:21:39
Note: See TracWiki for help on using the wiki.