🌊 Fast and friendly ocean-flavored Julia software for simulating incompressible fluid dynamics in Cartesian and spherical shell domains on CPUs and GPUs. https://clima.github.io/OceananigansDocumentation/stable
Oceananigans is a fast, friendly, flexible software package for finite volume simulations of the nonhydrostatic and hydrostatic Boussinesq equations on CPUs and GPUs. It runs on GPUs (wow, fast!), though we believe Oceananigans makes the biggest waves with its ultra-flexible user interface that makes simple simulations easy, and complex, creative simulations possible.
Oceananigans.jl is developed by the Climate Modeling Alliance and heroic external collaborators.
- Installation instructions
- Running your first model
- The Oceananigans knowledge base
- Citing
- Contributing
- Movies
- Performance benchmarks
Oceananigans is a registered Julia package. So to install it,
-
Launch Julia and type
julia> using Pkg
julia> Pkg.add("Oceananigans")
This installs the latest version that's compatible with your current environment. Don't forget to be careful 🏄 and check which Oceananigans you installed:
julia> Pkg.status("Oceananigans")
Let's run a two-dimensional, horizontally-periodic simulation of turbulence using 128² finite volume cells for 4 non-dimensional time units:
using Oceananigans
grid = RectilinearGrid(CPU(), size=(128, 128), x=(0, 2π), y=(0, 2π), topology=(Periodic, Periodic, Flat))
model = NonhydrostaticModel(; grid, advection=WENO5())
ϵ(x, y, z) = 2rand() - 1
set!(model, u=ϵ, v=ϵ)
simulation = Simulation(model; Δt=0.01, stop_time=4)
run!(simulation)
But there's more: changing CPU()
to GPU()
makes this code on a CUDA-enabled Nvidia GPU.
Dive into the documentation for more code examples and tutorials. Below, you'll find movies from GPU simulations along with CPU and GPU performance benchmarks.
It's deep and includes:
-
Documentation that provides
- example Oceananigans scripts,
- tutorials that describe key Oceananigans objects and functions,
- explanations of Oceananigans finite-volume-based numerical methods,
- details of the dynamical equations solved by Oceananigans models, and
- a library documenting all user-facing Oceananigans objects and functions.
-
Discussions on the Oceananigans github, covering topics like
- "Computational science", or how to science and set up numerical simulations in Oceananigans, and
- "Experimental features", which covers new and sparsely-documented features for those who like to live dangerously.
If you've got a question or something, anything! to talk about, don't hestitate to start a new discussion.
-
The Oceananigans wiki contains practical tips for getting started with Julia, accessing and using GPUs, and productive workflows when using Oceananigans.
-
The
#oceananigans
channel on the Julia Slack, which accesses "institutional knowledge" stored in the minds of the amazing Oceananigans community. -
Issues and pull requests also contain lots of information about problems we've found, solutions we're trying to implement, and dreams we're dreaming to make tomorrow better 🌈.
If you use Oceananigans.jl as part of your research, teaching, or other activities, we would be grateful if you could cite our work and mention Oceananigans.jl by name.
@article{OceananigansJOSS,
doi = {10.21105/joss.02018},
url = {https://doi.org/10.21105/joss.02018},
year = {2020},
publisher = {The Open Journal},
volume = {5},
number = {53},
pages = {2018},
author = {Ali Ramadhan and Gregory LeClaire Wagner and Chris Hill and Jean-Michel Campin and Valentin Churavy and Tim Besard and Andre Souza and Alan Edelman and Raffaele Ferrari and John Marshall},
title = {Oceananigans.jl: Fast and friendly geophysical fluid dynamics on GPUs},
journal = {Journal of Open Source Software}
}
We also maintain a list of publication using Oceananigans.jl. If you have work using Oceananigans.jl that you would like to have listed there, please open a pull request to add it or let us know!
If you're interested in contributing to the development of Oceananigans we want your help no matter how big or small a contribution you make! Cause we're all in this together.
If you'd like to work on a new feature, or if you're new to open source and want to crowd-source neat projects that fit your interests, you should start a discussion right away.
For more information check out our contributor's guide.
We've performed some preliminary performance benchmarks (see the performance benchmarks section of the documentation) by initializing models of various sizes and measuring the wall clock time taken per model iteration (or time step).
This is not really a fair comparison as we haven't parallelized across all the CPU's cores so we will revisit these benchmarks once Oceananigans.jl can run on multiple CPUs and GPUs.
To make full use of or fully saturate the computing power of a GPU such as an Nvidia Tesla V100 or a Titan V, the model should have around ~10 million grid points or more.
Sometimes counter-intuitively running with Float32
is slower than Float64
. This is likely due
to type mismatches causing slowdowns as floats have to be converted between 32-bit and 64-bit, an
issue that needs to be addressed meticulously. Due to other bottlenecks such as memory accesses and
GPU register pressure, Float32
models may not provide much of a speedup so the main benefit becomes
lower memory costs (by around a factor of 2).