GithubHelp home page GithubHelp logo

pkestene / euler2d_cudafortran Goto Github PK

View Code? Open in Web Editor NEW
33.0 5.0 8.0 256 KB

2nd order Godunov solver for 2d Euler equations written in CUDA Fortran and stdpar (standard paralelism)

License: Other

Makefile 1.89% Fortran 92.85% CMake 5.26%
cuda-fortran fortran cuda gpu-computing gpu euler-equations conservation-laws hydrodynamics stdpar nvhpc

euler2d_cudafortran's Introduction

euler2d 350x350

euler2d_cudaFortran

2nd order Godunov solver for 2d Euler equations written in CUDA Fortran

Note: If your more interested into c++ for GPUs, have a look at version using C++/kokkos for performance portability: https://github.com/pkestene/euler2d_kokkos

Short description

This code solves the 2D Euler equations in a regular cartesian mesh using a 2nd order godunov-based finite volume scheme.

There are actually two version, one is using the so called cuda fortran programming model, and the other is designed with the newer fortran standard parallelism (stdpar).

Nvhpc compiler for Cuda Fortran and stdpar

You need to have installed [nvhpc] to build this application. then, e.g

module load nvhpc/23.11

By default, nvfortran will detect visible GPU available on the system, and generate code for it.

# for the cuda fortran version
cd cuf
make
# for the stdpar version
cd stdpar
make

Parameter file

Parameters: edit file test.nml

In the cuf version, there are two differents variants of the numerical scheme which are different in term of allocated memory. Use parameter implementationVersion = 0 or 1 to change.

Initial condition: a discontinuity along the domain diagonal

Example of use

./euler2d_gpu ./test.nml

Output: VTK ascii file using VTK Image Data format

Visualization: paraview --data=euler2d_..vti

The cuf version was written in 2013 (with the PGI compiler), and the stdpar version in 2022.

In terms of performance,

  • stdpar version is able to run at more than 500 Mcell-updates per seconds on A100, using large domain (2048x2048).
  • cuda-fortran version has roughly the same performance (maybe slightly less performant).

euler2d_cudafortran's People

Contributors

pkestene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.