Open
Conversation
Make it consistent with get_microxs_and_flux
Remove energy_structure and backend params from GENDFLibrary. As elsewhere, energy is now auto-detected from the GENDF files. GENDF backend selection is automated. Changes to be committed: modified: openmc/deplete/coupled_operator.py modified: openmc/deplete/gendf.py modified: openmc/deplete/helpers.py modified: openmc/deplete/independent_operator.py modified: openmc/deplete/microxs.py modified: openmc/lib/gendf.py modified: tests/unit_tests/test_gendf_elis_mapping.py modified: tests/unit_tests/test_isomeric_branching_weighting.py modified: tools/add_gendf_isomeric_branching_to_chain.py
In __init__, filter fluxes, cross_sections, and _flux_with_energy to local materials only and remap _mat_index_map to local sequential indices. This reduces per-rank memory from O(all_materials) to O(local_materials). In _update_materials, replace the broadcast loop with local-only negative-density zeroing. Unlike CoupledOperator, IndependentOperator has no C library to synchronize material compositions with — the only required action is zeroing negative densities produced by CRAM. Works in and around the isomeric branching implementation.
the library's own energy structure (matching C++ backend API). Add _energy_validated flag to skip redundant np.allclose() on 1103-element arrays after the first successful validation.
The current per-reaction get_xs() loop generates ~35,000 KeyError exceptions per depletion step (most nuclides lack most reactions) and re-loads the GENDF material on each call. get_all_xs() loads the material once and returns only the reactions that exist, eliminating the exception overhead. _SparseXSTable stores only the non-zero (nuclide, reaction) XS as a contiguous (nnz, n_groups) matrix. This enables collapsing all XS in a single BLAS dgemv call instead of N_nuc × N_rxn individual dot products, and reduces memory from ~370 MB dense to ~44 MB sparse. Extract threshold alignment logic into _extract_xs() shared by get_xs() and get_all_xs(). C++ backend wrapper loops get_xs() per MT from a caller-provided list. _build_sparse_xs_table() builder assembles the table from get_all_xs() calls. Not yet wired into the depletion workflow. Changes to be committed: modified: openmc/deplete/gendf.py modified: openmc/deplete/microxs.py modified: openmc/lib/gendf.py
Replace the per-domain, per-nuclide, per-reaction get_xs() loop with a single _SparseXSTable build followed by vectorized matrix-vector collapse. Exploit domain-independence of GENDF cross-sections: extract XS once, collapse per domain via single BLAS dgemv instead of per-nuclide Python dot products. Eliminates D× redundant XS extraction. Reduces peak memory. In get_gendfxs_and_flux(), the previous code called from_multigroup_flux_with_gendf() D times (once per domain), each performing N_nuc × N_rxn individual get_xs() calls with try/except. GENDF cross-sections are domain-independent, so all D calls extracted identical data. The sparse table is now built once and reused for all domains, reducing D × N_nuc × N_rxn get_xs() calls to N_nuc get_all_xs() calls plus D BLAS dgemv collapses. In from_multigroup_flux_with_gendf(), the nested for-nuc/for-mt/try-except loop is replaced with _build_sparse_xs_table() + table.collapse(), giving single-domain callers the same vectorized path. This new workflow Update MockGENDFLibrary in test_gendf_nuclide_filtering.py to implement n_groups and get_all_xs() required by _build_sparse_xs_table(). Changes to be committed: modified: openmc/deplete/microxs.py modified: tests/unit_tests/test_gendf_nuclide_filtering.py Untracked files: tests/unit_tests/test_sparse_xs_table_validation.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update sync with latest development commits