Make MAX_GHOSTS a compile-time flag#314
Conversation
|
I'm not a fan of using an environment variable for this. That moves the setting out of band with the normal cargo build sequence. How should a user know that it needs to be set if they have a dependency of a dependency on We talked about two options to solve this while you were out last week:
With regards to unit tests: Option 1 allows each individual test to set If you want to try option 1, please branch off I suppose it might be possible to rewrite |
Thanks for the feedback, these seem like good options. I am leaning toward option 1, but will have to see what the diff looks like when I try it. I will base the branch of md as requested! |
Description
Using a build script and a const fn that reads the environment variable, the max number of ghosts (arrayvec size) is now configurable. This is the first I've heard of build scripts, so please let me know if anything seems incorrect.
Motivation and context
Max ghosts for a cartesian space requires up to
N^2-1ghosts per particle, and in other space could require arbitrary counts. This PR makes the constant an environment variable, such that users can set the value as high as they need. This fixes things for users, but tests are still limited to the default setting right now (e.g. setting to 8 breaks the 12-12 boundary tests). We could fix this by configuring that env variable in CI, but I'm not sure the best way to do it for devs.How has this been tested?
Checklist:
doc/src/credits.md) in the pull request source branch.release-notes.mdfollowing the established format.