Skip to content

1400 The ABMs RNG is not used after initialization#1534

Merged
DavidKerkmann merged 11 commits intomainfrom
1400-the-abms-rng-is-not-used-after-initialization
Apr 9, 2026
Merged

1400 The ABMs RNG is not used after initialization#1534
DavidKerkmann merged 11 commits intomainfrom
1400-the-abms-rng-is-not-used-after-initialization

Conversation

@reneSchm
Copy link
Copy Markdown
Member

@reneSchm reneSchm commented Apr 7, 2026

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • Change PersonalRandomNumberGenerator to use the key from another RNG (usually the model's).
  • Remove the now unused key property and related methods from Person.
  • Modify the ABM parameter study example, such that it can return reproducible results with MPI or OpenMP.
  • Add a const version of abm::Model::get_rng.
  • Add new abm::Model::reset_rng function.
  • Fix interpolate_simulation_result returning a 0.0 time point with negative sign.
  • Add a stream operator for std::vector, allowing for easier printing.
  • Make git ignore the example_results directory.

If need be, add additional information and what the reviewer should look out for in particular:

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below).
  • New code adheres to coding guidelines.
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.).
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP).
  • Appropriate documentation within the code (Doxygen) for new functionality has been added in the code.
  • Appropriate external documentation (ReadTheDocs) for new functionality has been added to the online documentation and checked in the preview.
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added.
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed.
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.).
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease).
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.).
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

@reneSchm reneSchm linked an issue Apr 7, 2026 that may be closed by this pull request
2 tasks
@reneSchm reneSchm added class::improvement Cleanup that doesn't affect functionality class::bug Bugs found in the software and removed class::improvement Cleanup that doesn't affect functionality labels Apr 7, 2026
@reneSchm reneSchm self-assigned this Apr 7, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.39%. Comparing base (20cee90) to head (47f20a9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1534      +/-   ##
==========================================
+ Coverage   97.38%   97.39%   +0.01%     
==========================================
  Files         188      188              
  Lines       16619    16621       +2     
==========================================
+ Hits        16184    16188       +4     
+ Misses        435      433       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@reneSchm
Copy link
Copy Markdown
Member Author

reneSchm commented Apr 8, 2026

Benchmarks run on HPDA. No significant changes observed.

Reference (main)
Running ./abm_benchmark
Run on (56 X 3700 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x56)
  L1 Instruction 32 KiB (x56)
  L2 Unified 1024 KiB (x56)
  L3 Unified 19712 KiB (x4)
Load Average: 1.37, 4.42, 2.44
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
----------------------------------------------------------------------------------
Benchmark                                        Time             CPU   Iterations
----------------------------------------------------------------------------------
abm_benchmark/abm_benchmark_50k               3714 ms         3712 ms            1
abm_benchmark/abm_benchmark_50k               3620 ms         3618 ms            1
abm_benchmark/abm_benchmark_50k               3640 ms         3638 ms            1
abm_benchmark/abm_benchmark_50k               3612 ms         3612 ms            1
abm_benchmark/abm_benchmark_50k               3609 ms         3609 ms            1
abm_benchmark/abm_benchmark_50k               3636 ms         3636 ms            1
abm_benchmark/abm_benchmark_50k               3609 ms         3609 ms            1
abm_benchmark/abm_benchmark_50k               3600 ms         3600 ms            1
abm_benchmark/abm_benchmark_50k               3629 ms         3629 ms            1
abm_benchmark/abm_benchmark_50k               3605 ms         3605 ms            1
abm_benchmark/abm_benchmark_50k_mean          3628 ms         3627 ms           10
abm_benchmark/abm_benchmark_50k_median        3616 ms         3615 ms           10
abm_benchmark/abm_benchmark_50k_stddev        33.3 ms         32.8 ms           10
abm_benchmark/abm_benchmark_50k_cv            0.92 %          0.90 %            10
abm_benchmark/abm_benchmark_100k              7944 ms         7943 ms            1
abm_benchmark/abm_benchmark_100k              7927 ms         7926 ms            1
abm_benchmark/abm_benchmark_100k              7930 ms         7930 ms            1
abm_benchmark/abm_benchmark_100k              7934 ms         7933 ms            1
abm_benchmark/abm_benchmark_100k              7958 ms         7957 ms            1
abm_benchmark/abm_benchmark_100k              7955 ms         7954 ms            1
abm_benchmark/abm_benchmark_100k              7952 ms         7951 ms            1
abm_benchmark/abm_benchmark_100k              7997 ms         7996 ms            1
abm_benchmark/abm_benchmark_100k              8008 ms         8007 ms            1
abm_benchmark/abm_benchmark_100k              7957 ms         7956 ms            1
abm_benchmark/abm_benchmark_100k_mean         7956 ms         7955 ms           10
abm_benchmark/abm_benchmark_100k_median       7953 ms         7953 ms           10
abm_benchmark/abm_benchmark_100k_stddev       27.0 ms         27.0 ms           10
abm_benchmark/abm_benchmark_100k_cv           0.34 %          0.34 %            10
abm_benchmark/abm_benchmark_200k             16577 ms        16576 ms            1
abm_benchmark/abm_benchmark_200k             16438 ms        16437 ms            1
abm_benchmark/abm_benchmark_200k             16599 ms        16597 ms            1
abm_benchmark/abm_benchmark_200k             16447 ms        16446 ms            1
abm_benchmark/abm_benchmark_200k             16413 ms        16411 ms            1
abm_benchmark/abm_benchmark_200k             16439 ms        16437 ms            1
abm_benchmark/abm_benchmark_200k             16438 ms        16436 ms            1
abm_benchmark/abm_benchmark_200k             16425 ms        16423 ms            1
abm_benchmark/abm_benchmark_200k             16587 ms        16585 ms            1
abm_benchmark/abm_benchmark_200k             16596 ms        16594 ms            1
abm_benchmark/abm_benchmark_200k_mean        16496 ms        16494 ms           10
abm_benchmark/abm_benchmark_200k_median      16443 ms        16441 ms           10
abm_benchmark/abm_benchmark_200k_stddev       81.4 ms         81.4 ms           10
abm_benchmark/abm_benchmark_200k_cv           0.49 %          0.49 %            10
Current branch
Running ./build/bin/abm_benchmark
Run on (56 X 3700 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x56)
  L1 Instruction 32 KiB (x56)
  L2 Unified 1024 KiB (x56)
  L3 Unified 19712 KiB (x4)
Load Average: 0.06, 0.02, 0.00
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
----------------------------------------------------------------------------------
Benchmark                                        Time             CPU   Iterations
----------------------------------------------------------------------------------
abm_benchmark/abm_benchmark_50k               3606 ms         3605 ms            1
abm_benchmark/abm_benchmark_50k               3574 ms         3574 ms            1
abm_benchmark/abm_benchmark_50k               3601 ms         3600 ms            1
abm_benchmark/abm_benchmark_50k               3597 ms         3596 ms            1
abm_benchmark/abm_benchmark_50k               3567 ms         3567 ms            1
abm_benchmark/abm_benchmark_50k               3567 ms         3566 ms            1
abm_benchmark/abm_benchmark_50k               3570 ms         3570 ms            1
abm_benchmark/abm_benchmark_50k               3574 ms         3574 ms            1
abm_benchmark/abm_benchmark_50k               3573 ms         3573 ms            1
abm_benchmark/abm_benchmark_50k               3575 ms         3575 ms            1
abm_benchmark/abm_benchmark_50k_mean          3580 ms         3580 ms           10
abm_benchmark/abm_benchmark_50k_median        3574 ms         3574 ms           10
abm_benchmark/abm_benchmark_50k_stddev        14.7 ms         14.7 ms           10
abm_benchmark/abm_benchmark_50k_cv            0.41 %          0.41 %            10
abm_benchmark/abm_benchmark_100k              7834 ms         7833 ms            1
abm_benchmark/abm_benchmark_100k              7841 ms         7841 ms            1
abm_benchmark/abm_benchmark_100k              7846 ms         7846 ms            1
abm_benchmark/abm_benchmark_100k              7855 ms         7854 ms            1
abm_benchmark/abm_benchmark_100k              7841 ms         7840 ms            1
abm_benchmark/abm_benchmark_100k              7849 ms         7849 ms            1
abm_benchmark/abm_benchmark_100k              7908 ms         7907 ms            1
abm_benchmark/abm_benchmark_100k              7834 ms         7833 ms            1
abm_benchmark/abm_benchmark_100k              7835 ms         7835 ms            1
abm_benchmark/abm_benchmark_100k              7837 ms         7837 ms            1
abm_benchmark/abm_benchmark_100k_mean         7848 ms         7847 ms           10
abm_benchmark/abm_benchmark_100k_median       7841 ms         7840 ms           10
abm_benchmark/abm_benchmark_100k_stddev       22.1 ms         22.1 ms           10
abm_benchmark/abm_benchmark_100k_cv           0.28 %          0.28 %            10
abm_benchmark/abm_benchmark_200k             16205 ms        16204 ms            1
abm_benchmark/abm_benchmark_200k             16359 ms        16357 ms            1
abm_benchmark/abm_benchmark_200k             16205 ms        16204 ms            1
abm_benchmark/abm_benchmark_200k             16207 ms        16206 ms            1
abm_benchmark/abm_benchmark_200k             16230 ms        16229 ms            1
abm_benchmark/abm_benchmark_200k             16226 ms        16225 ms            1
abm_benchmark/abm_benchmark_200k             16228 ms        16227 ms            1
abm_benchmark/abm_benchmark_200k             16213 ms        16212 ms            1
abm_benchmark/abm_benchmark_200k             16221 ms        16219 ms            1
abm_benchmark/abm_benchmark_200k             16192 ms        16190 ms            1
abm_benchmark/abm_benchmark_200k_mean        16229 ms        16227 ms           10
abm_benchmark/abm_benchmark_200k_median      16217 ms        16215 ms           10
abm_benchmark/abm_benchmark_200k_stddev       47.3 ms         47.2 ms           10
abm_benchmark/abm_benchmark_200k_cv           0.29 %          0.29 %            10

@reneSchm reneSchm requested a review from DavidKerkmann April 8, 2026 17:53
Copy link
Copy Markdown
Member

@DavidKerkmann DavidKerkmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

@DavidKerkmann DavidKerkmann merged commit 8f90ce7 into main Apr 9, 2026
58 checks passed
@DavidKerkmann DavidKerkmann deleted the 1400-the-abms-rng-is-not-used-after-initialization branch April 9, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

class::bug Bugs found in the software

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The ABM's RNG is not used after initialization

2 participants