Runtime checks for function space IDs on fields on ANY_SPACE passed to kernels
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by tracing built-in metadata parsing and PSy-layer generation, then compare the checks shown in the linked LFRic psykal_lite_mod example. Follow the RUN_TIME_CHECKS option and identify how function-space IDs are available for fields passed to ANY_SPACE_n kernels. Done means generated code detects mismatched spaces when enabled and avoids those checks when disabled, with corresponding tests.
Written by the indexing model from the issue text.
Description
We currently do not check that function space IDs of the fields defined as ANY_SPACE_n in the kernel metadata are indeed on the same space.
One such example are built-ins. We check for the function spaces when parsing built-ins metadata (definition file in PSyclone). However, we currently do not generate PSy-layer code that would check the function space IDs of fields passed to built-in kernels. This leads to out-of-bounds errors in LFRic in full debug.
The examples of runtime function space ID checks can be found in LFRic psykal_lite_mod
!sanity check
undf = field1_proxy%vspace%get_undf()
if(undf /= field2_proxy%vspace%get_undf() ) then
! they are not on the same function space
call log_event("PSy:multiply_field_data:field1 and field2 live on different w-spaces" &
, LOG_LEVEL_ERROR)
!abort
stop
endif
if(undf /= field_res_proxy%vspace%get_undf() ) then
! they are not on the same function space
call log_event("PSy:multiply_field_data:field1 and result_field live on different w-spaces" &
, LOG_LEVEL_ERROR)
!abort
stop
endif
These checks can be turned off or on via the RUN_TIME_CHECKS option.
- Dominant language
- Python
- Stars
- 137
- Forks
- 36
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 18
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stfc/PSyclone
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
frontend: add support for ALOG, ALOG10 and IDInt intrinsics. Specify FLOAT as available on GPU. Openenhancement PSyIR
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
NEMO
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100