Gerris

Solver of partial differential equations used in fluid flow.

Introduction

Gerris is a software package designed to solve partial differential equations that arise in problems relating to fluid flow. It has a number of powerful algorithms for solving such problems and can be run and perform visualizations in parallel.

Using Gerris on RCC Resources

Gerris requires the use of the HPC SLURM job scheduler, explained here, in addition to a loaded module gerris. To run a job, we first need an example file from the tutorial, named vorticity.gfs:

1 2 GfsSimulation GfsBox GfsGEdge {} {
  GfsTime { end = 50 }
  GfsRefine 6
  GfsInit {} {
    U = (0.5 - rand()/(double)RAND_MAX)
    V = (0.5 - rand()/(double)RAND_MAX)
  }
}
GfsBox {}
1 1 right
1 1 top

Save this file to a test directory such as ~/gerris_test. We then need to create a simple SLURM script in this directory to submit our Gerris program to the SLURM job scheduler, named gerris.sub:

#!/bin/bash
#SBATCH -J gerris
#SBATCH -n 2
#SBATCH -p genacc_q
#SBATCH -t 00:10:00

module load gerris

mpirun -np 2 gerris2D -s 2 vorticity.gfs

In this script, we're running on two HPC nodes on the general access queue. We must load the gerris module, and we note that a specific setting, -s is in place for the Gerris program, which splits the domain into two subdomains that run in parallel. More details about command-line arguments in Gerris when running in parallel can be found here. Run this SLURM script using sbatch gerris.sub and once the job is completed, a file containing the results will be output into the ~/gerris_test directory.