Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new loadMinimalTestReactor() test method #1563

Open
john-science opened this issue Dec 20, 2023 · 2 comments
Open

Add new loadMinimalTestReactor() test method #1563

john-science opened this issue Dec 20, 2023 · 2 comments
Labels
help wanted Extra attention is needed optimization related to measuring and speeding up the code or reducing memory testing Related to tests

Comments

@john-science
Copy link
Member

Our current function to create a reactor for unit tests is widely used in ARMI and the ARMI ecosystem:

https://github.com/terrapower/armi/blob/main/armi/reactor/tests/test_reactors.py#L139-L143

However, it loads a full reactor and is this rather slow if you are using it in thousands of unit tests. That's why we have this helper method:

https://github.com/terrapower/armi/blob/main/armi/reactor/tests/test_reactors.py#L203

It reduces the size of the reactor. Which doesn't speed up the "loading" part of the unit test, but it does make a smaller reactor, which makes many unit tests faster.

What would be nice is if we had a new, faster function to generate a test reactor; something like loadMinimalTestReactor(). The idea is that it would generate a simple one-assembly reactor core, with only one block, and one parameter. And it would be even better if you could pass it a number of assemblies, blocks-per-assembly, and number of parameters.

The goal is to make loading times faster. But, also, the goal would be to replace as many full loadTestReactor() tests as possible with the new, faster version.

@john-science john-science added help wanted Extra attention is needed testing Related to tests optimization related to measuring and speeding up the code or reducing memory labels Dec 20, 2023
@albeanth
Copy link
Member

I think pickle was employed at one point to try and help mitigate this issue. In my experience though this doesn't seem to help much. Not saying it doesn't work, just that I haven't seen it leveraged much first hand.

if isPickeledReactor and TEST_REACTOR:

@john-science
Copy link
Member Author

I think pickle was employed at one point to try and help mitigate this issue...

Yeah, but that can only help with LOAD times. If people are running complicated code on the reactor core, say running it through the interface stack for a whole cycle, then the RUN time of that code depends on the size and complexity of the reactor core model.

That's my idea, anyway. Caveat emptor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed optimization related to measuring and speeding up the code or reducing memory testing Related to tests
Projects
None yet
Development

No branches or pull requests

2 participants