Skip to content

Commit

Permalink
MOM_hor_visc: horizontal_viscosity loop reorder
Browse files Browse the repository at this point in the history
This patch reorders many of the loops in horizontal_viscosity in order
to improve vectorization of the Laplacian and biharmonic viscosities.

Specifically, a single loop containing many different computations were
broken up into many loops of individual operations.  This patch required
introduction of several new 2D arrays.

On Gaea's Broadwell CPUs (E5-2697 v4), this is a ~80% speedup on a
32x32x75 `benchmark` configuration.  Smaller speedups were observed on
AMD processors.

On the Gaea nodes, performance appears to be limited by the very large
number of variables in the function stack, and the high degree of stack
spill.  Further loop reordering may cause slowdowns unless the stack
usage is reduced.

No answers should be changed by this patch, but deserves extra scrutiny
given the fundamental role of this function in nearly all simulations.
  • Loading branch information
marshallward committed Jan 12, 2021
1 parent e68d31a commit 5c93def
Showing 1 changed file with 463 additions and 226 deletions.
Loading

0 comments on commit 5c93def

Please sign in to comment.