PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

LFRic PSyIR Kernel Metadata support (closes #1806)

Open rupertford opened this issue 1 year ago • 2 comments

Raises generic PSyIR capturing an LFRic Kernel to LFRic-specific PSyIR with the metadata stored in a separate class for easy access, modification etc.

rupertford avatar Jul 20 '22 08:07 rupertford

todo 1) stencils for fields and field vectors 2) mesh_arg for intergrid args

rupertford avatar Aug 13 '22 23:08 rupertford

todo columnwise args may be assembly or matrix-matrix and these have different constraints on the type of arguments that are allowed. I'm not sure how to add this constraint at the moment. Should it be an additional argument to the initialisation or should it be a different argument type?

rupertford avatar Aug 13 '22 23:08 rupertford

Codecov Report

Base: 99.52% // Head: 99.52% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (655ac30) compared to base (68c2149). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1807    +/-   ##
========================================
  Coverage   99.52%   99.52%            
========================================
  Files         273      284    +11     
  Lines       39943    40592   +649     
========================================
+ Hits        39752    40401   +649     
  Misses        191      191            
Impacted Files Coverage Δ
src/psyclone/configuration.py 100.00% <100.00%> (ø)
...psyclone/domain/common/transformations/__init__.py 100.00% <100.00%> (ø)
...syclone/domain/common/transformations/alg_trans.py 100.00% <100.00%> (ø)
.../common/transformations/raise_psyir_2_alg_trans.py 100.00% <100.00%> (ø)
src/psyclone/domain/gocean/kernel/psyir.py 100.00% <100.00%> (ø)
...transformations/raise_psyir_2_gocean_kern_trans.py 100.00% <100.00%> (ø)
...one/domain/lfric/kernel/columnwise_operator_arg.py 100.00% <100.00%> (ø)
src/psyclone/domain/lfric/kernel/common_arg.py 100.00% <100.00%> (ø)
src/psyclone/domain/lfric/kernel/field_arg.py 100.00% <100.00%> (ø)
...c/psyclone/domain/lfric/kernel/field_vector_arg.py 100.00% <100.00%> (ø)
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Sep 04 '22 15:09 codecov[bot]

Ready for first review. Probably one for @arporter seeing as he reviewed the gocean kernel metadata PR. This PR does not add full support for the LFRic metadata so is only towards issue #1806. It still needs the remainder of the metadata to be parsed and for the type of kernel to be determined once the metadata is parsed. However, it is large enough as it is and has tackled the hardest problem - the parsing of meta_args.

rupertford avatar Sep 04 '22 20:09 rupertford

Added transformation to user guide.

rupertford avatar Sep 16 '22 20:09 rupertford

Ready for next review from @arporter

rupertford avatar Sep 16 '22 20:09 rupertford

When I asked for documentation I was hoping for something that explained what this functionality currently does and what it will ultimately do (perhaps in the developer guide). I don't understand why a lot of the code talks about PSyIR when it is in fact dealing in fparser2 parse trees?

arporter avatar Sep 20 '22 07:09 arporter

I've added some words to the developer guide.

rupertford avatar Sep 21 '22 13:09 rupertford

Ready for next review from @arporter I've had to comment out the building of LFRic example and tutorials as they were causing CI to fail even though they are OK locally. But there is plenty else to review.

rupertford avatar Sep 21 '22 14:09 rupertford

Ready for next review from @arporter

rupertford avatar Sep 26 '22 19:09 rupertford

On github actions the lfric eg12 example fails to load the PSyclone script with generator.py raising an exception. However, this works fine locally. I've not changed any code associated with this code so it is very strange. All filenames and values look fine. eg11 is run before eg12 and works OK. eg12 using the eg11 script works OK. It therefore looks like it is something to do with the name of the script or its content (unless something more strange is going on).

rupertford avatar Oct 03 '22 19:10 rupertford

Replacing the extract_nodes.py script with a simple test.py script works.

rupertford avatar Oct 03 '22 19:10 rupertford

Using extract_nodes.py which just writes out some text works OK. It therefore must be something in the script itself.

rupertford avatar Oct 03 '22 20:10 rupertford

It looks like it is the import of LFRicExtractTrans in the script.

rupertford avatar Oct 03 '22 20:10 rupertford

All of the offending imports have been from from psyclone.domain.lfric.transformations. I must have done something to stop the imports working from here in GHA.

rupertford avatar Oct 03 '22 22:10 rupertford

At last. Ready for next review from @arporter.

rupertford avatar Oct 04 '22 08:10 rupertford

Ready for next review from @arporter subject to GHA contentment.

rupertford avatar Oct 05 '22 00:10 rupertford