Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
131 changes: 131 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# SPDX-FileCopyrightText: 2021 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause

Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
# keep the doctest headers in front
- Regex: '^(<|")doctest'
Priority: 1
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 3
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 4
- Regex: '.*'
Priority: 2
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
QualifierAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
8 changes: 8 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: 2021 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause

# apply clang-format/basic pre-commit
511bc1513e3a6d5ceb4b338750f57253ec429e9b
# update clang-format config
fb0b99c3454b5dad40ae0cff13099e4e8a5bf894
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2025 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-LicenseComments: Full text under /LICENSE and /LICENSES/
#
# SPDX-FileContributor: Author lists in /AUTHORS and /CITATION.cff

name: pre-commit
on:
- push

jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: pre-commit/action@v3.0.1
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Yateto CI
name: yateto-cpu

on: push

jobs:
general:
runs-on: ubuntu-latest
container:
runs-on: ubuntu-24.04
container:
image: seissol/gha-cpu:davschneller-gpu-image
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install Yateto
run: |
pip3 install -e . --break-system-packages

- name: Python Tests
run: |
python3 -m unittest tests/internals/*.py

- name: install-packages
run: |
apt-get update -y
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update -y
apt-get install -y cxxtest

- name: Interface Tests
run: |
cd ./tests/interface
Expand All @@ -38,31 +38,31 @@ jobs:
done

codegen:
runs-on: ubuntu-latest
container:
runs-on: ubuntu-24.04
container:
image: seissol/gha-cpu:davschneller-gpu-image
env:
CTEST_OUTPUT_ON_FAILURE: 1
strategy:
fail-fast: false
matrix:
generator: [none, Eigen, LIBXSMM, LIBXSMM_JIT, OpenBLAS, PSpaMM]

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install Yateto
run: |
pip3 install -e . --break-system-packages

- name: install-packages
run: |
apt-get update -y
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update -y
apt-get install -y cxxtest

- name: install-libxsmm
if: ${{ matrix.generator == 'LIBXSMM_JIT' }}
run: |
Expand Down
86 changes: 86 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# SPDX-FileCopyrightText: 2025 SeisSol Group
#
# SPDX-License-Identifier: BSD-3-Clause

---

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
name: '[GENERIC] merge conflict check'
- id: check-symlinks
name: '[GENERIC] symlink check'
- id: destroyed-symlinks
name: '[GENERIC] detect broken symlinks'
- id: detect-private-key
name: '[GENERIC] detect private keys uploaded by accident'
- id: check-case-conflict
name: '[GENERIC] detect OS file naming case conflicts'
- id: check-executables-have-shebangs
name: '[GENERIC] check for shebangs in executable files'
- id: check-illegal-windows-names
name: '[GENERIC] detect illegal Windows file names'
- id: check-json
name: '[JSON] check'
- id: check-xml
name: '[XML] check'

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.18.1
hooks:
- id: markdownlint-cli2
name: '[MARKDOWN] lint'

#- repo: https://github.com/fsfe/reuse-tool
# rev: v6.0.0
# hooks:
# - id: reuse
# name: '[GENERIC] REUSE compatibiltiy'

#- repo: https://github.com/psf/black-pre-commit-mirror
# rev: 25.1.0
# hooks:
# - id: black
# files: ^(?!preprocessing|postprocessing)
# name: '[PYTHON] black'
#- repo: https://github.com/pycqa/isort
# rev: 6.0.1
# hooks:
# - id: isort
# files: ^(?!preprocessing|postprocessing)
# args: ["--profile", "black"]
# name: '[PYTHON] isort'
- repo: https://github.com/pycqa/bandit
rev: 1.8.6
hooks:
- id: bandit
args: ["--confidence-level", "high", "--severity-level", "high"]
name: '[PYTHON] bandit'
#- repo: https://github.com/pycqa/flake8
# rev: '7.3.0'
# hooks:
# - id: flake8
# files: ^(?!preprocessing|postprocessing)
# name: '[PYTHON] Flake8'

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: 'v1.0.0'
hooks:
- id: sphinx-lint
name: '[SPHINX/RST] sphinx lint'

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v21.1.0'
hooks:
- id: clang-format
name: '[C++] clang-format'

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
name: '[GENERIC] newline eof'
- id: trailing-whitespace
name: '[GENERIC] remove trailing whitespace'
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# YATeTo

It is **Y**et **A**nother **Te**nsor **To**olbox for discontinuous Galerkin methods and other
applications. You can find much more information about the package
[here](https://arxiv.org/abs/1903.11521).
It is **Y**et **A**nother **Te**nsor **To**olbox for
discontinuous Galerkin methods and other
applications. You can find much more information about the package
[in this paper](https://arxiv.org/abs/1903.11521).

## Installation

Expand All @@ -24,7 +25,7 @@ def add(g):
B = Tensor('B', (N, N, N))
w = Tensor('w', (N,))
C = Tensor('C', (N, N))

kernel = C['ij'] <= 2.0 * C['ij'] + A['lj'] * B['ikl'] * w['k']
g.add(name='kernel', ast=kernel)

Expand Down
2 changes: 1 addition & 1 deletion examples/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if 'CXX' in env['ENV']:

# generate help text
Help(vars.GenerateHelpText(env))

# handle unknown, maybe misspelled variables
unknownVariables = vars.UnknownVariables()

Expand Down
Loading