Coder Social home page Coder Social logo

arporter / nemo-dsl Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 82 KB

Investigation into the use of Domain Specific Languages with the NEMO ocean model

License: BSD 2-Clause "Simplified" License

Fortran 95.12% Makefile 4.88%
domain-specific-language finite-difference fortran oceanography

nemo-dsl's People

Contributors

arporter avatar rupertford avatar smocavero avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

nemo-dsl's Issues

add metadata to the Kernels

We need to add metadata to the Kernels. This will be based on the gocean1.0 api metadata. However this metadata was designed for 2D fields so will need to be extended to support both 2D and 3D.

add invoke and a single psy call

To show what the algorithm code would look like, we should add a commented-out invoke call.
At the moment we are calling the manual PSy from the algorithm layer separately for each kernel. However, after transforming from an algorithm description using PSyclone we would end up with a single call into the psy layer. Therefore we should modify the code to do this.

Add timing to 'original' version

Silvia has committed the 'original' version of the tracer benchmark. In this issue we will add timing to this code using the dl_timer library.

Create a step-1 modified version

Andy and I have discussed ways in which we might migrate from existing NEMO code to something that is (arguably) more maintainable and supports OpenMP and OpenACC in a way that does not disturb the code too much and therefore has a chance of being adopted on the trunk. We need to discuss this further with Silvia but have not yet had the chance.

We think a good (first and possibly even final!) step would be to place all loops (and computation within them) in subroutines and to add appropriate descriptive metadata within these subroutines. This would separate the description of the algorithm from the loop bounds and array accesses allowing us to generate OpenMP and OpenACC solutions by modifying the subroutines (using a modified version of PSyclone) independently of the algorithm code. Note the generation idea needs to be proven as PSyclone does not currently support code in this form.

We would like to use this benchmark as a test case to prove the feasibility of this approach.

Changes following on from the initial psykal version created in #3

In #3, separate kernels were created for each loop in the original code. A few issues have arisen before the psykal version can be taken any further.

  1. Are we OK to move the zdt and zbtr scalars out of the algorithm later and into the associated Kernels? We can clearly do this as they are only scalars but Silvia had them at a higher level in the loops for some reason so I would like her thoughts first.

  2. Are we working towards a version that PSyclone can generate? The alternative is to explore ways in writing the psykal code that might be more amenable to the NEMO consortium? I lean to the former as it would be nice to be able to demonstrate something (at some point).

  3. I've introduced two builtins which set layer values. In order to do this they must pass the actual value of the layer. What I suggest is that we have a zero_top_layer() and a zero_bottom_layer() (and similarly for multiply) as these would be descriptive, explanatory and would remove the need for passing the layer value, which we need to move away from.

  4. We should remove the passing of jpk, jpk and jpi into the PSy layer from the algorithm layer as the algorithm layer is meant to work on whole fields and it also simplified the code. To do this in the short term I was going to set the values in the PSy layer directly from the algorithm layer. Are you OK with this, or is there a better way.

  5. Are people happy that I'm only looking at code with the iteration at the moment. I'm not sure how this will work if we decide to change to field objects but we can cross that bridge later.

  6. We already have an interesting issue emerging with the vertical dimension. The setting of top and bottom values means that we sometimes do not compute at the bottom layer and/or the top layer. I don't think this is anything to do with the Kernel code so I presume we will have to find a way to describe this at the algorithm layer!

  7. The zwx2_kern kernel code writes with a k+1 index. In PSylone we made a choice to always write to I,j,k to help us work out the correct loop bounds. Is there a problem in changing the code to conform to this choice?

OK, that's enough for the moment. Agreement on these questions will drive the next set of modifications to the psykal version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.