-
Notifications
You must be signed in to change notification settings - Fork 28
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
[LFRic] New builtin to initialise operators with pseudo-random data #2001
Comments
As mentioned in #1864 I've rather brutally hacked my way to a solution. The major things that I've done that I'm not sure about are:
It's the last one that I'm particularly uneasy about. Ideally I'd change the validation to only permit this combination for builtin kernels but at the point the validation is performed we don't know that we have a builtin kernel (because the same code is used for both user-supplied and builtin kernels). The alternative is to have the new builtin generate the correct looping structure to visit all elements of the |
If a 'user' (really a developer) was to implement a new builtin that modified a field but operated on the 'domain' then we almost certainly wouldn't do the right thing with the halos. My gut feeling is to try and implement a nested loop for the new builtin rather than have it operate on the domain. What do @TeranIvy and @rupertford think? |
A much simpler solution (which I used some time ago) is to have a 'user-supplied' kernel that does the job. This has the big advantage that we don't have to change any code. The disadvantage is that it adds a bit more complexity to the build system for a mini-app that uses it (unless we make it a standard LFRic kernel??). I'm currently favouring this solution as the whole 'domain' kernel concept was originally supposed to just be a workaround for i-first kernels that contain their own OMP parallelisation. |
Thanks very much for the pointer @TeranIvy. In this case and in the e.g. in #1099 the kernel needs to operate on CELL_COLUMNS I think because the operator is declared as |
Am closing this for now as the immediate requirement is satisfied. |
The adjoint test-harness generation requires that operators be initialised with pseudo-random numbers. We already have
setval_random
for fields, this needs extending to operators.The text was updated successfully, but these errors were encountered: