Skip to content

Commit 241b9d2

Browse files
authored
Merge pull request #1 from CExA-project/actions
Add Action workflows
2 parents 1b97571 + cfa56c4 commit 241b9d2

File tree

16 files changed

+684
-355
lines changed

16 files changed

+684
-355
lines changed

.github/workflows/courses.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# __________________________________________________
2+
#
3+
# Workflow to test the slide compilation
4+
# __________________________________________________
5+
6+
name: Generate courses PDF
7+
8+
run-name: Generate courses PDF
9+
10+
on: [push]
11+
12+
jobs:
13+
14+
changes:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
output1: ${{ steps.filter.outputs.workflows }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dorny/paths-filter@v3
21+
id: filter
22+
with:
23+
filters: |
24+
beginner:
25+
- 'courses/01_beginners/*.tex'
26+
- 'images'
27+
28+
build_beginner_course:
29+
needs: changes
30+
if: ${{ needs.changes.outputs.beginner == 'true' }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Set up Git repository
34+
uses: actions/checkout@v4
35+
- name: Compile LaTeX document
36+
uses: xu-cheng/latex-action@v3
37+
with:
38+
working_directory: courses/01_beginners/
39+
pre_compile: |
40+
pwd
41+
tlmgr update --self && tlmgr update minted
42+
latexminted --version
43+
root_file: main.tex
44+
latexmk_shell_escape: true
45+
latexmk_use_xelatex: true
46+
post_compile: |
47+
mv main.pdf beginners.pdf
48+
# - name: Upload PDF file
49+
# uses: actions/upload-artifact@v4
50+
# with:
51+
# name: beginner_pdf_course
52+
# path: courses/01_beginners/beginners.pdf

.github/workflows/exercises.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# __________________________________________________
2+
#
3+
# Workflow to compile and run all exercises
4+
# __________________________________________________
5+
6+
name: Test exercises
7+
8+
run-name: Test exercises
9+
10+
on: [push]
11+
12+
jobs:
13+
14+
changes:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
output1: ${{ steps.filter.outputs.workflows }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dorny/paths-filter@v3
21+
id: filter
22+
with:
23+
filters: |
24+
exercises:
25+
- 'exercise/02_first_program/**'
26+
- 'exercise/03_basic_view/**'
27+
- 'exercise/04_deep_copy/**'
28+
- 'exercise/05_parallel_loop/**'
29+
- 'exercise/06_parallel_reduce/**'
30+
31+
build_kokkos:
32+
runs-on: ubuntu-latest
33+
needs: [changes]
34+
if: ${{ needs.changes.outputs.exercises == 'true' }}
35+
steps:
36+
- name: Set up Git repository
37+
uses: actions/checkout@v4
38+
- name: Install Kokkos
39+
run: |
40+
git clone https://github.com/kokkos/kokkos.git
41+
cd kokkos
42+
git checkout develop
43+
mkdir build_openmp
44+
mkdir install_openmp
45+
cmake -B build_openmp -DCMAKE_INSTALL_PREFIX=${PWD}/install_openmp -DKokkos_ENABLE_OPENMP=ON ./
46+
make install -C build_openmp
47+
- name: Upload Kokkos artifact
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: kokkos
51+
path: kokkos/install_openmp
52+
53+
build_exercises:
54+
runs-on: ubuntu-latest
55+
needs: [build_kokkos, changes]
56+
if: ${{ needs.changes.outputs.exercises == 'true' }}
57+
steps:
58+
- name: Set up Git repository
59+
uses: actions/checkout@v4
60+
- name: Download Kokkos artifact
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: kokkos
64+
path: kokkos/install_openmp
65+
- name: Compile 02_first_program
66+
run: |
67+
cd exercises/02_first_program/solution/
68+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/kokkos/install_openmp/ ./
69+
make
70+
bash execute.sh
71+
cd ${GITHUB_WORKSPACE}
72+
- name: Compile 03_basic_view
73+
run: |
74+
cd exercises/03_basic_view/solution/
75+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/kokkos/install_openmp/ ./
76+
make
77+
bash execute.sh
78+
cd ${GITHUB_WORKSPACE}
79+
- name: Compile 04_deep_copy
80+
run: |
81+
cd exercises/04_deep_copy/solution/
82+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/kokkos/install_openmp/ ./
83+
make
84+
bash execute.sh
85+
cd ${GITHUB_WORKSPACE}
86+
- name: Compile 05_parallel_loop
87+
run: |
88+
cd exercises/05_parallel_loop/solution/
89+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/kokkos/install_openmp/ ./
90+
make
91+
bash execute.sh
92+
cd ${GITHUB_WORKSPACE}
93+
- name: Compile 06_parallel_reduce
94+
run: |
95+
cd exercises/06_parallel_reduce/solution/
96+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/kokkos/install_openmp/ ./
97+
make
98+
bash execute.sh
99+
cd ${GITHUB_WORKSPACE}
100+
101+
102+

.github/workflows/projects.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# __________________________________________________
2+
#
3+
# Workflow to compile and run all projects
4+
# __________________________________________________
5+
6+
name: Test projects
7+
8+
run-name: Test projects
9+
10+
on: [push]
11+
12+
jobs:
13+
14+
changes:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
output1: ${{ steps.filter.outputs.workflows }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dorny/paths-filter@v3
21+
id: filter
22+
with:
23+
filters: |
24+
wave:
25+
- 'projects/wave/**'
26+
27+
build_kokkos:
28+
runs-on: ubuntu-latest
29+
needs: changes
30+
steps:
31+
- name: Set up Git repository
32+
uses: actions/checkout@v4
33+
- name: Install Kokkos
34+
run: |
35+
git clone https://github.com/kokkos/kokkos.git
36+
cd kokkos
37+
git checkout develop
38+
mkdir build_openmp
39+
mkdir install_openmp
40+
cmake -B build_openmp -DCMAKE_INSTALL_PREFIX=${PWD}/install_openmp -DKokkos_ENABLE_OPENMP=ON ./
41+
make install -C build_openmp
42+
- name: Upload Kokkos artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: kokkos
46+
path: kokkos/install_openmp
47+
48+
build_wave_projects:
49+
runs-on: ubuntu-latest
50+
needs: [build_kokkos, changes]
51+
if: ${{ needs.changes.outputs.wave == 'true' }}
52+
steps:
53+
- name: Set up Git repository
54+
uses: actions/checkout@v4
55+
- name: Download Kokkos artifact
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: kokkos
59+
path: kokkos/install_openmp
60+
- name: wave sequential
61+
run: |
62+
cd projects/wave/sequential/
63+
cmake -DCMAKE_BUILD_TYPE=Release ./
64+
make
65+
./exe
66+
cd ${GITHUB_WORKSPACE}
67+
- name: wave openMP
68+
run: |
69+
cd projects/wave/omp
70+
cmake -DCMAKE_BUILD_TYPE=Release ./
71+
make
72+
export OMP_NUM_THREADS=2
73+
export OMP_PROC_BIND=true
74+
export OMP_SCHEDULER=dynamic
75+
./exe --size 128 128 --time 5 --output-period 100 --print-period 100 --domain-length 10 10 --boundary 1
76+
cd ${GITHUB_WORKSPACE}
77+
- name: wave Kokkos
78+
run: |
79+
cd projects/wave/solution/
80+
cmake -DCMAKE_BUILD_TYPE=Release -DKokkos_DIR=${GITHUB_WORKSPACE}/kokkos/install_openmp/lib/cmake/Kokkos/ ./
81+
make
82+
./exe --size 128 128 --time 5 --output-period 100 --print-period 100 --domain-length 10 10 --boundary 1
83+
cd ${GITHUB_WORKSPACE}
84+

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Kokkos-cexa-tutorial
22

3+
![CI](https://github.com/CExA-project/cexa-kokkos-tutorials/actions/workflows/courses.yml/badge.svg)
4+
![CI](https://github.com/CExA-project/cexa-kokkos-tutorials/actions/workflows/exercises.yml/badge.svg)
5+
![CI](https://github.com/CExA-project/cexa-kokkos-tutorials/actions/workflows/projects.yml/badge.svg)
6+
37
Courses
48

59
- [Introduction to Kokkos](courses/01_beginners/README.md)
@@ -15,4 +19,12 @@ Exercises:
1519

1620
Projects:
1721

18-
- [Project 1: Wave Propagation](projects/wave/README.md)
22+
- [Project 1: Wave Propagation](projects/wave/README.md)
23+
24+
## Compile the tutorials
25+
26+
To compile the tutorials, you need a working Tex environment.
27+
28+
```bash
29+
xelatex -shell-escape main.tex
30+
```

courses/01_beginners/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This course is for beginners. It will teach you the basics of GPU programming an
66

77
The slides use Beamer, a LaTeX package for creating presentations. To compile the slides, you need to have LaTeX installed on your system.
88

9-
For instance, using `pdflatex`:
9+
For instance, using `xelatex`:
1010

1111
```bash
12-
pdflatex -shell-escape main.tex
12+
xelatex -shell-escape main.tex
1313
```
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
export OMP_PROC_BIND=spread
3+
export OMP_NUM_THREADS=4
4+
./exe
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
export OMP_PROC_BIND=spread
3+
export OMP_NUM_THREADS=2
4+
./exe
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
export OMP_PROC_BIND=spread
3+
export OMP_NUM_THREADS=2
4+
./exe
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
export OMP_PROC_BIND=spread
3+
export OMP_NUM_THREADS=2
4+
./exe
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
export OMP_PROC_BIND=spread
3+
export OMP_NUM_THREADS=2
4+
./exe

0 commit comments

Comments
 (0)