Skip to content

Commit e8d6641

Browse files
authored
Port Fortran kernels to C++ using AMReX's GPU programming model. (erf-model#154)
Co-authored with Marc Henry de Frahan (NREL), Steven Reeves (LBNL), Landon Owen (SNL), and Hari Sitaraman (NREL).
1 parent c057876 commit e8d6641

File tree

408 files changed

+100425
-4770
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

408 files changed

+100425
-4770
lines changed

.clang-format

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# -*- mode: yaml -*-
2+
---
3+
Language: Cpp
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: AlwaysBreak
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlinesLeft: false
9+
AlignEscapedNewlines: Left
10+
AlignOperands: true
11+
AlignTrailingComments: true
12+
AllowAllParametersOfDeclarationOnNextLine: true
13+
AllowShortBlocksOnASingleLine: false
14+
AllowShortCaseLabelsOnASingleLine: false
15+
AllowShortFunctionsOnASingleLine: All
16+
AllowShortIfStatementsOnASingleLine: false
17+
AllowShortLoopsOnASingleLine: false
18+
AlwaysBreakAfterDefinitionReturnType: TopLevel
19+
AlwaysBreakAfterReturnType: None
20+
AlwaysBreakBeforeMultilineStrings: false
21+
AlwaysBreakTemplateDeclarations: true
22+
BinPackArguments: true
23+
BinPackParameters: false
24+
BraceWrapping:
25+
AfterClass: true
26+
AfterControlStatement: false
27+
AfterEnum: false
28+
AfterFunction: true
29+
AfterNamespace: false
30+
AfterObjCDeclaration: false
31+
AfterStruct: true
32+
AfterUnion: false
33+
BeforeCatch: false
34+
BeforeElse: false
35+
IndentBraces: false
36+
BreakBeforeBinaryOperators: None
37+
BreakBeforeBraces: Custom
38+
BreakBeforeTernaryOperators: true
39+
BreakConstructorInitializersBeforeComma: false
40+
BreakAfterJavaFieldAnnotations: false
41+
BreakStringLiterals: true
42+
ColumnLimit: 80
43+
CommentPragmas: '^ IWYU pragma:'
44+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
45+
ConstructorInitializerIndentWidth: 2
46+
ContinuationIndentWidth: 2
47+
Cpp11BracedListStyle: true
48+
DerivePointerAlignment: false
49+
DisableFormat: false
50+
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
51+
IncludeCategories:
52+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
53+
Priority: 2
54+
- Regex: '^(<|"(gtest|isl|json)/)'
55+
Priority: 3
56+
- Regex: '.*'
57+
Priority: 1
58+
IncludeIsMainRegex: '$'
59+
IndentCaseLabels: false
60+
IndentWidth: 2
61+
IndentWrappedFunctionNames: false
62+
JavaScriptQuotes: Leave
63+
JavaScriptWrapImports: true
64+
KeepEmptyLinesAtTheStartOfBlocks: true
65+
MacroBlockBegin: ''
66+
MacroBlockEnd: ''
67+
MaxEmptyLinesToKeep: 1
68+
NamespaceIndentation: None
69+
ObjCBlockIndentWidth: 2
70+
ObjCSpaceAfterProperty: false
71+
ObjCSpaceBeforeProtocolList: true
72+
PenaltyBreakBeforeFirstCallParameter: 19
73+
PenaltyBreakComment: 300
74+
PenaltyBreakFirstLessLess: 120
75+
PenaltyBreakString: 1000
76+
PenaltyExcessCharacter: 1000000
77+
PenaltyReturnTypeOnItsOwnLine: 60
78+
PointerAlignment: Left
79+
ReflowComments: true
80+
SortIncludes: false
81+
SpaceAfterCStyleCast: false
82+
SpaceBeforeAssignmentOperators: true
83+
SpaceBeforeParens: ControlStatements
84+
SpaceInEmptyParentheses: false
85+
SpacesBeforeTrailingComments: 1
86+
SpacesInAngles: false
87+
SpacesInContainerLiterals: true
88+
SpacesInCStyleCastParentheses: false
89+
SpacesInParentheses: false
90+
SpacesInSquareBrackets: false
91+
Standard: Cpp11
92+
TabWidth: 2
93+
UseTab: Never
94+

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.H linguist-language=C++
2+
*.h linguist-language=C++

.github/workflows/ci.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: PeleC-CI
2+
3+
on:
4+
push:
5+
branches: [development]
6+
pull_request:
7+
branches: [development]
8+
9+
env:
10+
CXX_COMPILER: mpicxx
11+
C_COMPILER: mpicc
12+
FORTRAN_COMPILER: mpifort
13+
BUILD_TYPE: RelWithDebInfo
14+
NUM_PROCS: 16
15+
16+
jobs:
17+
build:
18+
runs-on: ${{matrix.os}}
19+
strategy:
20+
matrix:
21+
os: [ubuntu-latest, macos-latest]
22+
include:
23+
- os: macos-latest
24+
install_deps: brew install open-mpi automake
25+
comp: llvm
26+
- os: ubuntu-latest
27+
install_deps: sudo apt-get install mpich libmpich-dev
28+
comp: gnu
29+
steps:
30+
- uses: actions/checkout@v2
31+
with:
32+
submodules: true
33+
- name: setup
34+
run: |
35+
cmake -E make_directory ${{runner.workspace}}/build-ci
36+
cmake -E make_directory ${{runner.workspace}}/deps
37+
- name: python
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: '3.x'
41+
- name: dependencies
42+
run: |
43+
# Install MPI
44+
${{matrix.install_deps}}
45+
# Install MetaPhysicL
46+
cd ${{runner.workspace}}/deps
47+
git clone --recursive https://github.com/roystgnr/MetaPhysicL.git ${{runner.workspace}}/deps/MetaPhysicL
48+
cd ${{runner.workspace}}/deps/MetaPhysicL
49+
./bootstrap
50+
./configure CXX=${{env.CXX_COMPILER}} CC=${{env.C_COMPILER}} FC=${{env.FORTRAN_COMPILER}} --prefix="${{runner.workspace}}/deps/install/MetaPhysicL"
51+
make -j ${{env.NUM_PROCS}}
52+
make install
53+
# Install MASA
54+
cd ${{runner.workspace}}/deps
55+
git clone --recursive https://github.com/manufactured-solutions/MASA.git ${{runner.workspace}}/deps/MASA
56+
cd ${{runner.workspace}}/deps/MASA
57+
./bootstrap
58+
./configure CXX='${{env.CXX_COMPILER}} -std=c++11' CC=${{env.C_COMPILER}} FC=${{env.FORTRAN_COMPILER}} --enable-fortran-interfaces METAPHYSICL_DIR="${{runner.workspace}}/deps/install/MetaPhysicL" --prefix="${{runner.workspace}}/deps/install/MASA"
59+
make -j ${{env.NUM_PROCS}}
60+
make install
61+
# Install Python packages
62+
python -m pip install --upgrade pip
63+
pip install nose numpy pandas
64+
- name: configure
65+
working-directory: ${{runner.workspace}}/build-ci
66+
run: |
67+
cmake \
68+
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \
69+
-DCMAKE_BUILD_TYPE:STRING=${{env.BUILD_TYPE}} \
70+
-DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \
71+
-DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \
72+
-DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \
73+
-DPELEC_ENABLE_MPI:BOOL=ON \
74+
-DPELEC_ENABLE_TESTS:BOOL=ON \
75+
-DPELEC_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
76+
-DPELEC_ENABLE_MASA:BOOL=ON \
77+
-DMASA_DIR:STRING=${{runner.workspace}}/deps/install/MASA \
78+
${GITHUB_WORKSPACE}
79+
- name: make
80+
working-directory: ${{runner.workspace}}/build-ci
81+
run: cmake --build . -- -j ${{env.NUM_PROCS}}
82+
- name: test
83+
working-directory: ${{runner.workspace}}/build-ci
84+
run: ctest -j ${{env.NUM_PROCS}} -LE no-ci --output-on-failure
85+
- name: gnumake
86+
working-directory: ./ExecCpp/RegTests/PMF
87+
run: make -j ${{env.NUM_PROCS}} COMP=${{matrix.comp}} USE_MPI=TRUE

.gitignore

+13-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
/Exec/WORK/*
1+
/Exec/WORK/*
2+
.DS_Store
3+
datlog
4+
mmslog
5+
ic.txt
6+
plt*
7+
chk*
8+
tmp_build_dir
9+
.ccls-cache
10+
PeleC*.ex
11+
extern_parameters.H
12+
extern_parameters.cpp
13+
extern_parameters_F.H

.gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[submodule "Submodules/PelePhysics"]
55
path = Submodules/PelePhysics
66
url = https://github.com/AMReX-Combustion/PelePhysics.git
7-
[submodule "Submodules/GoogleTest"]
8-
path = Testing/GoogleTest
9-
url = https://github.com/google/googletest.git
107
[submodule "Submodules/PeleC-MP"]
118
path = Submodules/PeleC-MP
129
url = https://github.com/AMReX-Combustion/PeleC-MP.git
10+
[submodule "Submodules/GoogleTest"]
11+
path = Submodules/GoogleTest
12+
url = https://github.com/google/googletest.git

.travis.yml

-84
This file was deleted.

Build/.gitignore

-16
This file was deleted.

0 commit comments

Comments
 (0)