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

Refact/sparse comm #96

Merged
merged 131 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
fd2e5d8
base on sparse communicator branch
greole Oct 26, 2023
c9d2c03
adapt to new Ginkgo version
greole Oct 27, 2023
913b79c
Use localized_partition
greole Oct 27, 2023
53b97c0
Fixup
greole Oct 27, 2023
400b861
construct sparse communicator
greole Oct 31, 2023
ab0d0e2
reformat
greole Oct 31, 2023
6ebed5e
reformat
greole Oct 31, 2023
214cde7
Allow - as separator
greole Oct 31, 2023
dfaca26
Allow - as separator
greole Oct 31, 2023
c33c27b
switch gko version to include try-run patch
greole Oct 31, 2023
6eca357
add a todo fixme notes check
greole Oct 31, 2023
6132126
Merge branch 'refact/sparse_comm' of github.com:hpsim/OGL into refact…
greole Oct 31, 2023
d82ac3f
add a todo fixme notes check
greole Oct 31, 2023
27b2bda
add a todo fixme notes check
greole Oct 31, 2023
110310f
add read_distributed with sparse comm
greole Nov 1, 2023
024acdb
use local indices
greole Nov 3, 2023
a6f341d
fixup
greole Nov 3, 2023
7aa7c4c
compute send_idxs
greole Nov 6, 2023
25e80f7
reorder header
greole Nov 6, 2023
e360350
move ctr to body
greole Nov 6, 2023
0c96fff
remove gko globalIndex
greole Nov 6, 2023
0eef355
add stopping criterion
greole Nov 6, 2023
fa62373
switch gko branch
greole Nov 6, 2023
7ec2633
reformat
greole Nov 6, 2023
235c3c6
format
greole Nov 6, 2023
41cf412
fix typo
greole Nov 6, 2023
63b1360
Move ctr to .C file
greole Nov 7, 2023
ec020eb
use concrete types for interfaces
greole Nov 7, 2023
3d8572b
clean-up
greole Nov 8, 2023
109f6bf
add fs creation
greole Nov 8, 2023
62c3ae5
Fixup pass stopping vector
greole Nov 8, 2023
a344ef3
add stopping crit vect to GMRES, format
greole Nov 8, 2023
26138ee
pass CommunicationPattern, move free functions to separate TU
greole Nov 10, 2023
bd9a2a8
format
greole Nov 10, 2023
a96154b
improve documentation, remove unneeded parameters
greole Nov 10, 2023
ea9284e
format
greole Nov 10, 2023
2b33020
base on sparse communicator branch
greole Oct 26, 2023
29bd1cb
adapt to new Ginkgo version
greole Oct 27, 2023
169f87b
Use localized_partition
greole Oct 27, 2023
f020611
Fixup
greole Oct 27, 2023
9451d53
construct sparse communicator
greole Oct 31, 2023
b8fca33
reformat
greole Oct 31, 2023
c51a5e6
reformat
greole Oct 31, 2023
42b1620
add a todo fixme notes check
greole Oct 31, 2023
463199f
Allow - as separator
greole Oct 31, 2023
0111076
Allow - as separator
greole Oct 31, 2023
e046396
switch gko version to include try-run patch
greole Oct 31, 2023
622e8da
add a todo fixme notes check
greole Oct 31, 2023
74c757c
add a todo fixme notes check
greole Oct 31, 2023
9c5732f
add read_distributed with sparse comm
greole Nov 1, 2023
c7f32c6
use local indices
greole Nov 3, 2023
3a5a687
fixup
greole Nov 3, 2023
726420c
compute send_idxs
greole Nov 6, 2023
d38eca9
reorder header
greole Nov 6, 2023
7949579
move ctr to body
greole Nov 6, 2023
f840fe2
remove gko globalIndex
greole Nov 6, 2023
adabcfd
add stopping criterion
greole Nov 6, 2023
ea10114
switch gko branch
greole Nov 6, 2023
efa2a61
reformat
greole Nov 6, 2023
e584346
format
greole Nov 6, 2023
a604389
fix typo
greole Nov 6, 2023
c8cdbbb
Move ctr to .C file
greole Nov 7, 2023
7b79a72
use concrete types for interfaces
greole Nov 7, 2023
d41ef19
clean-up
greole Nov 8, 2023
7a9c400
add fs creation
greole Nov 8, 2023
5ce8569
Fixup pass stopping vector
greole Nov 8, 2023
96092bd
add stopping crit vect to GMRES, format
greole Nov 8, 2023
b80141e
pass CommunicationPattern, move free functions to separate TU
greole Nov 10, 2023
cd91cba
format
greole Nov 10, 2023
ec97363
improve documentation, remove unneeded parameters
greole Nov 10, 2023
1698f3b
format
greole Nov 10, 2023
ff0d531
start unit tests
greole Nov 10, 2023
596f646
implement basic unit test
greole Nov 13, 2023
d20a94b
added missing namespace, fix double definition
greole Nov 13, 2023
0ae6b35
delete unneeded file
greole Nov 13, 2023
b60d989
link to stdfs
greole Nov 13, 2023
e1fbac3
add basic unit test
greole Nov 13, 2023
c88cacd
add non-symmetric test
greole Nov 14, 2023
af534a6
move init_sparsity to free function and add unit test
greole Nov 15, 2023
2cd456e
update required versions
greole Nov 15, 2023
b39f462
add unit tests to pipeline
greole Nov 15, 2023
6f63f46
add unit tests to pipeline
greole Nov 15, 2023
b7aae49
format
greole Nov 15, 2023
0be7b0c
format
greole Nov 15, 2023
ff0b489
format
greole Nov 17, 2023
66ff6bd
Merge branch 'refact/sparse_comm' into enh/unit_tests
greole Nov 17, 2023
b819278
fix typo
greole Nov 17, 2023
7384793
format
greole Nov 17, 2023
33cc660
Merge pull request #97 from hpsim/enh/unit_tests
greole Nov 17, 2023
c3f26f3
remove note
greole Nov 17, 2023
53f5a1e
fixup workflow file name
greole Nov 17, 2023
6360493
pass arguments to workflow, add job
greole Nov 17, 2023
75dcc0c
fixup workflow
greole Nov 17, 2023
cb35594
fixup path
greole Nov 17, 2023
dd87745
fix matrix call, clean up
greole Nov 17, 2023
4ec167f
add compression to non local column index
greole Nov 17, 2023
f186732
communicate neighbour cell indices to calculate compressed col idxs
greole Nov 17, 2023
249a7d7
add statistics message
greole Nov 17, 2023
da367d0
compile unittests
greole Nov 17, 2023
dfccc49
fix formating
greole Nov 20, 2023
dfdbb9d
add libPstream
greole Nov 20, 2023
575e94e
add more link libs
greole Nov 20, 2023
49ae888
fix lib specs
greole Nov 20, 2023
bfc5e98
fix lib specs
greole Nov 20, 2023
d69701b
source OF
greole Nov 20, 2023
2f1d769
linked sys-openmpi libPsream
greole Nov 20, 2023
a463dae
source OF for unitTestBuild
greole Nov 20, 2023
4a10253
Update CMakeLists.txt
HendriceH Nov 17, 2023
8725113
Update CMakeLists.txt
HendriceH Nov 15, 2023
8f1ab5d
Update common.C
HendriceH Nov 16, 2023
d28aa40
build tests for different mpi versions
greole Nov 20, 2023
dd4c73d
add DL libs
greole Nov 20, 2023
3bdae8f
add cmake format target and format cmake files
greole Nov 20, 2023
8165ebb
clean up
greole Nov 20, 2023
b7f23fb
add cmake-format file
greole Nov 20, 2023
e5f09eb
deactivate unit test for now
greole Nov 21, 2023
a0f4670
Update common/common.C
HendriceH Nov 21, 2023
1d402e3
Update CMakeLists.txt
HendriceH Nov 21, 2023
0db5b8d
Update CMakeLists.txt
HendriceH Nov 21, 2023
de03f24
deactivate unit test for now
greole Nov 21, 2023
033778c
Link stdc++fs into OGL
HendriceH Nov 21, 2023
9a0ac1c
add common notation and scotch decomposition
greole Nov 21, 2023
34d8333
remove unit test dependency
greole Nov 21, 2023
a92ab41
Use CUDA_ARCHITECTURES=native for GPU detection
HendriceH Nov 21, 2023
5ad5234
Merge pull request #99 from HendriceH/aws_compile
greole Nov 22, 2023
4c2f65f
Merge branch 'refact/sparse_comm' into fix/non_unique_interface
greole Nov 22, 2023
95c5db3
use interface_iterator
greole Nov 22, 2023
3f53286
Merge pull request #98 from hpsim/fix/non_unique_interface
greole Nov 22, 2023
2376f66
format
greole Nov 22, 2023
c642000
check for TODO DONT MERGE instead of TODO FIXME
greole Nov 22, 2023
f4d9c41
exclude .github folder
greole Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 243 additions & 0 deletions .cmake-format.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
# SPDX-License-Identifier: Unlicense
# SPDX-FileCopyrightText: 2023 NeoFOAM authors
# ----------------------------------
# Options affecting listfile parsing
# ----------------------------------
with section("parse"):

# Specify structure for custom cmake functions
additional_commands = { 'foo': { 'flags': ['BAR', 'BAZ'],
'kwargs': {'DEPENDS': '*', 'HEADERS': '*', 'SOURCES': '*'}}}

# Override configurations per-command where available
override_spec = {}

# Specify variable tags.
vartags = []

# Specify property tags.
proptags = []

# -----------------------------
# Options affecting formatting.
# -----------------------------
with section("format"):

# Disable formatting entirely, making cmake-format a no-op
disable = False

# How wide to allow formatted cmake files
line_width = 80

# How many spaces to tab for indent
tab_size = 2

# If true, lines are indented using tab characters (utf-8 0x09) instead of
# <tab_size> space characters (utf-8 0x20). In cases where the layout would
# require a fractional tab character, the behavior of the fractional
# indentation is governed by <fractional_tab_policy>
use_tabchars = False

# If <use_tabchars> is True, then the value of this variable indicates how
# fractional indentions are handled during whitespace replacement. If set to
# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set
# to `round-up` fractional indentation is replaced with a single tab character
# (utf-8 0x09) effectively shifting the column to the next tabstop
fractional_tab_policy = 'use-space'

# If an argument group contains more than this many sub-groups (parg or kwarg
# groups) then force it to a vertical layout.
max_subgroups_hwrap = 2

# If a positional argument group contains more than this many arguments, then
# force it to a vertical layout.
max_pargs_hwrap = 6

# If a cmdline positional group consumes more than this many lines without
# nesting, then invalidate the layout (and nest)
max_rows_cmdline = 2

# If true, separate flow control names from their parentheses with a space
separate_ctrl_name_with_space = False

# If true, separate function names from parentheses with a space
separate_fn_name_with_space = False

# If a statement is wrapped to more than one line, than dangle the closing
# parenthesis on its own line.
dangle_parens = False

# If the trailing parenthesis must be 'dangled' on its on line, then align it
# to this reference: `prefix`: the start of the statement, `prefix-indent`:
# the start of the statement, plus one indentation level, `child`: align to
# the column of the arguments
dangle_align = 'prefix'

# If the statement spelling length (including space and parenthesis) is
# smaller than this amount, then force reject nested layouts.
min_prefix_chars = 4

# If the statement spelling length (including space and parenthesis) is larger
# than the tab width by more than this amount, then force reject un-nested
# layouts.
max_prefix_chars = 10

# If a candidate layout is wrapped horizontally but it exceeds this many
# lines, then reject the layout.
max_lines_hwrap = 2

# What style line endings to use in the output.
line_ending = 'unix'

# Format command names consistently as 'lower' or 'upper' case
command_case = 'canonical'

# Format keywords consistently as 'lower' or 'upper' case
keyword_case = 'unchanged'

# A list of command names which should always be wrapped
always_wrap = []

# If true, the argument lists which are known to be sortable will be sorted
# lexicographicall
enable_sort = True

# If true, the parsers may infer whether or not an argument list is sortable
# (without annotation).
autosort = False

# By default, if cmake-format cannot successfully fit everything into the
# desired linewidth it will apply the last, most agressive attempt that it
# made. If this flag is True, however, cmake-format will print error, exit
# with non-zero status code, and write-out nothing
require_valid_layout = False

# A dictionary mapping layout nodes to a list of wrap decisions. See the
# documentation for more information.
layout_passes = {}

# ------------------------------------------------
# Options affecting comment reflow and formatting.
# ------------------------------------------------
with section("markup"):

# What character to use for bulleted lists
bullet_char = '*'

# What character to use as punctuation after numerals in an enumerated list
enum_char = '.'

# If comment markup is enabled, don't reflow the first comment block in each
# listfile. Use this to preserve formatting of your copyright/license
# statements.
first_comment_is_literal = True

# If comment markup is enabled, don't reflow any comment block which matches
# this (regex) pattern. Default is `None` (disabled).
literal_comment_pattern = None

# Regular expression to match preformat fences in comments default=
# ``r'^\s*([`~]{3}[`~]*)(.*)$'``
fence_pattern = '^\\s*([`~]{3}[`~]*)(.*)$'

# Regular expression to match rulers in comments default=
# ``r'^\s*[^\w\s]{3}.*[^\w\s]{3}$'``
ruler_pattern = '^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$'

# If a comment line matches starts with this pattern then it is explicitly a
# trailing comment for the preceeding argument. Default is '#<'
explicit_trailing_pattern = '#<'

# If a comment line starts with at least this many consecutive hash
# characters, then don't lstrip() them off. This allows for lazy hash rulers
# where the first hash char is not separated by space
hashruler_min_length = 10

# If true, then insert a space between the first hash char and remaining hash
# chars in a hash ruler, and normalize its length to fill the column
canonicalize_hashrulers = True

# enable comment markup parsing and reflow
enable_markup = True

# ----------------------------
# Options affecting the linter
# ----------------------------
with section("lint"):

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

# regular expression pattern describing valid function names
function_pattern = '[0-9a-z_]+'

# regular expression pattern describing valid macro names
macro_pattern = '[0-9A-Z_]+'

# regular expression pattern describing valid names for variables with global
# (cache) scope
global_var_pattern = '[A-Z][0-9A-Z_]+'

# regular expression pattern describing valid names for variables with global
# scope (but internal semantic)
internal_var_pattern = '_[A-Z][0-9A-Z_]+'

# regular expression pattern describing valid names for variables with local
# scope
local_var_pattern = '[a-z][a-z0-9_]+'

# regular expression pattern describing valid names for privatedirectory
# variables
private_var_pattern = '_[0-9a-z_]+'

# regular expression pattern describing valid names for public directory
# variables
public_var_pattern = '[A-Z][0-9A-Z_]+'

# regular expression pattern describing valid names for function/macro
# arguments and loop variables.
argument_var_pattern = '[a-z][a-z0-9_]+'

# regular expression pattern describing valid names for keywords used in
# functions or macros
keyword_pattern = '[A-Z][0-9A-Z_]+'

# In the heuristic for C0201, how many conditionals to match within a loop in
# before considering the loop a parser.
max_conditionals_custom_parser = 2

# Require at least this many newlines between statements
min_statement_spacing = 1

# Require no more than this many newlines between statements
max_statement_spacing = 2
max_returns = 6
max_branches = 12
max_arguments = 5
max_localvars = 15
max_statements = 50

# -------------------------------
# Options affecting file encoding
# -------------------------------
with section("encode"):

# If true, emit the unicode byte-order mark (BOM) at the start of the file
emit_byteorder_mark = False

# Specify the encoding of the input file. Defaults to utf-8
input_encoding = 'utf-8'

# Specify the encoding of the output file. Defaults to utf-8. Note that cmake
# only claims to support utf-8 so be careful when using anything else
output_encoding = 'utf-8'

# -------------------------------------
# Miscellaneous configurations options.
# -------------------------------------
with section("misc"):

# A dictionary containing any per-command configuration overrides. Currently
# only `command_case` is supported.
per_command = {}

19 changes: 12 additions & 7 deletions .github/workflows/build-foam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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

Expand Down Expand Up @@ -88,18 +88,14 @@ jobs:
mkdir -p build
cd build
[ -d "/github/home/$GINKGO_CHECKOUT_VERSION" ] && cp -rp /github/home/$GINKGO_CHECKOUT_VERSION third_party
cmake -G Ninja -DOGL_ALLOW_REFERENCE_ONLY=On -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
cmake -G Ninja -DOGL_ALLOW_REFERENCE_ONLY=On -DOGL_BUILD_UNITTEST=OFF -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..

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

- name: Test OGL
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -C $BUILD_TYPE

- name: Install OGL
working-directory: ${{github.workspace}}
run: |
Expand All @@ -118,6 +114,15 @@ jobs:
name: ogl_build_${{ matrix.OF.path }}
path: ${{github.workspace}}/build

# unit_tests:
# needs: [build, setup_build_matrix]
# uses: ./.github/workflows/unit-test.yml
# with:
# path: ${{ matrix.OF.path }}
# strategy:
# fail-fast: false
# matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }}

integration_tests:
needs: [build, setup_build_matrix]
uses: ./.github/workflows/integration-tests.yml
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ jobs:
clang-format-version: '13'
check-path: '.'
fallback-style: 'Mozilla' # optional
- name: check for todo fixme note
run: |
NTODOS="$(grep -r 'TODO DONT MERGE' | wc -l)"
echo "Found $NTODOS TODO DONT MERGE notes"
! grep -q -r "TODO DONT MERGE" --exclude-dir=.github
10 changes: 1 addition & 9 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- 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
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

- name: Cache workspace
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -91,7 +83,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 Down
41 changes: 41 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Unit Tests

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

on:
workflow_call:
inputs:
path:
required: true
type: string

run-name: Unit tests on ${{github.ref_name}}

jobs:
unit_test:
runs-on: ubuntu-latest
container: greole/ofbase
steps:
- uses: actions/checkout@v4

- 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
export GINKGO_CHECKOUT_VERSION=$(cat GINKGO_CHECKOUT_VERSION)
echo "GINKGO_CHECKOUT_VERSION=$GINKGO_CHECKOUT_VERSION" >> $GITHUB_ENV

- name: Cache build folder
uses: actions/cache@v3
with:
key: build-${{ inputs.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
path: |
${{github.workspace}}/build

- name: Test OGL
working-directory: ${{github.workspace}}/build
run:
source /root/OpenFOAM/${{inputs.path}}/etc/bashrc
./unitTests/matrixConversion
Loading