Skip to content

Commit

Permalink
Merge branch 'release-2.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
alazzaro committed Jul 29, 2024
2 parents ba75a56 + 6e44faf commit 0f7c1fb
Show file tree
Hide file tree
Showing 101 changed files with 6,012 additions and 2,555 deletions.
File renamed without changes.
8 changes: 8 additions & 0 deletions .ci/daint.cscs.ch/cray.build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash -l
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

#SBATCH --export=ALL
#SBATCH --constraint="mc"
Expand Down
8 changes: 8 additions & 0 deletions .ci/daint.cscs.ch/cray.test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash -l
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

#SBATCH --export=ALL
#SBATCH --constraint="gpu"
Expand Down
8 changes: 8 additions & 0 deletions .ci/daint.cscs.ch/gnu.build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash -l
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

#SBATCH --export=ALL
#SBATCH --constraint="mc"
Expand Down
8 changes: 8 additions & 0 deletions .ci/daint.cscs.ch/gnu.test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash -l
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

#SBATCH --export=ALL
#SBATCH --constraint="gpu"
Expand Down
8 changes: 8 additions & 0 deletions .ci/daint.cscs.ch/intel.build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash -l
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

#SBATCH --export=ALL
#SBATCH --constraint="mc"
Expand Down
8 changes: 8 additions & 0 deletions .ci/daint.cscs.ch/intel.test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash -l
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

#SBATCH --export=ALL
#SBATCH --constraint="gpu"
Expand Down
10 changes: 9 additions & 1 deletion .ci/daint.cscs.ch/ocl.build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash -l
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

#SBATCH --export=ALL
#SBATCH --constraint="mc"
Expand Down Expand Up @@ -27,7 +35,7 @@ if [ ! -d "${HOME}/libxsmm" ]; then
fi
cd "${HOME}/libxsmm"
git fetch
git checkout 05705477183444a82c8d9be8d7c2627efd6d67fa
git checkout d009b33e8742a93c9e1549323587fb6197451294
make -j
cd ..

Expand Down
10 changes: 9 additions & 1 deletion .ci/daint.cscs.ch/ocl.test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash -l
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

#SBATCH --export=ALL
#SBATCH --constraint="gpu"
Expand Down Expand Up @@ -32,7 +40,7 @@ export OMP_PROC_BIND=TRUE # set thread affinity
# OMP_NUM_THREADS is set by cmake

# use default parameters (omit loading tuned parameters)
export OPENCL_LIBSMM_SMM_PARAMS=0
#export OPENCL_LIBSMM_SMM_PARAMS=0

# document the current environment
env |& tee -a "${STAGE_NAME}.out"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/testing-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
-DMPI_EXECUTABLE_SUFFIX=.${{ matrix.mpi_suffix }} \
-DMPIEXEC_PREFLAGS="$([ "${{ matrix.mpi_suffix }}" = "openmpi" ] && echo "-mca btl ^openib --allow-run-as-root --oversubscribe")" \
-DLCOV_ARGS="--test-name;${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-cpu" \
-DTEST_MPI_RANKS=auto \
..
- name: Build
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_ACCEL=cuda \
-DWITH_GPU=V100 \
-DWITH_GPU=H100 \
-DWITH_EXAMPLES=ON \
-DWITH_CUDA_PROFILING=ON \
..
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/testing-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- 'develop'
pull_request:

# Workaround issue in Xcode 14.1/2
env:
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer

jobs:
build-and-test:
runs-on: macos-latest
Expand Down Expand Up @@ -45,15 +41,15 @@ jobs:
mkdir -p build
cd build
env \
CC=gcc-12 CXX=g++-12 FC=gfortran-12 \
CC=gcc-14 CXX=g++-14 FC=gfortran-14 \
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_${{ matrix.use_mpi }} \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_${{ matrix.use_smm }} \
$([ "${{ matrix.blas_impl }}" = "openblas" ] && echo '-DCMAKE_PREFIX_PATH=/usr/local/opt/openblas') \
-DMPIEXEC_PREFLAGS="$([ "${{ matrix.mpi_suffix }}" = "openmpi" ] && echo "-mca btl ^openib --allow-run-as-root")" \
-DTEST_MPI_RANKS=1 \
-DTEST_MPI_RANKS=auto \
..
- name: Build
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fail_fast: false
minimum_pre_commit_version: 3.2.0
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.3.2'
rev: 'v0.5.4'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
Expand All @@ -15,13 +15,13 @@ repos:
.cp2k/.*|
)$
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.4.2
hooks:
- id: black
name: Reformat Python files with the black code formatter
files: '^.*(/PACKAGE)|(\.py)$'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-yaml
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit/check_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

TYPES = {
"c_cpp": [".c", ".h", ".cc", ".hh", ".cxx", ".hxx", ".cpp", ".hpp", ".cu", ".cl"],
"python": [".py"],
"fypp": [".fypp"],
"fortran": [".F", ".f", ".f90", ".f03"],
"script": [".py", ".sh"],
"fypp": [".fypp"],
}

# max number of lines allowed between header and top of file
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit/clang-format-fypp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env bash
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
####################################################################################################

# clang-format change FYPP directives, need to revert the changes.

Expand Down
8 changes: 8 additions & 0 deletions .pre-commit/headers/c_cpp.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*------------------------------------------------------------------------------------------------*/
/* Copyright (C) by the DBCSR developers group - All rights reserved */
/* This file is part of the DBCSR library. */
/* */
/* For information on the license, see the LICENSE file. */
/* For further information please visit https://dbcsr.cp2k.org */
/* SPDX-License-Identifier: BSD-3-Clause */
/*------------------------------------------------------------------------------------------------*/
File renamed without changes.
20 changes: 1 addition & 19 deletions src/acc/acc_makedep.sh → .pre-commit/headers/script.2
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
#!/usr/bin/env bash
####################################################################################################
# Copyright (C) by the DBCSR developers group - All rights reserved #
# This file is part of the DBCSR library. #
# #
# For information on the license, see the LICENSE file. #
# For further information please visit https://dbcsr.cp2k.org #
# SPDX-License-Identifier: GPL-2.0+ #
# SPDX-License-Identifier: BSD-3-Clause #
####################################################################################################

FILE=$1
VAL=$2

if [ "${FILE}" ]; then
if [ ! -e "${FILE}" ] || [ "$(cat "${FILE}")" != "${VAL}" ]; then
echo "${VAL}" >"${FILE}"
fi
echo "${FILE}"
else
echo "Usage: $0 filename [value]"
echo " The content of the file will be updated with the value"
echo " if the value is different than the current value."
echo " This suitable to form a Makefile dependency."
fi


12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ cmake_dependent_option(WITH_EXAMPLES "Build the examples" ON "USE_MPI" OFF
)# all examples require MPI

set(TEST_MPI_RANKS
"auto"
2
CACHE STRING "Number of MPI ranks for testing")
set(TEST_OMP_THREADS
2
Expand All @@ -99,7 +99,14 @@ set(USE_ACCEL
CACHE STRING "Build with acceleration support (default: none)")
set_property(CACHE USE_ACCEL PROPERTY STRINGS "" opencl cuda hip)

set(SUPPORTED_CUDA_ARCHITECTURES K20X K40 K80 P100 V100 A100)
set(SUPPORTED_CUDA_ARCHITECTURES
K20X
K40
K80
P100
V100
A100
H100)
set(SUPPORTED_HIP_ARCHITECTURES Mi50 Mi100 Mi250)
set(WITH_GPU
$<IF:$<STREQUAL:${USE_ACCEL},"opencl">,"","P100">
Expand Down Expand Up @@ -238,6 +245,7 @@ if (USE_ACCEL MATCHES "cuda|hip")
set(GPU_ARCH_NUMBER_P100 60)
set(GPU_ARCH_NUMBER_V100 70)
set(GPU_ARCH_NUMBER_A100 80)
set(GPU_ARCH_NUMBER_H100 90)
set(GPU_ARCH_NUMBER_Mi50 gfx906)
set(GPU_ARCH_NUMBER_Mi100 gfx908)
set(GPU_ARCH_NUMBER_Mi250 gfx90a)
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
MAJOR = 2
MINOR = 7
PATCH = 0-rc1
PATCH = 0
# A specific DATE (YYYY-MM-DD) fixes an official release, otherwise
# it is considered Development version.
DATE = 2024-03-13
DATE = 2024-07-29


14 changes: 10 additions & 4 deletions cmake/CompilerConfiguration.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-form -std=f2008ts -fimplicit-none -Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-parameter -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=conversion -Werror=zerotrip -Werror=uninitialized -Wno-maybe-uninitialized -Werror=unused-parameter")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Werror=argument-mismatch") # gcc 10+ has this automatically
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-form -std=f2008ts -fimplicit-none -Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-parameter -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=conversion -Werror=zerotrip -Wno-maybe-uninitialized -Werror=unused-parameter")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) # comparison against CXX version rather than GFortran version
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") # required for 10+ (MPI wrap)
else ()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") # requires for 10+ for the MPI wrap module
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Werror=argument-mismatch") # gcc 10+ has this automatically
endif ()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13) # comparison against CXX version rather than GFortran version
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wno-error=uninitialized") # false positive (allocatable array)
endif ()
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -g -funroll-loops")
set(CMAKE_Fortran_FLAGS_COVERAGE "-O0 -g --coverage -fno-omit-frame-pointer -fcheck=all,no-array-temps -ffpe-trap=invalid,zero,overflow -fbacktrace -finit-real=snan -finit-integer=-42 -finit-derived -Werror=realloc-lhs -finline-matmul-limit=0 -Werror")
Expand Down Expand Up @@ -48,6 +51,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if ((NOT (USE_MPI)) OR (NOT ("${MPI_Fortran_LIBRARY_VERSION_STRING}" MATCHES "Open MPI")))
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=leak")
endif ()
if (USE_ACCEL MATCHES "hip" AND hip_VERSION GREATER_EQUAL 6.0.0) # Remove deprecated function error with ROCm v6+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations")
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -funroll-loops")
set(CMAKE_CXX_FLAGS_COVERAGE "-O0 -g --coverage")
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/2-user-guide/1-installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ make
-DWITH_GPU=<P100|K20X|K40|K80|V100|Mi50|Mi100|Mi250>
-DCMAKE_BUILD_TYPE=<Release|Debug|Coverage>
-DBUILD_TESTING=<ON|OFF>
-DTEST_MPI_RANKS=<auto,N>
-DTEST_OMP_THREADS=<2,N>
-DTEST_MPI_RANKS=<2|auto|N>
-DTEST_OMP_THREADS=<2|N>
```

When providing a build of LIBXSMM, make sure the `lib` directory is added to the `PKG_CONFIG_PATH` variable prior
Expand Down
9 changes: 9 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ foreach (dbcsr_program_src ${DBCSR_PROGRAM_SRCS_FTN})
get_filename_component(dbcsr_program_name ${dbcsr_program_src} NAME_WE)
add_executable(${dbcsr_program_name} ${dbcsr_program_src})
target_link_libraries(${dbcsr_program_name} dbcsr)
if (OpenMP_FOUND)
target_link_libraries(${dbcsr_program_name} OpenMP::OpenMP_Fortran)
endif ()

# with the Intel compiler CMake 3.12 seems to forget that the source is
# actually Fortran and needs to be told explicitly:
Expand All @@ -29,6 +32,12 @@ if (WITH_C_API)
set(dbcsr_program_name ${dbcsr_program_name}_cpp)
add_executable(${dbcsr_program_name} ${dbcsr_program_src})
target_link_libraries(${dbcsr_program_name} dbcsr_c MPI::MPI_CXX)
set_target_properties(${dbcsr_program_name} PROPERTIES LINKER_LANGUAGE
Fortran)
if (OpenMP_FOUND)
target_compile_options(${dbcsr_program_name} PRIVATE ${OpenMP_CXX_FLAGS})
target_link_libraries(${dbcsr_program_name} OpenMP::OpenMP_Fortran)
endif ()

if (CMAKE_CXX_COMPILER_ID STREQUAL "Cray")
# for recent Cray compiler versions CMake doesn't know
Expand Down
4 changes: 2 additions & 2 deletions examples/dbcsr_example_3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ int main(int argc, char* argv[]) {

for (int i = 0; i != mpi_size; ++i) {
if (mpi_rank == i) {
std::cout << "I'm processor " << mpi_rank << " over " << mpi_size << " proc" << ", (" << coord[0] << ", " << coord[1]
<< ") in the 2D grid" << std::endl;
std::cout << "I'm processor " << mpi_rank << " over " << mpi_size << " proc"
<< ", (" << coord[0] << ", " << coord[1] << ") in the 2D grid" << std::endl;
}
MPI_Barrier(MPI_COMM_WORLD);
}
Expand Down
2 changes: 1 addition & 1 deletion src/acc/acc.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* */
/* For information on the license, see the LICENSE file. */
/* For further information please visit https://dbcsr.cp2k.org */
/* SPDX-License-Identifier: GPL-2.0+ */
/* SPDX-License-Identifier: BSD-3-Clause */
/*------------------------------------------------------------------------------------------------*/
#ifndef DBCSR_ACC_H
#define DBCSR_ACC_H
Expand Down
Loading

0 comments on commit 0f7c1fb

Please sign in to comment.