Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stacked] OGL Version 0.6 #134

Open
wants to merge 422 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
422 commits
Select commit Hold shift + click to select a range
0b035b5
Finish the verification of entry values in the unit test for
chihta-wang Aug 14, 2024
040e7e8
Finish the unit test for the function convert_to COO format.
chihta-wang Aug 14, 2024
b416ff0
- Implement the function convert_to CSR
chihta-wang Aug 14, 2024
c84ec5e
- Implement the function move_to COO format for CombinationMatrix class
chihta-wang Aug 14, 2024
b3b7032
- Implement the function move_to CSR format for CombinationMatrix class
chihta-wang Aug 14, 2024
0450d2a
format files
greole Aug 17, 2024
9e4fc09
Apply suggestions from code review
greole Aug 20, 2024
9d36400
start value parameterization
greole Aug 20, 2024
b55c138
fix issue with narrowing conversion
greole Aug 20, 2024
34d1df2
improve doc strings, const correctnes
greole Aug 20, 2024
9c6961d
parameterize has_correct_properties test
greole Aug 20, 2024
b7cef8a
parameterize has_correct_properties test
greole Aug 20, 2024
2ef0fcd
removed solver compilation since it registers solver multiple times
greole Aug 20, 2024
42a8c54
implement can_repartition_1d_comm_pattern n ranks
greole Aug 20, 2024
6e5fd07
add rows check for 1d cells array
greole Aug 21, 2024
9435c5e
add unit test for 2d cells array
greole Aug 21, 2024
5fcd46a
add unit test for 2d cells array
greole Aug 21, 2024
f40969c
format files
greole Aug 21, 2024
da51180
format files, update reuse file
greole Aug 21, 2024
cc567e9
format file
greole Aug 21, 2024
8b4d406
format cmake files
greole Aug 21, 2024
df9f4f6
format files .mtx
greole Aug 21, 2024
afdf6ad
update docstring
greole Aug 21, 2024
341a5df
add docstrings, constructor, and compute dimensions function
greole Aug 24, 2024
edc9deb
implement exchange spans method
greole Aug 24, 2024
124e324
add compute_dimensions implementation
greole Aug 24, 2024
52a29fd
WIP repartition sparsisty
greole Aug 26, 2024
eba1ce2
WIP repartition sparsisty
greole Aug 27, 2024
1235ae5
refactor unit test, add WIP 1d sparsity pattern test
greole Aug 28, 2024
6da10b3
Merge pull request #148 from hpsim/impl/repartitioner
greole Aug 28, 2024
7953f05
add non local column test
greole Aug 28, 2024
bf078c0
Merge branch 'stack/ogl_0.6' into impl/repartitioner_sparsity
greole Aug 28, 2024
e5fa830
Merge remote-tracking branch 'origin/impl/repartitioner_sparsity' int…
greole Aug 28, 2024
e81098d
fix typos
greole Aug 28, 2024
3c6074b
format file
greole Aug 28, 2024
492761f
fix non local issue
greole Aug 28, 2024
1c1f505
fix typos
greole Aug 28, 2024
ef48e6e
format
greole Aug 28, 2024
45d70e9
add Distributed file
greole Aug 9, 2024
fa04ac8
make it compile
greole Aug 29, 2024
93a9b5b
add unit test
greole Aug 29, 2024
8318b16
extend unit test
greole Aug 29, 2024
731b75d
Fix local span computation
greole Aug 30, 2024
7836e5f
parameterize unit test, clean up
greole Aug 30, 2024
45c5f7f
Fix local span computation
greole Aug 30, 2024
aa0dd6e
WIP make update_impl compile, start apply unit test
greole Aug 30, 2024
7e77323
add some more hostmatrix tests and getters
greole Aug 30, 2024
edd60a9
add working distributed unit test
greole Sep 3, 2024
315f591
add working distributed unit test
greole Sep 3, 2024
0d5db93
add export function
greole Sep 4, 2024
fa72256
format
greole Sep 4, 2024
e29975e
Fix typo
greole Sep 4, 2024
7d25bb1
make it compile
greole Sep 4, 2024
1aacc42
fix issues on nla
greole Sep 4, 2024
ec51a54
fix test compilation on nla
greole Sep 5, 2024
4f6e8f2
add basic export
greole Sep 5, 2024
88f1440
fix issues with non inititialised aref mat
greole Sep 5, 2024
8f7c700
add repartitioned vector + copy back
greole Sep 6, 2024
fc485e2
add [ogl] tag to export log, cleanup
greole Sep 6, 2024
b07bf53
value parameterize matrix format
greole Sep 6, 2024
3d2fb03
partially fix mapping for asymetric cases
greole Sep 6, 2024
2feff6e
fix repart mapping of owner ranks != 0
greole Sep 8, 2024
a2d7ab1
add unit test for mapping, add cols check, fix non symmmetric mapping…
greole Sep 8, 2024
7b6d081
simplify presets
greole Sep 8, 2024
613e8e7
simplify presets
greole Sep 8, 2024
5e76e7e
copy vec to array before creating dist vec
greole Sep 8, 2024
7e07e4b
wip device exec
greole Sep 8, 2024
dca0a76
wip device exec
greole Sep 8, 2024
85d626e
wip device exec, fix inconsistent executor usage
greole Sep 9, 2024
a80bac0
fix warnings
greole Sep 9, 2024
ad54654
use previous communicate implementation
greole Sep 9, 2024
45d7ba8
enable Csr format
greole Sep 9, 2024
7816b6c
wip start fusing
greole Sep 9, 2024
1085221
add Csr to apply test
greole Sep 9, 2024
84bf305
remove ranks from sparsity pattern
greole Sep 10, 2024
98cb2d3
write global, compress only on linop creation
greole Sep 10, 2024
96c2c56
fix writing out non_local in global col idx
greole Sep 11, 2024
ff3cc8c
compress based ordered col idxs
greole Sep 11, 2024
40e5057
clean-up
greole Sep 11, 2024
c46f0c5
fix compression of non_local columns
greole Sep 11, 2024
2ecaa19
move conversion to global cols to distributed
greole Sep 11, 2024
fb56c35
create fused mtx
greole Sep 11, 2024
efd8d0b
Add fused update of local values
greole Sep 11, 2024
db175f7
wip fuse impl and update
greole Sep 11, 2024
3477e76
fix for dp labels
greole Sep 12, 2024
f2cbc79
wip fuse impl ranksPerGPUs==1
greole Sep 12, 2024
4f02fe3
update auto enable
greole Sep 12, 2024
b8d3288
make fuse default, print if fused
greole Sep 13, 2024
69762b0
wip fused precond
greole Sep 13, 2024
fbc501b
switch gko base
greole Sep 13, 2024
4e489f8
clean up
greole Sep 14, 2024
8968d80
doc changes
greole Sep 14, 2024
12f8d54
create comm pattern based on unique cell idxs
greole Sep 14, 2024
0a2b1e0
fixup!
greole Sep 14, 2024
963ba44
fixup
greole Sep 14, 2024
947a63b
fixup
greole Sep 14, 2024
eb22b3e
fix unfused interface order
greole Sep 15, 2024
7a50c88
fix repartitioner tests
greole Sep 15, 2024
0e79383
move data to fixture, parameterize fuse/unfused sparsity
greole Sep 15, 2024
0a3f494
add get_local, enable Multigrid update preconditioner
greole Sep 15, 2024
b530864
cleanup
greole Sep 15, 2024
6c10b82
wip add host_buffer_comm
greole Sep 16, 2024
87776e1
add copy ctr
greole Sep 16, 2024
1dee1df
add host buffer based copy_back
greole Sep 16, 2024
47bfac3
add host based communication for vector
greole Sep 16, 2024
b497841
format
greole Sep 16, 2024
ff911f5
simplify unittest
greole Sep 16, 2024
f29c17c
add 2d test cases
greole Sep 17, 2024
0a3e13b
extend unittest, make ldumapping consecutive
greole Sep 17, 2024
2bdf074
wip fix repartitioned cases
greole Sep 17, 2024
5ae06ee
fix non force host buffer case
greole Sep 17, 2024
9da16ea
fix non force host buffer case
greole Sep 17, 2024
ed40445
format
greole Sep 18, 2024
6b6d964
add non local mapping test, add distributed test
greole Sep 18, 2024
bcac64c
improve preconditioner status output
greole Sep 18, 2024
3a7f207
Merge remote-tracking branch 'origin/impl/integration_06' into impl/i…
greole Sep 18, 2024
28cd0f8
Merge pull request #147 from hpsim/impl/distributed_wrapper
greole Sep 18, 2024
9a6811e
wip fix unfused repartition
greole Sep 21, 2024
6a1b68b
wip fix unfused repartition
greole Sep 22, 2024
0283a95
add InterfaceLocality struct
greole Sep 22, 2024
668e33d
clean-up
greole Sep 26, 2024
793e43f
Add a unit test for repartitioning of 2D sparsity pattern for the unf…
chihta-wang Sep 17, 2024
6aa0cc0
Move the expected results for repartitioning 2D sparsiy pattern to
chihta-wang Sep 26, 2024
cedbeb3
Move the unit test for repartitioning 2D sparsity pattern to a separa…
chihta-wang Sep 26, 2024
2901042
Merge pull request #152 from hpsim/impl/unit_tests_Repartitioner
greole Sep 27, 2024
88a9c83
Merge branch 'stack/ogl_0.6' into impl/repartitioner_sparsity
greole Sep 27, 2024
8d4b82b
Merge pull request #151 from hpsim/impl/repartitioner_sparsity
greole Sep 27, 2024
d8dab98
fix unit test, sort interfaces in comm rank order, clean-up
greole Sep 27, 2024
9a91b5f
Merge remote-tracking branch 'origin/impl/integration_06' into impl/i…
greole Sep 27, 2024
8f8e9c7
Move the unit test for repartitioning 2D sparsity pattern to a separa…
chihta-wang Sep 26, 2024
79dd02f
fix unit test, sort interfaces in comm rank order, clean-up
greole Sep 28, 2024
74dc8fd
rename files
greole Oct 1, 2024
c19a96a
format files
greole Oct 1, 2024
caeb435
various fixes
greole Oct 1, 2024
413cb36
consistent use of presets
greole Oct 1, 2024
db52b1c
fix get_local warning
greole Oct 1, 2024
eb78b7c
fix compiler warnings
greole Oct 1, 2024
e530cb3
consistent use of presets
greole Oct 1, 2024
f13e011
fix communicate values for fused update impl
greole Oct 9, 2024
70d5ca7
fix unit tests
greole Oct 10, 2024
baf7660
format files
greole Oct 10, 2024
5f8c077
removed unused
greole Oct 10, 2024
fb657bf
Merge pull request #154 from hpsim/fix/Repartitioner2D
greole Oct 10, 2024
23fc1df
unify write out, store matrix format as word, read writeGlobal
greole Oct 10, 2024
b3fb661
Merge remote-tracking branch 'origin/impl/integration_06' into stack/…
greole Oct 10, 2024
be0e907
wip convert_to_global
greole Oct 15, 2024
07dbaf5
wip convert_to_global
greole Oct 15, 2024
1c9a9ea
add documentation how to write out
greole Oct 15, 2024
7217e88
write out rhs
greole Oct 15, 2024
6b2678b
clean-up, write x
greole Oct 15, 2024
94e7ad1
rename solution to initial guess
greole Oct 15, 2024
d5774a0
allow multiple comm partners same rank
greole Oct 16, 2024
ecbb5a0
Merge pull request #156 from hpsim/enh/global_write
greole Oct 18, 2024
baf703f
wip add all interface to sparsity pattern
greole Oct 18, 2024
283263a
format files
greole Oct 26, 2024
9a95585
add output on failure
greole Nov 2, 2024
6bdcdea
allow mpirun as root
greole Nov 2, 2024
7ba208f
fix validate.py license
greole Nov 2, 2024
f7c82d3
fix issue with missing interface element
greole Nov 5, 2024
3921560
make it "libOGL.so"
greole Nov 5, 2024
36e7c56
clean-up
greole Nov 5, 2024
bf1d151
add l2d and p2d test cases
greole Nov 5, 2024
1261b32
fix typo
greole Nov 5, 2024
4f66c84
update p2d test case
greole Nov 6, 2024
e15eee3
fix local and non-local sparsity for local interfaces
greole Nov 7, 2024
c27cb81
fix count of interface elments
greole Nov 7, 2024
efbea67
fix mapping in the interface case
greole Nov 7, 2024
5c3ecc7
fix local sparsity length issue
greole Nov 7, 2024
ac57432
fix local sparsity length issue
greole Nov 7, 2024
402cd08
fix issue with wrong local matrix nnz for distributed update, add mor…
greole Nov 8, 2024
f9db625
improve error message
greole Nov 8, 2024
19a84ed
fix issue with wrong data access for empty cyclic bcs
greole Nov 8, 2024
c7f7db6
add non local row and col test
greole Nov 8, 2024
e01f9c0
wip fix fused interface case
greole Nov 8, 2024
bcca23a
wip fix fused interface case, add unit test
greole Nov 8, 2024
b36a1e5
fix issue that same processor appears multiple times in communication…
greole Nov 11, 2024
905c8b6
wip add more unit tests
greole Nov 12, 2024
9e30d41
wip add more unit tests
greole Nov 12, 2024
ec096e3
refactor interface handling
greole Nov 12, 2024
34de3f0
udate p2ds2x2 test
greole Nov 26, 2024
b2ff078
remove deprecated unittest
greole Nov 27, 2024
0c0d548
fix repartitioner, add 1d test case
greole Nov 27, 2024
a655db0
remove unused travis file
greole Nov 27, 2024
be8167e
fix typo
greole Nov 27, 2024
8fae283
update Repartitioner1D/2D cases
greole Nov 27, 2024
8274048
format files
greole Nov 27, 2024
ff6af56
update _typos file
greole Nov 27, 2024
d22b0be
add 1d mapping test
greole Nov 28, 2024
f747d46
wip fix collective vs pairwise comm
greole Nov 29, 2024
5ac4519
wip use global ids for interfaces
greole Nov 29, 2024
87ae15f
wip fix collective vs pairwise comm
greole Dec 2, 2024
18bc2b0
wip reorder map
greole Dec 2, 2024
c3d9a25
format
greole Dec 2, 2024
6e1f857
remove unneeded file
greole Dec 2, 2024
7889eba
fix udate of matrix coefficients
greole Dec 2, 2024
6e9ad51
add global write out
greole Dec 3, 2024
aafb71b
update unit test
greole Dec 3, 2024
d6a8df3
fix hostbuffer implementation and vector update
greole Dec 4, 2024
0e81056
format
greole Dec 4, 2024
66a5d1f
format
greole Dec 4, 2024
27d2083
[interface] use common .cpp filenames
greole Dec 5, 2024
15b1cd1
[interface] restructure solver
greole Dec 5, 2024
b7904b6
wip start moving distributed test data
greole Dec 6, 2024
21ae6a0
fixup!
greole Dec 6, 2024
e889605
fix typo
greole Dec 9, 2024
d2b5e5f
change test folder layout
greole Dec 9, 2024
01d8a1e
update integration test folder
greole Dec 9, 2024
a3cec09
fix typo
greole Dec 9, 2024
d568120
trigger ci
greole Dec 9, 2024
597a662
add new integration test
greole Dec 9, 2024
278f859
move more data to DistributedData.hpp
greole Dec 9, 2024
0cb1154
fixup distributed test, read name from unit ptr
greole Dec 9, 2024
ac8a74f
clean-up
greole Dec 9, 2024
18d3bf7
change integration test case to l2d
greole Dec 9, 2024
7114b2f
Merge pull request #157 from hpsim/fix/cyclic_bcs
greole Dec 9, 2024
1f691c5
Merge branch 'dev' into stack/ogl_0.6
greole Dec 9, 2024
a0d8568
fixup!
greole Dec 10, 2024
acca0d2
fixup remove unneeded sleep
greole Dec 10, 2024
05b2067
fixup!
greole Dec 10, 2024
056663e
fixup vector update
greole Dec 11, 2024
0ec5ae4
fix compress columns order based on orig ranks instead of interface id
greole Dec 11, 2024
2a7b8b2
fix compress cols based on global column
greole Dec 11, 2024
e06b0d0
fix send and receive order for repartitioned cases
greole Dec 11, 2024
4c84cc4
fix send_ptr, recv_ptr for fused interfaces
greole Dec 12, 2024
2dc800e
fix order of send_ptr, recv_ptr for fused interfaces
greole Dec 13, 2024
596b0af
format
greole Dec 13, 2024
044134a
format
greole Dec 13, 2024
233cbc4
format
greole Dec 13, 2024
d3cb686
move to new Ginkgo version
greole Dec 13, 2024
0ec5e42
cleanup
greole Dec 13, 2024
714a84f
changes related to fuse fix
greole Dec 13, 2024
1711fd5
remove libs(libOGL.so) since we link with OGL.so otherwise we get a d…
greole Dec 13, 2024
c5c37f3
fix warning about read ctr on geometric field
greole Dec 13, 2024
ac82dd9
deactivate failing cyclic tests for now
greole Dec 13, 2024
cc7e3f0
replace std::partial_sum implementation since it seems to fail random…
greole Dec 13, 2024
7247c84
cleanup
greole Dec 13, 2024
0ae0935
deactivate failing cyclic tests for now
greole Dec 13, 2024
0ef6662
format
greole Dec 13, 2024
1b9b621
fixup back to orig_rank based column compression
greole Dec 14, 2024
8a9b572
Merge remote-tracking branch 'origin/stack/ogl_0.6' into stack/ogl_0.6
greole Dec 14, 2024
1f1962e
use orig comm rank for compression
greole Dec 15, 2024
1327943
log device id
greole Dec 15, 2024
c25d150
clean-up
greole Dec 16, 2024
393210a
improve output
greole Dec 16, 2024
1702287
fix Repartitioner unit tst
greole Dec 16, 2024
09998af
add dimension set ds again since read ctr fails for cyclic bcs
greole Dec 16, 2024
ba0bb13
use host buffer also for pairwise recv
greole Dec 17, 2024
c2d45b3
fixup! format
greole Dec 17, 2024
c8f564e
fixup!
greole Dec 19, 2024
846cc0a
Merge remote-tracking branch 'origin/stack/ogl_0.6' into stack/ogl_0.6
greole Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@ Standard: Cpp11
TabWidth: 8
UseTab: Never
...

8 changes: 3 additions & 5 deletions .cmake-format.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: Unlicense
# SPDX-FileCopyrightText: 2024 OGL authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

# ----------------------------------
# Options affecting listfile parsing
Expand Down Expand Up @@ -29,7 +28,7 @@
disable = False

# How wide to allow formatted cmake files
line_width = 80
line_width = 100

# How many spaces to tab for indent
tab_size = 2
Expand Down Expand Up @@ -168,7 +167,7 @@
with section("lint"):

# a list of lint codes to disable
disabled_codes = []
disabled_codes = ["C0103"]

# regular expression pattern describing valid function names
function_pattern = '[0-9a-z_]+'
Expand Down Expand Up @@ -242,4 +241,3 @@
# A dictionary containing any per-command configuration overrides. Currently
# only `command_case` is supported.
per_command = {}

31 changes: 12 additions & 19 deletions .github/workflows/build-foam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:

on:
push:
branches:
branches:
- dev
- main
pull_request:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Set matrix data
id: set-matrix
run: |
pwd
pwd
echo "matrix=$(jq -c . < .github/workflows/test_matrix.json)" >> $GITHUB_OUTPUT

build:
Expand All @@ -58,23 +58,22 @@ jobs:
- name: Get Ginkgo checkout version
shell: bash
run: |
grep -A1 "set(GINKGO_CHECKOUT_VERSION" CMakeLists.txt|tail -n1|grep -o "[0-9a-z\-]*" > GINKGO_CHECKOUT_VERSION
grep -A1 "set(GINKGO_CHECKOUT_VERSION" CMakeLists.txt|tail -n1|grep -o "[0-9a-z\-_.]*" > GINKGO_CHECKOUT_VERSION
export GINKGO_CHECKOUT_VERSION=$(cat GINKGO_CHECKOUT_VERSION)
echo "GINKGO_CHECKOUT_VERSION=$GINKGO_CHECKOUT_VERSION" >> $GITHUB_ENV

- name: Cache build folder
uses: actions/cache@v4
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip-cache')}}
with:
key: build-${{ matrix.OF.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
path: |
${{github.workspace}}/build
key: build_PR_${{ github.event.pull_request.number }}_${{matrix.OF.path}}
path: ${{github.workspace}}/build

- name: Cache FOAM_USER_LIBBIN
uses: actions/cache@v4
with:
key: FOAM_USER_LIBBIN-${{ matrix.OF.version }}-${{ github.sha }}
path: |
${{matrix.OF.foam_user_libbin}}
key: FOAM_USER_LIBBIN-${{ matrix.OF.path }}-${{ github.sha }}
path: ${{matrix.OF.foam_user_libbin}}

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
Expand All @@ -83,25 +82,19 @@ jobs:
run: |
source /root/OpenFOAM/${{matrix.OF.path}}/etc/bashrc
mkdir -p ${{matrix.OF.foam_user_libbin}}
mkdir -p build
cd build
[ -d "/github/home/$GINKGO_CHECKOUT_VERSION" ] && cp -rp /github/home/$GINKGO_CHECKOUT_VERSION third_party
cmake -GNinja -DOGL_ALLOW_REFERENCE_ONLY=On -DOGL_BUILD_UNITTEST=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${{matrix.OF.foam_user_libbin}} ..
cmake --preset develop

- name: Build OGL
working-directory: ${{github.workspace}}/build
working-directory: ${{github.workspace}}
run: |
source /root/OpenFOAM/${{matrix.OF.path}}/etc/bashrc
cmake --build . --config $BUILD_TYPE
cmake --build --preset develop

- name: Install OGL
working-directory: ${{github.workspace}}
run: |
source /root/OpenFOAM/${{matrix.OF.path}}/etc/bashrc
cmake --install ./build
ls $FOAM_USER_LIBBIN
ls ${{matrix.OF.foam_user_libbin}}

cmake --build --preset develop --target install

- name: Check folders
working-directory: ${{github.workspace}}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/compile_on_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
]
pre-runner-script: |
#!/bin/bash
sudo yum update -y && \
sudo yum update -y && \
sudo yum install docker git libicu ninja-build libasan10 -y
sudo amazon-linux-extras install epel -y
sudo amazon-linux-extras install epel -y
sudo yum install Lmod -y
sudo systemctl enable docker
sudo curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
module load conda
conda activate
python3 -m pip install --upgrade pip
pip install setuptools --upgrade
pip install setuptools --upgrade
git clone https://github.com/exasim-project/OBR
cd OBR
pip install .
Expand Down Expand Up @@ -123,8 +123,8 @@ jobs:
module load openmpi
module load OpenFOAM
export GINKGO_EXECUTOR=cuda
obr init -g --config test/integration.yaml
obr run -o runParallelSolver
obr init -g --config test/integration.yaml
obr run -o runParallelSolver
obr status

stop-runner:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
- name: check for todo fixme note
run: |
NTODOS="$(grep -r 'TODO DONT MERGE' --exclude-dir=.github | wc -l)"
echo "Found $NTODOS TODO DONT MERGE notes"
! grep -q -r "TODO DONT MERGE" --exclude-dir=.github
echo "Found $NTODOS TODO DONT MERGE notes"
! grep -q -r "TODO DONT MERGE" --exclude-dir=.github
44 changes: 22 additions & 22 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ env:
WM_LINK_LANGUAGE: c++
WM_LABEL_OPTION: Int32
WM_MPLIB: SYSTEMOPENMPI
MPI_BUFFER_SIZE: 20000000
MPI_BUFFER_SIZE: 20000000
BUILD_TYPE: Release
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
OBR_RUN_CMD: "mpirun --oversubscribe -np {np} {solver} -parallel -case {path}/case > {path}/case/{solver}_{timestamp}.log 2>&1"
GINKGO_EXECUTOR: reference

on:
on:
workflow_call:
inputs:
path:
Expand Down Expand Up @@ -74,10 +74,10 @@ jobs:
run: |
ls
python3 -m pip install --upgrade pip
pip install setuptools --upgrade
pip uninstall obr -y
pip uninstall owls -y
cd /root/OBR
pip install setuptools --upgrade
pip uninstall obr -y
pip uninstall owls -y
cd /root/OBR
git pull origin dev
pip install -e .
obr --version
Expand All @@ -89,7 +89,7 @@ jobs:
export LD_LIBRARY_PATH=$FOAM_USER_LIBBIN:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/sys-openmpi/:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/openmpi-system:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/dummy/:$LD_LIBRARY_PATH
mkdir -p integration && cd integration
export CYCLIC_CASE=${{inputs.cyclic_case}}
obr init -gy --config /__w/OGL/OGL/test/integration.yaml
obr init -g --config /__w/OGL/OGL/test/integration/lidDrivenCavity.yaml
cat workspace/*/case/*log

setup_integration_matrix:
Expand All @@ -108,7 +108,7 @@ jobs:
name: run-${{matrix.Case}}-${{inputs.version}}
strategy:
fail-fast: false
matrix:
matrix:
Case: ${{fromJson(needs.setup_integration_matrix.outputs.matrix)}}

steps:
Expand All @@ -128,7 +128,7 @@ jobs:
- name: Get Ginkgo checkout version
shell: bash
run: |
grep -A1 "set(GINKGO_CHECKOUT_VERSION" CMakeLists.txt|tail -n1|grep -o "[0-9a-z\-]*" > GINKGO_CHECKOUT_VERSION
grep -A1 "set(GINKGO_CHECKOUT_VERSION" CMakeLists.txt|tail -n1|grep -o "[0-9a-z\-_.]*" > GINKGO_CHECKOUT_VERSION
export GINKGO_CHECKOUT_VERSION=$(cat GINKGO_CHECKOUT_VERSION)
echo "GINKGO_CHECKOUT_VERSION=$GINKGO_CHECKOUT_VERSION" >> $GITHUB_ENV
echo "Ginkgo_DIR=${{inputs.foam_user_libbin}}/cmake/Ginkgo" >> $GITHUB_ENV
Expand All @@ -137,10 +137,10 @@ jobs:
working-directory: /github/home/
run: |
python3 -m pip install --upgrade pip
pip install setuptools --upgrade
pip uninstall obr -y
pip uninstall owls -y
cd /root/OBR
pip install setuptools --upgrade
pip uninstall obr -y
pip uninstall owls -y
cd /root/OBR
git pull origin dev
pip install -e .

Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
name: validate-${{matrix.Case}}-${{inputs.version}}
strategy:
fail-fast: false
matrix:
matrix:
Case: ${{fromJson(needs.setup_integration_matrix.outputs.matrix)}}

steps:
Expand All @@ -204,10 +204,10 @@ jobs:
run: |
ls
python3 -m pip install --upgrade pip
pip install setuptools --upgrade
pip uninstall obr -y
pip uninstall owls -y
cd /root/OBR
pip install setuptools --upgrade
pip uninstall obr -y
pip uninstall owls -y
cd /root/OBR
git pull origin dev
pip install -e .

Expand All @@ -220,7 +220,7 @@ jobs:
- name: Validation of exported mtx files
working-directory: /github/home/${{matrix.Case}}
run: |
python3 /__w/OGL/OGL/test/data_validation.py workspace
python3 /__w/OGL/OGL/test/integration/data_validation.py workspace

- name: Run obr status
working-directory: /github/home/${{matrix.Case}}
Expand All @@ -236,14 +236,14 @@ jobs:
--filter preconditioner==none \
--filter matrixFormat==Coo \
--filter global==completed \
--validate_against=/__w/OGL/OGL/test/validation.json
--validate_against=/__w/OGL/OGL/test/integration/validation.json

- name: Validate preconditioned state
working-directory: /github/home/${{matrix.Case}}
run: |
obr query \
-q global -q continuityErrors -q CourantNumber \
--validate_against=/__w/OGL/OGL/test/validation.json \
--validate_against=/__w/OGL/OGL/test/integration/validation.json \
--filter preconditioner!=none \
--filter global==completed \
--filter case==${{matrix.Case}}
Expand All @@ -253,7 +253,7 @@ jobs:
run: |
obr query \
-q global -q continuityErrors -q CourantNumber \
--validate_against=/__w/OGL/OGL/test/validation.json \
--validate_against=/__w/OGL/OGL/test/integration/validation.json \
--filter matrixFormat!=Coo \
--filter global==completed \
--filter case==${{matrix.Case}}
Expand Down
66 changes: 32 additions & 34 deletions .github/workflows/static_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,76 @@
name: Static checks
run-name: Static checks

defaults:
run:
shell: bash -o pipefail -i {0}

on:
pull_request:
types: [opened, synchronize]

env:
USER: user
BUILD_TYPE: Release
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1


jobs:
build-compilation-db:
name: Build with IWYU
runs-on: ubuntu-latest
container: greole/ofbase
steps:
- uses: actions/checkout@v4

- name: Add clang repo
run: |
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
wget https://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-key add llvm-snapshot.gpg.key

- name: Install dependencies
run: |
sudo apt update
sudo apt install \
apt update
apt install -y \
ninja-build \
iwyu \
clang-16 \
libomp-16-dev

libomp-dev \
iwyu
- name: Create Compilation Database
run: |
cmake --preset ninja-cpuonly-release \
-DCMAKE_CXX_COMPILER=clang++-16 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build --preset ninja-cpuonly-release
source /root/OpenFOAM/openfoam/etc/bashrc
cmake --preset develop \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build --preset develop
- uses: actions/upload-artifact@v4
with:
name: build-artifact
path: build
clang-tidy-check:
name: Clang-tidy Check
runs-on: ubuntu-latest
container: greole/ofbase
needs: [build-compilation-db]
steps:
- uses: actions/checkout@v4

- name: Add clang repo
run: |
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
wget https://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-key add llvm-snapshot.gpg.key

- name: Install dependencies
run: |
sudo apt update
sudo apt install \
clang-tidy-16 \
libomp-16-dev

apt update
apt install -y \
clang-tidy \
jq
- uses: actions/download-artifact@v4
with:
name: build-artifact
path: build

- name: Run clang-tidy
run: |
# Create list of .cpp files belonging to this repository
git ls-files | grep -E "\.(cpp)" > pattern
git config --global --add safe.directory /__w/OGL/OGL
# Create list of all source files belonging to this repository
git ls-files | grep -E "\.(C)" > pattern
# Create list of .cpp files that are in this repository and part of the
# compilation database
# also filters out " at the begin and end of the filename
jq ".[] | .file" build/ReleaseAll/compile_commands.json \
jq ".[] | .file" build/ReleaseCPUOnly/compile_commands.json \
| sed 's/^"\(.*\)"$/\1/' \
| grep -F -f pattern - > files
# run clang-tidy on all specified files
clang-tidy-16 --fix --extra-arg=-w -p build/ReleaseAll $(cat files)
clang-tidy --fix --extra-arg=-w -p build/ReleaseCPUOnly $(cat files)

- name: Check for fixes
run: |
Expand Down
Loading
Loading