Skip to content

Commit 3cc1414

Browse files
committed
Merge branch 'master' of https://github.com/learning-process/parallel_programming_course into an/add-profiler
2 parents 4b86f2c + b6d3381 commit 3cc1414

32 files changed

+632
-931
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @aobolensk @allnes
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Archive installed package
2+
inputs:
3+
path:
4+
description: Directory to archive
5+
required: true
6+
name:
7+
description: Artifact name
8+
required: true
9+
runs:
10+
using: composite
11+
steps:
12+
- id: set-archive
13+
shell: bash
14+
run: |
15+
if [ "${RUNNER_OS}" = "Windows" ]; then
16+
echo "archive=${{ inputs.name }}.zip" >> "$GITHUB_OUTPUT"
17+
else
18+
echo "archive=${{ inputs.name }}.tar.gz" >> "$GITHUB_OUTPUT"
19+
fi
20+
- name: Compress directory (unix)
21+
if: runner.os != 'Windows'
22+
shell: bash
23+
run: tar -czvf "${{ steps.set-archive.outputs.archive }}" -C "${{ inputs.path }}" .
24+
- name: Compress directory (windows)
25+
if: runner.os == 'Windows'
26+
shell: pwsh
27+
run: Compress-Archive -Path ${{ inputs.path }} -DestinationPath ${{ steps.set-archive.outputs.archive }}
28+
- name: Upload artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: ${{ inputs.name }}
32+
path: ${{ steps.set-archive.outputs.archive }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Setup Windows Toolchain'
2+
description: 'Configure msbuild, MPI, ccache, ninja, and MSVC'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Add msbuild to PATH
7+
uses: microsoft/setup-msbuild@v2
8+
with:
9+
vs-version: 'latest'
10+
- name: Setup MPI
11+
uses: mpi4py/setup-mpi@v1
12+
with:
13+
mpi: msmpi
14+
- name: Setup ccache
15+
uses: Chocobo1/setup-ccache-action@v1
16+
with:
17+
windows_compile_environment: msvc
18+
- name: Setup ninja
19+
uses: seanmiddleditch/gha-setup-ninja@v6
20+
- name: Setup MSVC for Ninja again
21+
uses: ilammy/msvc-dev-cmd@v1

.github/workflows/cmake-lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CMake Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**/CMakeLists.txt"
7+
- "**/*.cmake"
8+
push:
9+
paths:
10+
- "**/CMakeLists.txt"
11+
- "**/*.cmake"
12+
workflow_dispatch:
13+
14+
jobs:
15+
cmake-lint:
16+
name: Check CMake formatting
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
- name: Install cmake-format
22+
run: python3 -m pip install cmakelang
23+
- name: Run cmake-format
24+
run: |
25+
files=$(git ls-files '**/CMakeLists.txt' 'cmake/*.cmake')
26+
cmake-format --check $files

.github/workflows/lint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,14 @@ jobs:
1919
run: python3 -m pip install flake8
2020
- name: Run flake8
2121
run: python3 -m flake8 .
22+
23+
shell-lint:
24+
runs-on: ubuntu-24.04
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Install shellcheck
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y shellcheck
31+
- name: Run shellcheck
32+
run: shellcheck scripts/*.sh

.github/workflows/mac.yml

Lines changed: 28 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,17 @@ on:
44
jobs:
55
macos-clang-build:
66
runs-on: macOS-latest
7+
strategy:
8+
matrix:
9+
build_type: [Release, Debug]
710
steps:
811
- uses: actions/checkout@v4
912
with:
1013
submodules: recursive
11-
- name: Setup environment
12-
run: |
13-
brew update-reset
14-
brew install ninja mpich llvm
15-
brew install libomp
16-
brew link libomp --overwrite --force
17-
brew install openssl
18-
brew link openssl --overwrite --force
19-
- name: ccache
20-
uses: hendrikmuhs/[email protected]
21-
with:
22-
key: ${{ runner.os }}-clang
23-
create-symlink: true
24-
max-size: 1G
25-
- name: CMake configure
26-
run: >
27-
cmake -S . -B build -G Ninja
28-
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
29-
-DCMAKE_C_FLAGS="-I$(brew --prefix)/opt/libomp/include"
30-
-DCMAKE_CXX_FLAGS="-I$(brew --prefix)/opt/libomp/include"
31-
-D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=install
32-
- name: Build project
33-
run: |
34-
cmake --build build --parallel
35-
- name: Install project
36-
run: |
37-
cmake --build build --target install
38-
- name: Archive installed package
39-
run: |
40-
tar -czvf macos-clang-sanitizer-install.tar.gz -C install .
41-
- name: Upload installed package
42-
uses: actions/upload-artifact@v4
14+
- name: Install Xcode
15+
uses: maxim-lobanov/setup-xcode@v1
4316
with:
44-
name: macos-clang-sanitizer-install
45-
path: macos-clang-sanitizer-install.tar.gz
46-
macos-clang-build-debug:
47-
runs-on: macOS-latest
48-
steps:
49-
- uses: actions/checkout@v4
50-
with:
51-
submodules: recursive
17+
xcode-version: 'latest-stable'
5218
- name: Setup environment
5319
run: |
5420
brew update-reset
@@ -69,27 +35,28 @@ jobs:
6935
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
7036
-DCMAKE_C_FLAGS="-I$(brew --prefix)/opt/libomp/include"
7137
-DCMAKE_CXX_FLAGS="-I$(brew --prefix)/opt/libomp/include"
72-
-D CMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=install
38+
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=install
7339
- name: Build project
7440
run: |
7541
cmake --build build --parallel
7642
- name: Install project
7743
run: |
7844
cmake --build build --target install
7945
- name: Archive installed package
80-
run: |
81-
tar -czvf macos-clang-debug-install.tar.gz -C install .
82-
- name: Upload installed package
83-
uses: actions/upload-artifact@v4
46+
uses: ./.github/actions/archive-install
8447
with:
85-
name: macos-clang-debug-install
86-
path: macos-clang-debug-install.tar.gz
48+
path: install
49+
name: ${{ matrix.build_type == 'Debug' && 'macos-clang-debug-install' || 'macos-clang-install' }}
8750
macos-clang-test:
8851
needs:
8952
- macos-clang-build
9053
runs-on: macOS-latest
9154
steps:
9255
- uses: actions/checkout@v4
56+
- name: Install Xcode
57+
uses: maxim-lobanov/setup-xcode@v1
58+
with:
59+
xcode-version: 'latest-stable'
9360
- name: Setup environment
9461
run: |
9562
brew update-reset
@@ -101,57 +68,29 @@ jobs:
10168
- name: Download installed package
10269
uses: actions/download-artifact@v4
10370
with:
104-
name: macos-clang-sanitizer-install
71+
name: macos-clang-install
10572
- name: Extract installed package
10673
run: |
10774
mkdir -p install
108-
tar -xzvf macos-clang-sanitizer-install.tar.gz -C install
109-
- name: Run func tests (MPI, num_proc=1)
110-
run: python3 scripts/run_tests.py --running-type="processes"
111-
env:
112-
PPC_NUM_PROC: 1
113-
PPC_NUM_THREADS: 3
114-
- name: Run func tests (MPI, num_proc=2)
115-
run: python3 scripts/run_tests.py --running-type="processes"
116-
env:
117-
PPC_NUM_PROC: 2
118-
PPC_NUM_THREADS: 2
119-
- name: Run func tests (MPI, num_proc=3)
120-
run: python3 scripts/run_tests.py --running-type="processes"
75+
tar -xzvf macos-clang-install.tar.gz -C install
76+
- name: Run func tests (MPI)
77+
run: python3 scripts/run_tests.py --running-type="processes" --counts 1 2 3 4
12178
env:
122-
PPC_NUM_PROC: 3
12379
PPC_NUM_THREADS: 1
124-
- name: Run func tests (MPI, num_proc=4)
125-
run: python3 scripts/run_tests.py --running-type="processes"
126-
env:
127-
PPC_NUM_PROC: 4
128-
PPC_NUM_THREADS: 1
129-
- name: Run tests (threads, num_threads=1)
130-
run: python3 scripts/run_tests.py --running-type="threads"
80+
- name: Run tests (threads)
81+
run: python3 scripts/run_tests.py --running-type="threads" --counts 1 2 3 4
13182
env:
13283
PPC_NUM_PROC: 1
133-
PPC_NUM_THREADS: 1
134-
- name: Run tests (threads, num_threads=2)
135-
run: python3 scripts/run_tests.py --running-type="threads"
136-
env:
137-
PPC_NUM_PROC: 1
138-
PPC_NUM_THREADS: 2
139-
- name: Run tests (threads, num_threads=3)
140-
run: python3 scripts/run_tests.py --running-type="threads"
141-
env:
142-
PPC_NUM_PROC: 1
143-
PPC_NUM_THREADS: 3
144-
- name: Run tests (threads, num_threads=4)
145-
run: python3 scripts/run_tests.py --running-type="threads"
146-
env:
147-
PPC_NUM_PROC: 1
148-
PPC_NUM_THREADS: 4
14984
macos-clang-test-extended:
15085
needs:
15186
- macos-clang-test
15287
runs-on: macOS-latest
15388
steps:
15489
- uses: actions/checkout@v4
90+
- name: Install Xcode
91+
uses: maxim-lobanov/setup-xcode@v1
92+
with:
93+
xcode-version: 'latest-stable'
15594
- name: Setup environment
15695
run: |
15796
brew update-reset
@@ -163,28 +102,12 @@ jobs:
163102
- name: Download installed package
164103
uses: actions/download-artifact@v4
165104
with:
166-
name: macos-clang-sanitizer-install
105+
name: macos-clang-install
167106
- name: Extract installed package
168107
run: |
169108
mkdir -p install
170-
tar -xzvf macos-clang-sanitizer-install.tar.gz -C install
171-
- name: Run tests (threads, num_threads=5)
172-
run: python3 scripts/run_tests.py --running-type="threads"
173-
env:
174-
PPC_NUM_PROC: 1
175-
PPC_NUM_THREADS: 5
176-
- name: Run tests (threads, num_threads=7)
177-
run: python3 scripts/run_tests.py --running-type="threads"
178-
env:
179-
PPC_NUM_PROC: 1
180-
PPC_NUM_THREADS: 7
181-
- name: Run tests (threads, num_threads=11)
182-
run: python3 scripts/run_tests.py --running-type="threads"
183-
env:
184-
PPC_NUM_PROC: 1
185-
PPC_NUM_THREADS: 11
186-
- name: Run tests (threads, num_threads=13)
187-
run: python3 scripts/run_tests.py --running-type="threads"
109+
tar -xzvf macos-clang-install.tar.gz -C install
110+
- name: Run tests (threads extended)
111+
run: python3 scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
188112
env:
189113
PPC_NUM_PROC: 1
190-
PPC_NUM_THREADS: 13

0 commit comments

Comments
 (0)