-
Notifications
You must be signed in to change notification settings - Fork 91
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
Request: Speed up the uniform mesh converter #991
Comments
Can we at least run the operation through the profiler first to see exactly what the slow bottlenecks are with precision instrumentation? Then we can see if there's any superlow hanging fruit before parallelizing. |
Yes, a very good idea! This was just based on the keckler-profiler, aka my eyeballs looking at the exploding runtimes. |
I did this months ago but didn'tseem to write it down. It is slow on getting and setting number densities for each block in the core. I feel like this suggestion keeps getting made. @john-science did timing tests of this already a couple months ago too. See: #721 |
It looks like the uniform mesh converter may be getting a proper overhaul in the near future, so if this is implemented, it should be a part of that larger work. |
A good process for speeding up code goes something like:
It is not appropriate to say "we need to parallelize this code" before you've done any work to improve it's performance. |
Also, and not for nothing, you want to parallelize the uniform mesh converter? Even though the ARMI model is already run in parallel? You can't spawn parallel code INSIDE code that's already parallel. Is the uniform mesh converter run outside the already parallel code in the ARMI interface loop? |
I'm still experimenting with the profiler, but here are some preliminary results. I ran a script that loads up a reactor, does a uniform mesh conversion and then de-conversion. 50% of the overall run time is spent in I don't think we really need a Note: This was a small test reactor; the proportion of run time in each function call might change when we run on a full-size model. |
I implemented a method for instantiating a new block that's much lighter than a In a test case where The expensive line is this one, which walks through all of the parameters defined in the collection and performs a string comparison to the
I think we can cut run time down by at least an order of magnitude if this can be converted to a hashed lookup. I opened #1039 to track developments on that front. |
Great progress @mgjarrett ! Removing a Also, I like that you found one line that was costing a huge portion of the run time. You'd be surprised how often that's true. You're burying the lead though. I've always here it was the number densities that were the slowest part of ARMI, specifically the meshing. So... you did an actual profile and found otherwise. That's great! Way to use analytical data, instead of just trusting the standard wisdom. You rock. |
The uniform mesh converter can sometimes take a very long time. However the majority of what it does is loop over all the assemblies in the core and assign parameters back and forth between blocks.
Calls to
setAssemblyStateFromOverlaps
are all completely independent and could benefit from parallel execution. Based on looking at the uniform mesh generator, this should cover the majority of the work in that class and I think could speed up the conversion process a ton.The text was updated successfully, but these errors were encountered: