Skip to content

Commit

Permalink
Merge branch 'release-2.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
alazzaro committed Dec 27, 2022
2 parents e330c82 + a102c6c commit 2d009cd
Show file tree
Hide file tree
Showing 41 changed files with 2,360 additions and 927 deletions.
21 changes: 13 additions & 8 deletions .ci/daint.cscs.ch/ocl.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@
#SBATCH --cpus-per-task=12
#SBATCH --hint=nomultithread

#set -o nounset
set -o errexit
set -o nounset
set -o pipefail

source /opt/intel/oneapi/mkl/latest/env/vars.sh
module swap PrgEnv-cray PrgEnv-gnu
module load daint-gpu cudatoolkit cdt-cuda
module unload cray-libsci_acc
module unload cray-libsci_acc cray-libsci
module list

export PATH=/project/cray/alazzaro/cmake/bin:$PATH
export PATH=/project/cray/alazzaro/cmake/bin:${PATH}

# Checkout and build LIBXSMM
if [ ! -d "${HOME}/libxsmm" ]; then
cd "${HOME}"
git clone https://github.com/hfp/libxsmm.git
git clone https://github.com/libxsmm/libxsmm.git
fi
cd "${HOME}/libxsmm"
git fetch
git checkout 1a10386117eb0d6771bcd512c1cd00860424477f
git checkout 593a64cb87a0643f9b275b1081c096878b190a0e
make -j
cd ..

Expand All @@ -43,13 +44,17 @@ cd "${SCRATCH}/${BUILD_TAG}.ocl"
# CMake: find LIBXSMM (pkg-config)
export PKG_CONFIG_PATH=${HOME}/libxsmm/lib:${PKG_CONFIG_PATH}

#BLAS="-DBLAS_FOUND=ON -DBLAS_LIBRARIES='-lsci_gnu_mpi_mp' -DLAPACK_FOUND=ON -DLAPACK_LIBRARIES='-lsci_gnu_mpi_mp'"
BLAS="-DBLA_VENDOR=Intel10_64lp"
#LIBXSMM=libxsmm-shared
LIBXSMM=libxsmm

cmake \
-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment \
-DCMAKE_CROSSCOMPILING_EMULATOR="" \
-DUSE_ACCEL=opencl -DWITH_GPU=P100 -DUSE_SMM=libxsmm \
-DUSE_ACCEL=opencl -DWITH_GPU=P100 \
-DUSE_SMM=${LIBXSMM} ${BLAS} \
-DOpenCL_LIBRARY="${CUDATOOLKIT_HOME}/lib64/libOpenCL.so" \
-DBLAS_FOUND=ON -DBLAS_LIBRARIES="-lsci_gnu_mpi_mp" \
-DLAPACK_FOUND=ON -DLAPACK_LIBRARIES="-lsci_gnu_mpi_mp" \
-DMPIEXEC_EXECUTABLE="$(command -v srun)" \
-DTEST_MPI_RANKS="${SLURM_NTASKS}" \
-DTEST_OMP_THREADS="${SLURM_CPUS_PER_TASK}" \
Expand Down
8 changes: 5 additions & 3 deletions .ci/daint.cscs.ch/ocl.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
#SBATCH --ntasks-per-node=1
#SBATCH --hint=nomultithread

#set -o nounset
set -o errexit
set -o nounset
set -o pipefail

source /opt/intel/oneapi/mkl/latest/env/vars.sh
module swap PrgEnv-cray PrgEnv-gnu
module load daint-gpu cudatoolkit cdt-cuda
module unload cray-libsci_acc
module unload cray-libsci_acc cray-libsci
module list

export PATH=/project/cray/alazzaro/cmake/bin:$PATH
export PATH=/project/cray/alazzaro/cmake/bin:${PATH}

set -o xtrace # do not set earlier to avoid noise from module

Expand All @@ -26,6 +27,7 @@ mkdir -p "${SCRATCH}/${BUILD_TAG}.ocl"
chmod 0775 "${SCRATCH}/${BUILD_TAG}.ocl"
cd "${SCRATCH}/${BUILD_TAG}.ocl"

export LD_LIBRARY_PATH=${HOME}/libxsmm/lib:${LD_LIBRARY_PATH}
export OMP_PROC_BIND=TRUE # set thread affinity
# OMP_NUM_THREADS is set by cmake

Expand Down
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ set(WITH_GPU
STRING
"Select GPU arch. and embed parameters (default: CUDA/HIP=P100, OPENCL=all)"
)
set(WITH_GPU_PARAMS "${WITH_GPU}")
set_property(CACHE WITH_GPU PROPERTY STRINGS ${SUPPORTED_CUDA_ARCHITECTURES}
${SUPPORTED_HIP_ARCHITECTURES})

Expand Down Expand Up @@ -143,9 +144,19 @@ endif ()
if (USE_SMM MATCHES "libxsmm")
find_package(PkgConfig REQUIRED)
if (USE_OPENMP)
pkg_check_modules(LIBXSMMEXT REQUIRED IMPORTED_TARGET GLOBAL libxsmmext)
if (NOT USE_SMM MATCHES "libxsmm-shared")
pkg_check_modules(LIBXSMMEXT IMPORTED_TARGET GLOBAL libxsmmext-static)
endif ()
if (NOT LIBXSMMEXT_FOUND)
pkg_check_modules(LIBXSMMEXT REQUIRED IMPORTED_TARGET GLOBAL libxsmmext)
endif ()
endif ()
if (NOT USE_SMM MATCHES "libxsmm-shared")
pkg_check_modules(LIBXSMM IMPORTED_TARGET GLOBAL libxsmmf-static)
endif ()
if (NOT LIBXSMM_FOUND)
pkg_check_modules(LIBXSMM REQUIRED IMPORTED_TARGET GLOBAL libxsmmf)
endif ()
pkg_check_modules(LIBXSMM REQUIRED IMPORTED_TARGET GLOBAL libxsmmf)
endif ()

# =================================== BLAS & LAPACK, PkgConfig
Expand Down Expand Up @@ -233,6 +244,7 @@ if (USE_ACCEL MATCHES "cuda")
set(ACC_ARCH_NUMBER ${GPU_ARCH_NUMBER_${WITH_GPU}})

message(STATUS "GPU target architecture: " ${WITH_GPU})
message(STATUS "Kernel parameters: " ${WITH_GPU_PARAMS})
message(STATUS "GPU architecture number: " ${ACC_ARCH_NUMBER})
message(STATUS "GPU profiling enabled: " ${WITH_CUDA_PROFILING})
endif ()
Expand Down Expand Up @@ -271,6 +283,7 @@ if (USE_ACCEL MATCHES "hip")

set(ACC_ARCH_NUMBER ${GPU_ARCH_NUMBER_${WITH_GPU}})
message(STATUS "GPU target architecture: " ${WITH_GPU})
message(STATUS "Kernel parameters: " ${WITH_GPU_PARAMS})
message(STATUS "GPU architecture number: " ${ACC_ARCH_NUMBER})
message(STATUS "GPU profiling enabled: " ${WITH_HIP_PROFILING})

Expand Down
6 changes: 3 additions & 3 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
MAJOR = 2
MINOR = 4
PATCH = 1
MINOR = 5
PATCH = 0
# A specific DATE (YYYY-MM-DD) fixes an official release, otherwise
# it is considered Development version.
DATE = 2022-08-29
DATE = 2022-12-27


Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Assumed square matrix with 20x20 matrix with 5x5 blocks and a 2x2 processor grid
| Macro | Explanation | Language |
|-|-|-|
| `__parallel` | Enable MPI runs | Fortran |
| `__MPI_VERSION=N` | DBCSR assumes that the MPI library implements MPI version 3. If you have an older version of MPI (e.g. MPI 2.0) available you must define `-D__MPI_VERSION=2` | Fortran |
| `__NO_MPI_THREAD_SUPPORT_CHECK` | Workaround for MPI libraries that do not declare they are thread safe (funneled) but you want to use them with OpenMP code anyways | Fortran |
| `__MKL` | Enable use of optimized Intel MKL functions | Fortran
| `__NO_STATM_ACCESS`, `__STATM_RESIDENT` or `__STATM_TOTAL` | Toggle memory usage reporting between resident memory and total memory. In particular, macOS users must use `-D__NO_STATM_ACCESS` | Fortran |
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ set_target_properties(dbcsr PROPERTIES VERSION ${dbcsr_VERSION}

if (USE_SMM MATCHES "libxsmm")
target_compile_definitions(dbcsr PRIVATE __LIBXSMM)
target_link_directories(dbcsr PUBLIC ${LIBXSMM_LIBRARY_DIRS})
if (USE_OPENMP)
target_link_libraries(dbcsr PRIVATE PkgConfig::LIBXSMMEXT)
endif ()
Expand Down Expand Up @@ -200,8 +201,7 @@ set_target_properties(dbcsr PROPERTIES LINKER_LANGUAGE Fortran)
if (MPI_FOUND)
# once built, a user of the dbcsr library can not influence anything anymore
# by setting those flags:
target_compile_definitions(
dbcsr PRIVATE __parallel __MPI_VERSION=${MPI_Fortran_VERSION_MAJOR})
target_compile_definitions(dbcsr PRIVATE __parallel)

# Instead of resetting the compiler for MPI, we are adding the compiler flags
# otherwise added by the mpifort-wrapper directly; based on hints from:
Expand Down
Loading

0 comments on commit 2d009cd

Please sign in to comment.