PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

DoF kern code generation checklist

Open oakleybrunt opened this issue 1 year ago • 2 comments

Towards #1351

This is a checklist of features that DoF kernel code generation needs.

Loop

~~Question - should dof kerns have a different loop upper_bound_name? This would distinguish them from builtin loops (maybe not wanted) but would allow for less conditional branching in the setting of upper_bound.~~

  • [x] Loop type "dof" should use 'df' name and 'dof_loop_idx' tag - LFRicKernCallFactory & LFRicLoop
  • [x] Loop stop is currently f1_proxy%vspace%get_ncell() but should be the undf_name belonging to the function space. Since there is only one FS allowed, this should work fine.
  • [x] When generating ubound for dof loop with dist mem, piggy-back off the LFRicBuiltin checks to set the upper loop bound.

Kernel call

  • [x] Do not include dofmap (map_FS(:,cell))
  • [x] Fields in kernel call must access by index the current dof in the loop (f1_data(df))

Declarations

  • [x] ~~Potentially remove FS name from undf because there should only ever be one FS for dof kerns~~ ^ Above introduces more conditionals which seem unnecessary. Most egregious is having a property of FunctionSpace class that returns just 'undf' and then finding all instances where 'undf_name' property is accessed and adding a conditional check for a dof kernel. Unfortunately, this seems like the only way to do it since the FunctionSpace class does not have access to the kernel it belongs to, and therefore cannot determine if said kernel is a dof kern.

oakleybrunt avatar Sep 16 '24 12:09 oakleybrunt

Just a note for the future: there's no need to open an Issue 'towards' another Issue :-) Just add to the existing Issue. It is then the PR that is 'towards' that existing Issue.

arporter avatar Sep 20 '24 08:09 arporter

Noted, thanks :)

oakleybrunt avatar Sep 20 '24 09:09 oakleybrunt