Skip to content

Commit be04e28

Browse files
authored
Merge pull request #2 from cn-skywalker/virtual_lattice_0.15.2
Virtual lattice 0.15.2
2 parents 4c1c604 + ce605fa commit be04e28

File tree

1,341 files changed

+139746
-77654
lines changed

Some content is hidden

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

1,341 files changed

+139746
-77654
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ PenaltyBreakTemplateDeclaration: 10
8484
PenaltyExcessCharacter: 1000000
8585
PenaltyReturnTypeOnItsOwnLine: 200
8686
PointerAlignment: Left
87+
QualifierAlignment: Left
8788
ReflowComments: true
8889
SortIncludes: true
8990
SortUsingDeclarations: true

.git_archival.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
commit: $Format:%H$
2+
commit-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Report a bug that is preventing proper operation
4+
title: ''
5+
labels: Bugs
6+
assignees: ''
7+
8+
---
9+
10+
<!--
11+
If you are a user of OpenMC and are running into trouble with the code or are
12+
seeking general user support, we highly recommend posting on the OpenMC
13+
discourse forum first. GitHub issues should be used specifically for bug reports
14+
and feature requests.
15+
16+
https://openmc.discourse.group/
17+
18+
-->
19+
20+
## Bug Description
21+
<!--A clear and concise description of the problem (Note: A missing feature is not a bug).-->
22+
23+
24+
## Steps to Reproduce
25+
<!--Steps to reproduce the behavior (input file, or modifications to an existing input file, etc.)-->
26+
27+
28+
## Environment
29+
<!--Operating system, OpenMC version, how OpenMC was installed, nuclear data being used, etc.-->

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Troubleshooting and User Support
4+
url: https://openmc.discourse.group/
5+
about: For user support and troubleshooting, please use our Discourse forum
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Documentation improvement
3+
about: Found something incomplete or incorrect in our documentation?
4+
title: ''
5+
labels: Documentation
6+
assignees: ''
7+
8+
---
9+
10+
<!--Describe the issue with the documentation and include a URL to the corresponding page-->
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature or enhancement request
3+
about: Suggest a new feature or enhancement to existing capabilities
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Description
11+
<!--What is the feature or enhancement?-->
12+
13+
14+
## Alternatives
15+
<!--If alternative solutions have been considered, describe them here and the reasoning for the chosen solution --->
16+
17+
18+
## Compatibility
19+
<!--Will the enhancement change existing APIs or add something new?-->

.github/pull_request_template.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
If you are a first-time contributor to OpenMC, please have a look at our
3+
contributing guidelines:
4+
https://github.com/openmc-dev/openmc/blob/develop/CONTRIBUTING.md
5+
-->
6+
7+
# Description
8+
9+
Please include a summary of the change and which issue is fixed if applicable. Please also include relevant motivation and context.
10+
11+
Fixes # (issue)
12+
13+
# Checklist
14+
15+
- [ ] I have performed a self-review of my own code
16+
- [ ] I have run [clang-format](https://docs.openmc.org/en/latest/devguide/styleguide.html#automatic-formatting) (version 15) on any C++ source files (if applicable)
17+
- [ ] I have followed the [style guidelines](https://docs.openmc.org/en/latest/devguide/styleguide.html#python) for Python source files (if applicable)
18+
- [ ] I have made corresponding changes to the documentation (if applicable)
19+
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
20+
<!--
21+
While tests will automatically be checked by CI, it is good practice to
22+
ensure that they pass locally first. See instructions here:
23+
https://docs.openmc.org/en/latest/devguide/tests.html
24+
-->

.github/workflows/ci.yml

Lines changed: 101 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ env:
2222

2323
jobs:
2424
main:
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-22.04
2626
strategy:
2727
matrix:
28-
python-version: [3.8]
28+
python-version: ["3.11"]
2929
mpi: [n, y]
3030
omp: [n, y]
3131
dagmc: [n]
@@ -34,30 +34,30 @@ jobs:
3434
vectfit: [n]
3535

3636
include:
37-
- python-version: 3.6
37+
- python-version: "3.12"
3838
omp: n
3939
mpi: n
40-
- python-version: 3.7
40+
- python-version: "3.13"
4141
omp: n
4242
mpi: n
4343
- dagmc: y
44-
python-version: 3.8
44+
python-version: "3.11"
4545
mpi: y
4646
omp: y
4747
- libmesh: y
48-
python-version: 3.8
48+
python-version: "3.11"
4949
mpi: y
5050
omp: y
5151
- libmesh: y
52-
python-version: 3.8
52+
python-version: "3.11"
5353
mpi: n
5454
omp: y
5555
- event: y
56-
python-version: 3.8
56+
python-version: "3.11"
5757
omp: y
5858
mpi: n
5959
- vectfit: y
60-
python-version: 3.8
60+
python-version: "3.11"
6161
omp: n
6262
mpi: y
6363
name: "Python ${{ matrix.python-version }} (omp=${{ matrix.omp }},
@@ -73,62 +73,143 @@ jobs:
7373
EVENT: ${{ matrix.event }}
7474
VECTFIT: ${{ matrix.vectfit }}
7575
LIBMESH: ${{ matrix.libmesh }}
76+
NPY_DISABLE_CPU_FEATURES: "AVX512F AVX512_SKX"
77+
OPENBLAS_NUM_THREADS: 1
78+
PYTEST_ADDOPTS: --cov=openmc --cov-report=lcov:coverage-python.lcov
79+
# libfabric complains about fork() as a result of using Python multiprocessing.
80+
# We can work around it with RDMAV_FORK_SAFE=1 in libfabric < 1.13 and with
81+
# FI_EFA_FORK_SAFE=1 in more recent versions.
82+
RDMAV_FORK_SAFE: 1
7683

7784
steps:
78-
- uses: actions/checkout@v2
85+
- name: Setup cmake
86+
uses: jwlawson/actions-setup-cmake@v2
87+
with:
88+
cmake-version: '3.31'
89+
90+
- name: Checkout repository
91+
uses: actions/checkout@v4
92+
with:
93+
fetch-depth: 0
7994

8095
- name: Set up Python ${{ matrix.python-version }}
81-
uses: actions/setup-python@v2
96+
uses: actions/setup-python@v5
8297
with:
8398
python-version: ${{ matrix.python-version }}
8499

85100
- name: Environment Variables
86101
run: |
87-
echo "DAGMC_ROOT=$HOME/DAGMC"
88102
echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV
89103
echo "OPENMC_ENDF_DATA=$HOME/endf-b-vii.1" >> $GITHUB_ENV
104+
# get the sha of the last branch commit
105+
# for push and workflow_dispatch events, use the current reference head
106+
BRANCH_SHA=HEAD
107+
# for a pull_request event, use the last reference of the parents of the merge commit
108+
if [ "${{ github.event_name }}" == "pull_request" ]; then
109+
BRANCH_SHA=$(git rev-list --parents -n 1 HEAD | rev | cut -d" " -f 1 | rev)
110+
fi
111+
COMMIT_MESSAGE=$(git log $BRANCH_SHA -1 --pretty=%B | tr '\n' ' ')
112+
echo ${COMMIT_MESSAGE}
113+
echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
90114
91115
- name: Apt dependencies
92116
shell: bash
93117
run: |
94118
sudo apt -y update
95119
sudo apt install -y libpng-dev \
96-
libmpich-dev \
97120
libnetcdf-dev \
98121
libpnetcdf-dev \
99122
libhdf5-serial-dev \
100-
libhdf5-mpich-dev \
101123
libeigen3-dev
124+
125+
- name: Optional apt dependencies for MPI
126+
shell: bash
127+
if: ${{ matrix.mpi == 'y' }}
128+
run: |
129+
sudo apt install -y libhdf5-mpich-dev \
130+
libmpich-dev
102131
sudo update-alternatives --set mpi /usr/bin/mpicc.mpich
103132
sudo update-alternatives --set mpirun /usr/bin/mpirun.mpich
104133
sudo update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
105134
135+
- name: Optional apt dependencies for vectfit
136+
shell: bash
137+
if: ${{ matrix.vectfit == 'y' }}
138+
run: sudo apt install -y libblas-dev liblapack-dev
139+
106140
- name: install
107141
shell: bash
108142
run: |
109143
echo "$HOME/NJOY2016/build" >> $GITHUB_PATH
110144
$GITHUB_WORKSPACE/tools/ci/gha-install.sh
111145
146+
- name: display-config
147+
shell: bash
148+
run: |
149+
openmc -v
150+
151+
- name: cache-xs
152+
uses: actions/cache@v4
153+
with:
154+
path: |
155+
~/nndc_hdf5
156+
~/endf-b-vii.1
157+
key: ${{ runner.os }}-build-xs-cache
158+
112159
- name: before
113160
shell: bash
114161
run: $GITHUB_WORKSPACE/tools/ci/gha-before-script.sh
115162

116163
- name: test
117164
shell: bash
118-
run: $GITHUB_WORKSPACE/tools/ci/gha-script.sh
165+
run: |
166+
CTEST_OUTPUT_ON_FAILURE=1 make test -C $GITHUB_WORKSPACE/build/
167+
$GITHUB_WORKSPACE/tools/ci/gha-script.sh
168+
169+
- name: Setup tmate debug session
170+
continue-on-error: true
171+
if: ${{ contains(env.COMMIT_MESSAGE, '[gha-debug]') }}
172+
uses: mxschmitt/action-tmate@v3
173+
timeout-minutes: 10
174+
175+
- name: Generate C++ coverage (gcovr)
176+
shell: bash
177+
run: |
178+
# Produce LCOV directly from gcov data in the build tree
179+
gcovr \
180+
--root "$GITHUB_WORKSPACE" \
181+
--object-directory "$GITHUB_WORKSPACE/build" \
182+
--filter "$GITHUB_WORKSPACE/src" \
183+
--filter "$GITHUB_WORKSPACE/include" \
184+
--exclude "$GITHUB_WORKSPACE/src/external/.*" \
185+
--exclude "$GITHUB_WORKSPACE/src/include/openmc/external/.*" \
186+
--gcov-ignore-errors source_not_found \
187+
--gcov-ignore-errors output_error \
188+
--gcov-ignore-parse-errors suspicious_hits.warn \
189+
--print-summary \
190+
--lcov -o coverage-cpp.lcov || true
119191
120-
- name: after_success
192+
- name: Merge C++ and Python coverage
121193
shell: bash
122194
run: |
123-
cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json
124-
coveralls --merge=cpp_cov.json --service=github
195+
# Merge C++ and Python LCOV into a single file for upload
196+
cat coverage-cpp.lcov coverage-python.lcov > coverage.lcov
197+
198+
- name: Upload coverage to Coveralls
199+
if: ${{ hashFiles('coverage.lcov') != '' }}
200+
uses: coverallsapp/github-action@v2
201+
with:
202+
github-token: ${{ secrets.GITHUB_TOKEN }}
203+
parallel: true
204+
flag-name: C++ and Python
205+
path-to-lcov: coverage.lcov
125206

126207
finish:
127208
needs: main
128209
runs-on: ubuntu-latest
129210
steps:
130211
- name: Coveralls Finished
131-
uses: coverallsapp/github-action@master
212+
uses: coverallsapp/github-action@v2
132213
with:
133-
github-token: ${{ secrets.github_token }}
214+
github-token: ${{ secrets.GITHUB_TOKEN }}
134215
parallel-finished: true

.github/workflows/dockerhub-publish-dagmc-libmesh.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
steps:
1111
-
1212
name: Set up QEMU
13-
uses: docker/setup-qemu-action@v1
13+
uses: docker/setup-qemu-action@v3
1414
-
1515
name: Set up Docker Buildx
16-
uses: docker/setup-buildx-action@v1
16+
uses: docker/setup-buildx-action@v3
1717
-
1818
name: Login to DockerHub
19-
uses: docker/login-action@v1
19+
uses: docker/login-action@v3
2020
with:
2121
username: ${{ secrets.DOCKERHUB_USERNAME }}
2222
password: ${{ secrets.DOCKERHUB_TOKEN }}
2323
-
2424
name: Build and push
2525
id: docker_build
26-
uses: docker/build-push-action@v2
26+
uses: docker/build-push-action@v5
2727
with:
2828
push: true
2929
tags: openmc/openmc:latest-dagmc-libmesh

0 commit comments

Comments
 (0)