-
Notifications
You must be signed in to change notification settings - Fork 7
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
Break up parameters struct in CloudMicrophysics.jl 0, 1, 2 - moment microphysics schems #160
Comments
Hi @charleskawczynski - Thank you for taking a look. I don't think I full understand what you are suggesting. If I end up defining a couple of different structs would I end up having to pass different parameter structs inside CM.jl functions? Right now all the functions look like Would it turn into If yes, I think it would create too much friction with creating those different parametr sets and passing them in different fucntions. I would rather have everything in one place |
I suspect that we can use composition— are there subsets of parameters that cannot be used together? If so, then those incompatibilities outline the exchangeable parts. I think we do this in surface fluxes. |
What is the benefit of splitting it up? |
First example thanks to @sriharshakandala: #201 |
I think there’s two benefits, one is modularization, and the other is performance. Very large structs, as I understand it, are a performance issue. I think the reasoning is that the struct may not fit into registers, resulting in register spilling (hurting performance). We can benchmark to confirm, but it’s also probably just not a pattern that we want to use (or spread). |
Agreed. It was making things easy while developing CloudMicrophysics. Because you just had to pass in one struct everywhere and not think which parameter lives in which struct. But I agree that with 100+ parameters and on the way to add more thats just not sustainable |
This is done. I'll open a new issue to track the parameter struct updates in the remaining modules of the library |
The parameters (
CloudMicrophysics.jl/src/Parameters.jl
Line 16 in abec798
Tasks
The text was updated successfully, but these errors were encountered: