MOM_write_cputime module reference

A module to monitor the overall CPU time used by MOM6 and project when to stop the model

Data Types

write_cputime_CS

The number of ticks per second, used by the system clock

Functions/Subroutines

write_cputime_start_clock

Evaluate the CPU time returned by SYSTEM_CLOCK at the start of a run

MOM_write_cputime_init

Initialize the MOM_write_cputime module.

MOM_write_cputime_end

Close the MOM_write_cputime module.

write_cputime

This subroutine assesses how much CPU time the model has taken and determines how long the model should be run before it saves a restart file and stops itself. Optionally this may also be used to trigger this module's end routine.

Detailed Description

By Robert Hallberg, May 2006.

This file contains the subroutine (write_cputime) that writes the summed CPU time across all processors to an output file. In addition, write_cputime estimates how many more time steps can be taken before 95% of the available CPU time is used, so that the model can be checkpointed at that time.

Type Documentation

type, public :: write_cputime_CS

The number of ticks per second, used by the system clock

A control structure that regulates the writing of CPU time

Parameters
  • initialized

    True if this control structure has been initialized.

  • maxcpu

    The maximum amount of CPU time per processor for which MOM should run before saving a restart file and quitting with a return value that indicates that further execution is required to complete the simulation [wall-clock seconds].

  • Start_time

    The start time of the simulation. Start_time is set in MOM_initialization.F90

  • startup_cputime

    The CPU time used in the startup phase of the model [clock_cycles].

  • prev_cputime

    The last measured CPU time [clock_cycles].

  • dn_dcpu_min

    The minimum derivative of timestep with CPU time [steps clock_cycles-1].

  • cputime2

    The accumulated CPU time [clock_cycles].

  • previous_calls

    The number of times write_CPUtime has been called.

  • prev_n

    The value of n from the last call.

  • fileCPU_ascii

    The unit number of the CPU time file.

  • CPUfile

    The name of the CPU time file.

Functions/Subroutine Documentation

subroutine write_cputime_start_clock(CS)

Evaluate the CPU time returned by SYSTEM_CLOCK at the start of a run

Parameters
  • CS

    The control structure set up by a previous call to MOM_write_cputime_init.

Callers call graph
Callers of mom_write_cputime::write_cputime_start_clock calls cluster_External External cluster_mom_write_cputime MOM_write_cputime External::mom6 MOM6 mom_write_cputime::write_cputime_start_clock write_cputime_start_clock External::mom6->mom_write_cputime::write_cputime_start_clock
Text view
subroutine MOM_write_cputime_init(param_file, directory, Input_start_time, CS)

Initialize the MOM_write_cputime module.

Parameters
  • param_file [in]

    A structure to parse for run-time parameters

  • directory [in]

    The directory where the CPU time file goes.

  • Input_start_time [in]

    The start model time of the simulation.

  • CS

    A pointer that may be set to point to the control structure for this module.

Callees call graph
Callees of mom_write_cputime::mom_write_cputime_init calls cluster_mom_file_parser MOM_file_parser cluster_mom_write_cputime MOM_write_cputime mom_file_parser::interface::get_param get_param (interface) mom_file_parser::interface::log_param log_param (interface) mom_file_parser::interface::log_version log_version (interface) mom_write_cputime::mom_write_cputime_init MOM_write_cputime_init mom_write_cputime::mom_write_cputime_init->mom_file_parser::interface::get_param mom_write_cputime::mom_write_cputime_init->mom_file_parser::interface::log_param mom_write_cputime::mom_write_cputime_init->mom_file_parser::interface::log_version
Text view
Callers call graph
Callers of mom_write_cputime::mom_write_cputime_init calls cluster_External External cluster_mom_write_cputime MOM_write_cputime External::mom6 MOM6 mom_write_cputime::mom_write_cputime_init MOM_write_cputime_init External::mom6->mom_write_cputime::mom_write_cputime_init
Text view
subroutine MOM_write_cputime_end(CS)

Close the MOM_write_cputime module.

Parameters
  • CS

    The control structure set up by a previous call to MOM_write_cputime_init.

Callees call graph
Callees of mom_write_cputime::mom_write_cputime_end calls cluster_mom_error_infra MOM_error_infra cluster_mom_io_infra MOM_io_infra cluster_mom_write_cputime MOM_write_cputime mom_error_infra::is_root_pe is_root_pe mom_io_infra::interface::close_file close_file (interface) mom_write_cputime::mom_write_cputime_end MOM_write_cputime_end mom_write_cputime::mom_write_cputime_end->mom_error_infra::is_root_pe mom_write_cputime::mom_write_cputime_end->mom_io_infra::interface::close_file
Text view
Callers call graph
Callers of mom_write_cputime::mom_write_cputime_end calls cluster_mom_write_cputime MOM_write_cputime mom_write_cputime::mom_write_cputime_end MOM_write_cputime_end mom_write_cputime::write_cputime write_cputime mom_write_cputime::write_cputime->mom_write_cputime::mom_write_cputime_end
Text view
subroutine write_cputime(day, n, CS, nmax, call_end)

This subroutine assesses how much CPU time the model has taken and determines how long the model should be run before it saves a restart file and stops itself. Optionally this may also be used to trigger this module's end routine.

Parameters
  • day [inout]

    The current model time.

  • n [in]

    The time step number of the current execution.

  • CS

    The control structure set up by a previous call to MOM_write_cputime_init.

  • nmax [inout]

    The number of iterations after which to stop so that the simulation will not run out of CPU time.

  • call_end [in]

    If true, also call MOM_write_cputime_end.

Callees call graph
Callees of mom_write_cputime::write_cputime calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io_infra MOM_io_infra cluster_mom_write_cputime MOM_write_cputime mom_coms_infra::interface::sum_across_pes sum_across_PEs (interface) mom_coms_infra::num_pes num_PEs mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io_infra::open_ascii_file open_ASCII_file mom_write_cputime::mom_write_cputime_end MOM_write_cputime_end mom_write_cputime::write_cputime write_cputime mom_write_cputime::write_cputime->mom_coms_infra::interface::sum_across_pes mom_write_cputime::write_cputime->mom_coms_infra::num_pes mom_write_cputime::write_cputime->mom_error_handler::mom_error mom_write_cputime::write_cputime->mom_error_infra::is_root_pe mom_write_cputime::write_cputime->mom_io_infra::open_ascii_file mom_write_cputime::write_cputime->mom_write_cputime::mom_write_cputime_end
Text view
Callers call graph
Callers of mom_write_cputime::write_cputime calls cluster_External External cluster_mom_write_cputime MOM_write_cputime External::mom6 MOM6 mom_write_cputime::write_cputime write_cputime External::mom6->mom_write_cputime::write_cputime
Text view

External calls

time_manager_mod
  • get_time (time_manager_mod::get_time)

API generated with Flint · Rendered from reStructuredText