MOM_domains module reference

Describes the decomposed MOM domain and has routines for communications across PEs

Functions/Subroutines

MOM_domains_init

MOM_domains_init initializes a MOM_domain_type variable, based on the information read in from a param_file_type, and optionally returns data describing various properties of the domain type.

MOM_define_layout

Given a global array size and a number of (logical) processors, provide a layout of the processors in the two directions where the total number of processors is the product of the two layouts and number of points in the partitioned arrays are as close as possible to an aspect ratio of 1.

gen_auto_mask_table

Given a desired number of active npes, generate a layout and mask_table

determine_land_blocks

Given a number of domain divisions, compute the max number of land blocks that can be eliminated, and return the resulting mask table if requested.

write_auto_mask_file

Write out the auto-generated mask information to a file in the run directory.

auto_determine_io_layout

Computes the io layout based on the domain layout and a target number of IO PEs.

Functions/Subroutine Documentation

subroutine MOM_domains_init(MOM_dom, param_file, symmetric, static_memory, NIHALO, NJHALO, NIGLOBAL, NJGLOBAL, NIPROC, NJPROC, min_halo, domain_name, include_name, param_suffix, US, MOM_dom_unmasked)

MOM_domains_init initializes a MOM_domain_type variable, based on the information read in from a param_file_type, and optionally returns data describing various properties of the domain type.

Parameters
  • MOM_dom

    A pointer to the MOM_domain_type being defined here.

  • param_file [in]

    A structure to parse for run-time parameters

  • symmetric [in]

    If present, this specifies whether this domain is symmetric, regardless of whether the macro SYMMETRIC_MEMORY_ is defined.

  • static_memory [in]

    If present and true, this domain type is set up for static memory and error checking of various input values is performed against those in the input file.

  • NIHALO [in]

    Default halo sizes, required with static memory.

  • NJHALO [in]

    Default halo sizes, required with static memory.

  • NIGLOBAL [in]

    Total domain sizes, required with static memory.

  • NJGLOBAL [in]

    Total domain sizes, required with static memory.

  • NIPROC [in]

    Processor counts, required with static memory.

  • NJPROC [in]

    Processor counts, required with static memory.

  • min_halo [inout]

    If present, this sets the minimum halo size for this domain in the i- and j- directions, and returns the actual halo size used.

  • domain_name [in]

    A name for this domain, "MOM" if missing.

  • include_name [in]

    A name for model's include file, "MOM_memory.h" if missing.

  • param_suffix [in]

    A suffix to apply to layout-specific parameters.

  • US

    A dimensional unit scaling type

  • MOM_dom_unmasked

    Unmasked MOM domain instance. Set to null if masking is not enabled.

Callees call graph
Callees of mom_domains::mom_domains_init calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_cpu_clock_infra MOM_cpu_clock_infra cluster_mom_domain_infra MOM_domain_infra cluster_mom_domains MOM_domains cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_file_parser MOM_file_parser cluster_mom_io_infra MOM_io_infra cluster_mom_string_functions MOM_string_functions mom_coms_infra::interface::broadcast broadcast (interface) mom_coms_infra::num_pes num_PEs mom_cpu_clock_infra::cpu_clock_begin cpu_clock_begin mom_cpu_clock_infra::cpu_clock_end cpu_clock_end mom_cpu_clock_infra::cpu_clock_id cpu_clock_id mom_domain_infra::create_mom_domain create_MOM_domain mom_domains::gen_auto_mask_table gen_auto_mask_table [private/internal] mom_domains::mom_define_layout MOM_define_layout mom_domains::mom_domains_init MOM_domains_init mom_domains::mom_domains_init->mom_coms_infra::interface::broadcast mom_domains::mom_domains_init->mom_coms_infra::num_pes mom_domains::mom_domains_init->mom_cpu_clock_infra::cpu_clock_begin mom_domains::mom_domains_init->mom_cpu_clock_infra::cpu_clock_end mom_domains::mom_domains_init->mom_cpu_clock_infra::cpu_clock_id mom_domains::mom_domains_init->mom_domain_infra::create_mom_domain mom_domains::mom_domains_init->mom_domains::gen_auto_mask_table mom_domains::mom_domains_init->mom_domains::mom_define_layout mom_error_handler::mom_error MOM_error mom_domains::mom_domains_init->mom_error_handler::mom_error mom_error_handler::mom_mesg MOM_mesg mom_domains::mom_domains_init->mom_error_handler::mom_mesg mom_error_infra::is_root_pe is_root_pe mom_domains::mom_domains_init->mom_error_infra::is_root_pe mom_file_parser::interface::get_param get_param (interface) mom_domains::mom_domains_init->mom_file_parser::interface::get_param mom_file_parser::interface::log_param log_param (interface) mom_domains::mom_domains_init->mom_file_parser::interface::log_param mom_file_parser::interface::log_version log_version (interface) mom_domains::mom_domains_init->mom_file_parser::interface::log_version mom_io_infra::interface::file_exists file_exists (interface) mom_domains::mom_domains_init->mom_io_infra::interface::file_exists mom_string_functions::slasher slasher mom_domains::mom_domains_init->mom_string_functions::slasher
Text view
Callers call graph
Callers of mom_domains::mom_domains_init calls cluster_mom MOM cluster_mom_domains MOM_domains cluster_mom_ice_shelf MOM_ice_shelf cluster_mom_oda_driver_mod MOM_oda_driver_mod mom::initialize_mom initialize_MOM mom_domains::mom_domains_init MOM_domains_init mom::initialize_mom->mom_domains::mom_domains_init mom_ice_shelf::initialize_ice_shelf initialize_ice_shelf mom_ice_shelf::initialize_ice_shelf->mom_domains::mom_domains_init mom_oda_driver_mod::init_oda init_oda mom_oda_driver_mod::init_oda->mom_domains::mom_domains_init
Text view
subroutine MOM_define_layout(n_global, ndivs, layout)

Given a global array size and a number of (logical) processors, provide a layout of the processors in the two directions where the total number of processors is the product of the two layouts and number of points in the partitioned arrays are as close as possible to an aspect ratio of 1.

Parameters
  • n_global [in]

    The total number of gridpoints in 2 directions

  • ndivs [in]

    The total number of (logical) PEs

  • layout [out]

    The generated layout of PEs

Callers call graph
Callers of mom_domains::mom_define_layout calls cluster_mom_domains MOM_domains mom_domains::gen_auto_mask_table gen_auto_mask_table [private/internal] mom_domains::mom_define_layout MOM_define_layout mom_domains::gen_auto_mask_table->mom_domains::mom_define_layout mom_domains::mom_domains_init MOM_domains_init mom_domains::mom_domains_init->mom_domains::mom_define_layout
Text view
subroutine gen_auto_mask_table(n_global, reentrant, tripolar_N, npes, param_file, inputdir, filename, target_io_pes, layout, io_layout, US)

Given a desired number of active npes, generate a layout and mask_table

Parameters
  • n_global [in]

    The total number of gridpoints in 2 directions

  • reentrant [in]

    True if the x- and y- directions are periodic.

  • tripolar_N [in]

    A flag indicating whether there is n. tripolar connectivity

  • npes [in]

    The desired number of active PEs.

  • param_file [in]

    A structure to parse for run-time parameters

  • inputdir [in]

    INPUTDIR parameter

  • filename [in]

    Mask table file path (to be auto-generated.)

  • target_io_pes [inout]

    Target number of IO PEs when auto_mask_table is True.

  • layout [out]

    The generated layout of PEs (incl. masked blocks)

  • io_layout [out]

    The generated IO layout based on target_io_pes.

  • US

    A dimensional unit scaling type

Callees call graph
Callees of mom_domains::gen_auto_mask_table calls cluster_mom_domains MOM_domains cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_file_parser MOM_file_parser cluster_mom_io_infra MOM_io_infra mom_domains::auto_determine_io_layout auto_determine_io_layout [private/internal] mom_domains::determine_land_blocks determine_land_blocks [private/internal] mom_domains::gen_auto_mask_table gen_auto_mask_table [private/internal] mom_domains::gen_auto_mask_table->mom_domains::auto_determine_io_layout mom_domains::gen_auto_mask_table->mom_domains::determine_land_blocks mom_domains::mom_define_layout MOM_define_layout mom_domains::gen_auto_mask_table->mom_domains::mom_define_layout mom_domains::write_auto_mask_file write_auto_mask_file [private/internal] mom_domains::gen_auto_mask_table->mom_domains::write_auto_mask_file mom_error_handler::mom_error MOM_error mom_domains::gen_auto_mask_table->mom_error_handler::mom_error mom_error_infra::is_root_pe is_root_pe mom_domains::gen_auto_mask_table->mom_error_infra::is_root_pe mom_file_parser::interface::get_param get_param (interface) mom_domains::gen_auto_mask_table->mom_file_parser::interface::get_param mom_io_infra::interface::file_exists file_exists (interface) mom_domains::gen_auto_mask_table->mom_io_infra::interface::file_exists mom_io_infra::interface::read_field read_field (interface) mom_domains::gen_auto_mask_table->mom_io_infra::interface::read_field
Text view
Callers call graph
Callers of mom_domains::gen_auto_mask_table calls cluster_mom_domains MOM_domains mom_domains::gen_auto_mask_table gen_auto_mask_table [private/internal] mom_domains::mom_domains_init MOM_domains_init mom_domains::mom_domains_init->mom_domains::gen_auto_mask_table
Text view
subroutine determine_land_blocks(mask, nx, ny, idiv, jdiv, ibuf, jbuf, num_masked_blocks, mask_table)

Given a number of domain divisions, compute the max number of land blocks that can be eliminated, and return the resulting mask table if requested.

Parameters
  • mask [in]

    cell masks based on depth and MINIMUM_DEPTH

  • nx [in]

    Total number of gridpoints in x-dir (global)

  • ny [in]

    Total number of gridpoints in y-dir (global)

  • idiv [in]

    number of divisions along x-dir

  • jdiv [in]

    number of divisions along y-dir

  • ibuf [in]

    number of buffer cells in x-dir. (not necessarily the same as NIHALO)

  • jbuf [in]

    number of buffer cells in y-dir. (not necessarily the same as NJHALO)

  • num_masked_blocks [out]

    the final number of masked blocks

  • mask_table [out]

    the resulting array of mask_table

  • ibegin

    The starting index of each division along x axis

  • iend

    The ending index of each division along x axis

  • jbegin

    The starting index of each division along y axis

  • jend

    The ending index of each division along y axis

Callees call graph
Callees of mom_domains::determine_land_blocks calls cluster_mom_domain_infra MOM_domain_infra cluster_mom_domains MOM_domains cluster_mom_error_handler MOM_error_handler mom_domain_infra::compute_extent compute_extent mom_domains::determine_land_blocks determine_land_blocks [private/internal] mom_domains::determine_land_blocks->mom_domain_infra::compute_extent mom_error_handler::mom_error MOM_error mom_domains::determine_land_blocks->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_domains::determine_land_blocks calls cluster_mom_domains MOM_domains mom_domains::determine_land_blocks determine_land_blocks [private/internal] mom_domains::gen_auto_mask_table gen_auto_mask_table [private/internal] mom_domains::gen_auto_mask_table->mom_domains::determine_land_blocks
Text view
subroutine write_auto_mask_file(mask_table, layout, npes, filename)

Write out the auto-generated mask information to a file in the run directory.

Parameters
  • mask_table [in]

    mask table array to be written out.

  • layout [in]

    PE layout

  • npes [in]

    Number of divisions (incl. eliminated ones)

  • filename [in]

    file name for the mask_table to be written

  • file_ascii

    The unit number of the auto-generated mask_file file.

Callees call graph
Callees of mom_domains::write_auto_mask_file calls cluster_mom_domains MOM_domains cluster_mom_io_infra MOM_io_infra mom_domains::write_auto_mask_file write_auto_mask_file [private/internal] mom_io_infra::interface::close_file close_file (interface) mom_domains::write_auto_mask_file->mom_io_infra::interface::close_file mom_io_infra::open_ascii_file open_ASCII_file mom_domains::write_auto_mask_file->mom_io_infra::open_ascii_file
Text view
Callers call graph
Callers of mom_domains::write_auto_mask_file calls cluster_mom_domains MOM_domains mom_domains::gen_auto_mask_table gen_auto_mask_table [private/internal] mom_domains::write_auto_mask_file write_auto_mask_file [private/internal] mom_domains::gen_auto_mask_table->mom_domains::write_auto_mask_file
Text view
function auto_determine_io_layout(idiv, jdiv, nio) result(best_io_layout)

Computes the io layout based on the domain layout and a target number of IO PEs.

Callees call graph
Callees of mom_domains::auto_determine_io_layout calls cluster_mom_domains MOM_domains cluster_mom_error_handler MOM_error_handler mom_domains::auto_determine_io_layout auto_determine_io_layout [private/internal] mom_error_handler::mom_error MOM_error mom_domains::auto_determine_io_layout->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_domains::auto_determine_io_layout calls cluster_mom_domains MOM_domains mom_domains::auto_determine_io_layout auto_determine_io_layout [private/internal] mom_domains::gen_auto_mask_table gen_auto_mask_table [private/internal] mom_domains::gen_auto_mask_table->mom_domains::auto_determine_io_layout
Text view
API generated with Flint · Rendered from reStructuredText