ClimaCore.jl icon indicating copy to clipboard operation
ClimaCore.jl copied to clipboard

`DataLayouts` F Dimension Constructor Checks

Open jb-mackay opened this issue 2 years ago • 8 comments

Adds F dimension checks on backing data arrays for DataLayouts. See #664

jb-mackay avatar Apr 14 '22 17:04 jb-mackay

  • [x] VF
  • [x] IF
  • [x] IFH
  • [x] IJF
  • [x] IJFH
  • [x] VIFH
  • [x] VIJFH
  • [x] IJKFVH

jb-mackay avatar Apr 14 '22 17:04 jb-mackay

@simonbyrne is this all sensible?

jb-mackay avatar Apr 14 '22 18:04 jb-mackay

https://github.com/CliMA/ClimaCore.jl/blob/5540fc43fc00819d0c21fdbb102d9986191dd2a4/test/DataLayouts/data1d.jl#L114-L117

This does not make sense - data1 and data2 are arrays, not VF structs which we are testing. The code without @test_prop errors. They should be replaced with dl1, dl2(?), which then fail the JET tests and also error on the mapping functions.

jb-mackay avatar Apr 14 '22 18:04 jb-mackay

@sriharshakandala would you be able to help me understand/debug the errors now in dss_2d!?

jb-mackay avatar Apr 15 '22 17:04 jb-mackay

Can you figure out why the test is failing?

simonbyrne avatar Apr 15 '22 18:04 simonbyrne

@sriharshakandala would you be able to help me understand/debug the errors now in dss_2d!?

DSS buffer sizing can be different from the number of fields. The sizing is conservative and typically determined based on maximum number of fields being dss'd in a given simulation. When building the spectral element space, we are dss'g the jacobian, which is a length 1 field. But, the buffer is sized for maximum number of fields that will be dss'd at a time in the simulation.

sriharshakandala avatar Apr 15 '22 18:04 sriharshakandala

Maybe change the assertions to inequalities?

simonbyrne avatar Apr 15 '22 19:04 simonbyrne

Maybe change the assertions to inequalities?

It seems like the info necessary to compute a conservative upper bound aren't really accessible at the DataLayout level. I'm inclined to close this PR and leave things as is.

jb-mackay avatar Apr 15 '22 22:04 jb-mackay