SES3D Setup Assistant

This is a simple script that assists you in determining optimal SES3D settings. To use it just pass the approximate number of elements and the size of the simulation domain.

$ python -m lasif.scripts.ses3d_setup_helper --help
usage: python -m lasif.scripts.ses3d_setup_helper [-h]
                                                  [--recommendations RECOMMENDATIONS]
                                                  dx dy dz nx ny nz

Script assisting in determining suitable SES3D settings.

positional arguments:
  dx                    latitudinal extent in degrees
  dy                    longitudinal extent in degrees
  dz                    depth extent in km
  nx                    ~ element count in latitudinal dir. Same as nx_global.
  ny                    ~ element count in longitudinal dir. Same as
  nz                    ~ element count in depth dir. Same as nz_global.

optional arguments:
  -h, --help            show this help message and exit
  --recommendations RECOMMENDATIONS
                        number of recommendations to provide

Exemplary output is

$ python -m lasif.scripts.ses3d_setup_helper 30 47 1171 108 168 64
SES3D Setup Assistant

All calculations are done quick and dirty so take them with a grain of salt.

Possible recommended domain decompositions:

Total CPU count:  1344; CPUs in X:  12 ( 9 elements/core), CPUs in Y:  14 (12 elements/core), CPUs in Z:   8 ( 8 elements/core)
  Extent in latitudinal  (X) direction:  3339.6 km,  27.8 km/element,  120 elements
  Extent in longitudinal (Y) direction:  5232.0 km,  28.7 km/element,  182 elements
  Extent in depth        (Z) direction:  1171.0 km,  16.3 km/element,   72 elements

Internal Function Documentation

Script assisting in determining suitable SES3D settings.

copyright:Lion Krischer (, 2015
license:GNU General Public License, Version 3 (

Get all divisors for a certain number.

Parameters:number (int) – The number for which to get divisors.

Adapted from

lasif.scripts.ses3d_setup_helper.get_domain_decompositions(nx, ny, nz, max_recommendations=5)[source]

Attempt to get reasonable domain decomposition recommendations.

  • nx (int) – Elements in x direction.
  • ny (int) – Elements in y direction.
  • nz (int) – Elements in z direction.
  • max_recommendations (int) – The maximum number of recommendations to return.

Get prime factors and their multiplicity.

Parameters:number (int) – The number for which to get factors and multiplicity.

Adapted from


Gets all prime numbers 2 <= x <= number.

Parameters:number (int) – The maximum number for which to generate primes.

Adapted from