PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

[psyclone-kern, PSyAD] Add command-line flags to identify special kernel arguments

Open arporter opened this issue 2 years ago • 6 comments

Currently the psyclone-kern algorithm-generation functionality initialises every field argument that it finds to unity. However, LFRic kernels often have arguments that contain geometric information and this should be correctly set-up. (This is especially important for the adjoint test-harness generation functionality.) This will require command line arguments to specify which kernel arguments are 'special'. The two types of kernel argument identified so far are:

  1. The Chi field (containing coordinates);
  2. The 'face_id' field (maps from a cell to a face ID).

arporter avatar May 11 '22 08:05 arporter

Since the algorithm-generation functionality works with the kernel meta-data, the only way that a user can specify which arguments are 'special' is identify their position in the list of meta_args.

arporter avatar May 20 '22 13:05 arporter

I've made a start on this on branch 1708_specify_panel_id although I've realised that there's not much I can do until at least #1620 is merged.

arporter avatar May 20 '22 14:05 arporter

This issue has been resolved by the addition of API-specific information - the user no longer needs to identify special arguments.

arporter avatar Sep 09 '22 15:09 arporter

Unfortunately, I think I was wrong to close this. We still need to know which arguments to a kernel are 'special' otherwise we treat them all the same. In the PSyAD test harness this means that they get over-written with random data which is not what we want.

arporter avatar Sep 23 '22 13:09 arporter

This now produces a working* test harness for the vorticity kernel.

  • well, almost. There are some un-used variables declared in the adjoint kernel and the LFRic build system is configured to raise an error for those. If I manually remove them then all is fine.

arporter avatar Sep 30 '22 13:09 arporter

I've realised that what I have so far is only for psyad. I need to do psyclone-kern too.

arporter avatar Sep 30 '22 16:09 arporter