Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b4d5062
prototyped using concurrent.futures.
MicahGale Apr 4, 2025
5a1cf8d
Jankily switched pickle version for speed up.
MicahGale Apr 4, 2025
2ff3a92
Troubleshoot windows support issue.
MicahGale Apr 7, 2025
ed2fe68
Main guard is necessary for windows support.
MicahGale Apr 7, 2025
7f96961
Made parallel optional.
MicahGale Apr 7, 2025
416569c
Merge branch 'develop' into concurrent
MicahGale Apr 10, 2025
485e325
Moved to independent parser instances.
MicahGale Mar 26, 2025
e8b7af4
Handled None inputs being returned which was implictly handled before.
MicahGale Apr 13, 2025
8ef47b7
Disabled multi-threading by default.
MicahGale Apr 13, 2025
81fb063
Fixed bug where _private attributes are being wrapped.
MicahGale Apr 13, 2025
d89b43f
Passed some options through.
MicahGale Apr 13, 2025
d162e00
Fixed check input for multi-process.
MicahGale Apr 13, 2025
c65a9e2
Updated doc strings for multi proc
MicahGale Apr 13, 2025
25a07ba
Made a parallel benchmark.
MicahGale Apr 13, 2025
eb5093f
Actually made the num_processes do something.
MicahGale Apr 13, 2025
11347cd
Made integration test parallelizable.
MicahGale Apr 13, 2025
357a6e6
Implemented COncurrent CI testing.
MicahGale Apr 13, 2025
dbbb628
Compensate for pytest not being added to path.
MicahGale Apr 13, 2025
ace6782
Added #742 to changelog.
MicahGale Apr 13, 2025
5c550b5
Changed exception inheritance to make pickle happy.
MicahGale Apr 14, 2025
09dc7f8
Properly caught all exceptions with new inheritance.
MicahGale Apr 14, 2025
29ede2e
Updated expected exceptions in test suite with new error inheritance.
MicahGale Apr 14, 2025
7ce66d6
Handled windows not having bash.
MicahGale Apr 14, 2025
8144832
Merge branch 'develop' into concurrent
MicahGale May 13, 2025
9bc4e81
Merge branch 'develop' into concurrent
MicahGale Jun 11, 2025
c69129a
Updated test to be OS agnostic on paths in problem string.
MicahGale Jun 26, 2025
8f97d98
Updated edge case shenanigans to be OS agnostic with paths.
MicahGale Jun 26, 2025
73d3afe
Black formatted tests.
MicahGale Jun 26, 2025
88f853e
Tried to do parsingError inheritance again.
MicahGale Jun 26, 2025
c97e460
Created default str for parsingError to avoid edge case errors in pri…
MicahGale Jun 26, 2025
a9d7a26
Merge pull request #771 from idaholab/745-windows-testing
MicahGale Jun 26, 2025
91fb4a1
Started adding pseudo-model distribution statistics.
MicahGale Jun 30, 2025
4b42505
Renamed errors for merge.
MicahGale Jul 10, 2025
7046bb4
Merge branch 'develop' into concurrent
MicahGale Jul 10, 2025
fd4498a
Fixed bugs from montepy exceptions errors merge.
MicahGale Jul 10, 2025
5ea1651
Got coverage data from parallel run in CI.
MicahGale Jul 11, 2025
1d68173
Documented how to use multi-processing.
MicahGale Jul 12, 2025
05e80ee
Don't need to cover reraising an error.
MicahGale Jul 12, 2025
037bcff
fixed anchor target for main guarding.
MicahGale Jul 12, 2025
f21abe8
Merge branch 'alpha-test-dev' into concurrent
MicahGale Jul 14, 2025
0da1f93
Started testing 3.14 for parallel.
MicahGale Jul 15, 2025
a57923c
Made a surface auto generator.
MicahGale Jul 15, 2025
a41f167
added more generators.
MicahGale Jul 15, 2025
66fe7a4
Updated more constants.
MicahGale Jul 16, 2025
a3744e2
Added nuclide break down info.
MicahGale Jul 16, 2025
d242de2
Finished a very simple model builder.
MicahGale Jul 16, 2025
7d55cc7
Added cli to model builder.
MicahGale Jul 30, 2025
0598e5e
Merge branch 'alpha-test-dev' into concurrent
MicahGale Aug 2, 2025
d33379f
Merge branch 'minor-rel-dev' into concurrent
MicahGale Oct 9, 2025
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
53 changes: 51 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,45 @@ jobs:
with:
file: coverage.xml
github-token: ${{ secrets.github_token }}

flag-name: serial
parallel: true

parallel-test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.13", "3.14-dev"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: set up python 3.13
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install --user . montepy[test,build]
- run: MONTEPY_MULTIPROC=1 python -m pytest tests/test_integration.py
if: ${{ matrix.os == 'macos-latest' }}
- run: |
MONTEPY_MULTIPROC=1 coverage run --concurrency=multiprocessing -p -m pytest
coverage combine
coverage xml
if: ${{ matrix.os == 'ubuntu-latest' }}
name: collect coverage
- run: |
set MONTEPY_MULTIPROC=1
python -m pytest tests/test_integration.py
if: ${{ matrix.os == 'windows-latest' }}
- run: python benchmark/benchmark_big_model_parallel.py
name: Benchmark against big model
- name: Coveralls Upload
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' }}
with:
file: coverage.xml
github-token: ${{ secrets.github_token }}
flag-name: parallel
parallel: true




Expand Down Expand Up @@ -195,7 +233,7 @@ jobs:
with:
python-version: 3.12
- run: pip install . montepy[test]
- run: python benchmark/benchmark_big_model.py
- run: python benchmark/benchmark_big_model_serial.py
name: Benchmark against big model


Expand All @@ -218,3 +256,14 @@ jobs:
run: |
echo "Changelog not updated"
exit 1

finish:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
with:
parallel-finished: true
carryforward: "serial"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ htmlcov
*.*.sw*
*.prof
doc/build/*
.coverage
.coverage*
.hypothesis/
.idea/
.venv/
Expand Down
41 changes: 0 additions & 41 deletions benchmark/benchmark_big_model.py

This file was deleted.

42 changes: 42 additions & 0 deletions benchmark/benchmark_big_model_parallel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import gc

import time
import tracemalloc

tracemalloc.start()

import montepy

FAIL_THRESHOLD = 40
MEMORY_FRACTION = 0.50

if __name__ == "__main__":
starting_mem = tracemalloc.get_traced_memory()[0]
print(f"starting memory with montepy. {starting_mem/1024/1024} MB")
start = time.time()

problem = montepy.read_input("benchmark/big_model.imcnp", multi_proc=True)

stop = time.time()

problem_mem = tracemalloc.get_traced_memory()[0]
print(f"Took {stop - start} seconds")
print(f"Memory usage report: {problem_mem/1024/1024} MB")
del problem
gc.collect()
ending_mem = tracemalloc.get_traced_memory()[0]
print(f"Memory usage report after GC: {ending_mem/1024/1024} MB")

if (stop - start) > FAIL_THRESHOLD:
raise RuntimeError(
f"Benchmark took too long to complete. It must be faster than: {FAIL_THRESHOLD} s."
)

prob_gc_mem = problem_mem - ending_mem
prob_actual_mem = problem_mem - starting_mem
gc_ratio = prob_gc_mem / prob_actual_mem
print(f"{gc_ratio:.2%} of the problem's memory was garbage collected.")
if (prob_gc_mem / prob_actual_mem) < MEMORY_FRACTION:
raise RuntimeError(
f"Benchmark had too many memory leaks. Only {gc_ratio:.2%} of the memory was collected."
)
42 changes: 42 additions & 0 deletions benchmark/benchmark_big_model_serial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import gc

import time
import tracemalloc

tracemalloc.start()

import montepy

FAIL_THRESHOLD = 40
MEMORY_FRACTION = 0.50

if __name__ == "__main__":
starting_mem = tracemalloc.get_traced_memory()[0]
print(f"starting memory with montepy. {starting_mem/1024/1024} MB")
start = time.time()

problem = montepy.read_input("benchmark/big_model.imcnp")

stop = time.time()

problem_mem = tracemalloc.get_traced_memory()[0]
print(f"Took {stop - start} seconds")
print(f"Memory usage report: {problem_mem/1024/1024} MB")
del problem
gc.collect()
ending_mem = tracemalloc.get_traced_memory()[0]
print(f"Memory usage report after GC: {ending_mem/1024/1024} MB")

if (stop - start) > FAIL_THRESHOLD:
raise RuntimeError(
f"Benchmark took too long to complete. It must be faster than: {FAIL_THRESHOLD} s."
)

prob_gc_mem = problem_mem - ending_mem
prob_actual_mem = problem_mem - starting_mem
gc_ratio = prob_gc_mem / prob_actual_mem
print(f"{gc_ratio:.2%} of the problem's memory was garbage collected.")
if (prob_gc_mem / prob_actual_mem) < MEMORY_FRACTION:
raise RuntimeError(
f"Benchmark had too many memory leaks. Only {gc_ratio:.2%} of the memory was collected."
)
Loading