Skip to content

Commit 2af40bb

Browse files
gsitaramalazzaro
authored andcommitted
Add GPU aware MPI support in cannon algorithm (#647)
Add GPU aware MPI support in cannon algorithm with norms calculation in GPU
1 parent 14105ed commit 2af40bb

File tree

30 files changed

+1494
-53
lines changed

30 files changed

+1494
-53
lines changed

.github/workflows/doc-generation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- "/etc/ssh/ssh_known_hosts:/etc/ssh/ssh_known_hosts:ro"
1818

1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
2323
submodules: true

.github/workflows/docker-build-env.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Checkout Repository
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242

4343
- name: Prepare
4444
id: prep

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
submodules: true
1818

.github/workflows/testing-gcc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
image: ghcr.io/cp2k/dbcsr-build-env-latest-gcc:develop
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919
submodules: true

.github/workflows/testing-linux.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
container:
1616
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- name: Run pre-commit
2020
run: |
2121
git config --global --add safe.directory "$GITHUB_WORKSPACE"
@@ -40,7 +40,7 @@ jobs:
4040
mpi_suffix: mpich
4141

4242
steps:
43-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4444
with:
4545
fetch-depth: 0
4646
submodules: true
@@ -100,7 +100,7 @@ jobs:
100100
use_openmp: [OPENMP=ON]
101101

102102
steps:
103-
- uses: actions/checkout@v3
103+
- uses: actions/checkout@v4
104104
with:
105105
fetch-depth: 0
106106
submodules: true
@@ -134,7 +134,7 @@ jobs:
134134
use_smm: [SMM=libxsmm]
135135

136136
steps:
137-
- uses: actions/checkout@v3
137+
- uses: actions/checkout@v4
138138
with:
139139
fetch-depth: 0
140140
submodules: true
@@ -164,9 +164,10 @@ jobs:
164164
strategy:
165165
matrix:
166166
use_openmp: [OPENMP=ON]
167+
use_g2g: [G2G=ON, G2G=OFF]
167168

168169
steps:
169-
- uses: actions/checkout@v3
170+
- uses: actions/checkout@v4
170171
with:
171172
fetch-depth: 0
172173
submodules: true
@@ -176,10 +177,11 @@ jobs:
176177
mkdir -p build
177178
cd build
178179
cmake -G Ninja \
179-
-DCMAKE_BUILD_TYPE=Debug \
180+
-DCMAKE_BUILD_TYPE=Release \
180181
-DUSE_${{ matrix.use_openmp }} \
181182
-DUSE_ACCEL=hip \
182-
-DWITH_GPU=Mi100 \
183+
-DWITH_GPU=Mi250 \
184+
-DWITH_${{ matrix.use_g2g }} \
183185
-DWITH_EXAMPLES=ON \
184186
-DCMAKE_PREFIX_PATH=/opt/rocm \
185187
..
@@ -194,7 +196,7 @@ jobs:
194196
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
195197

196198
steps:
197-
- uses: actions/checkout@v3
199+
- uses: actions/checkout@v4
198200

199201
- name: Download coverage data
200202
uses: actions/download-artifact@v3

.github/workflows/testing-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
mpi_suffix: mpich
2727

2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
with:
3131
fetch-depth: 0
3232
submodules: true

.pre-commit/check_header.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
import re
1414
import mmap
1515
import sys
16-
from os import path
16+
import pathlib
17+
from collections import defaultdict
18+
from os import path, listdir
1719
from contextlib import contextmanager
1820

1921
TYPES = {
@@ -41,14 +43,19 @@ def mmap_open(name, mode="r"):
4143

4244
def check_header(header_dir, files, verbose=False):
4345
retval = 0
44-
header_re = {}
45-
header_len = {}
46-
47-
for headertype in TYPES:
48-
with open(path.join(header_dir, headertype), "rb") as fhandle:
49-
header_content = fhandle.read()
50-
header_re[headertype] = re.compile(re.escape(header_content))
51-
header_len[headertype] = len(header_content)
46+
header_re = defaultdict(list)
47+
header_len = defaultdict(list)
48+
49+
for headerfile in listdir(header_dir):
50+
headertype = pathlib.Path(headerfile).stem
51+
if headertype in TYPES:
52+
with open(path.join(header_dir, headerfile), "rb") as fhandle:
53+
header_content = fhandle.read()
54+
header_re[headertype].append(re.compile(re.escape(header_content)))
55+
header_len[headertype].append(len(header_content))
56+
else:
57+
print("no matching headerfile to file extensions")
58+
sys.exit(1)
5259

5360
ext_map = {e: t for t, exts in TYPES.items() for e in exts}
5461

@@ -62,9 +69,10 @@ def check_header(header_dir, files, verbose=False):
6269

6370
with mmap_open(fpath) as fmapped:
6471
header_type = ext_map[fext]
65-
match = header_re[header_type].search(
66-
fmapped, 0, ALLOWED_LINES * MAX_LINE_LENGTH + header_len[header_type]
67-
)
72+
for h_re, h_len in zip(header_re[header_type], header_len[header_type]):
73+
match = h_re.search(fmapped, 0, ALLOWED_LINES * MAX_LINE_LENGTH + h_len)
74+
if match:
75+
break
6876

6977
if not match:
7078
print("✗ {} ... required header not found".format(fpath))

.pre-commit/headers/c_cpp.2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*------------------------------------------------------------------------------------------------*/
2+
/* Copyright (C) by the DBCSR developers group - All rights reserved */
3+
/* Copyright (C) 2022 Advanced Micro Devices, Inc. - All rights reserved */
4+
/* This file is part of the DBCSR library. */
5+
/* */
6+
/* For information on the license, see the LICENSE file. */
7+
/* For further information please visit https://dbcsr.cp2k.org */
8+
/* SPDX-License-Identifier: GPL-2.0+ */
9+
/*------------------------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)