A family of ready-made quoted expressions for the statusCalculate argument of experimentTmux() and experimentFuture(). Pass one of these objects directly instead of writing a custom quote({...}) block:

experimentTmux(..., statusCalculate = statusCalculate_LandR)

Each expression is evaluated once per queue row inside tmuxRefreshQueueStatus(). Before evaluation the row's non-meta columns are unpacked into the local environment by name, as are any objects forwarded through .... The expression may assign to any subset of the recognised meta-column names (started_at, finished_at, heartbeat_at, heartbeat_iter, iterationsTotal, …) and should set done <- TRUE to signal that the job has completed.

statusCalculate_FireSenseFit

statusCalculate_LandR

Format

A base::quote()d block expression (is.call(statusCalculate_FireSenseFit) is TRUE).

A base::quote()d block expression (is.call(statusCalculate_LandR) is TRUE).

Functions

  • statusCalculate_FireSenseFit: Heartbeat calculator for fireSense fire-spread simulations.

    Scans the job's output directory for burnMap_year<XXXX>.tif files and "Annual Fire Maps" output files to populate the queue meta-columns:

    heartbeat_iter

    Most recent fire-map year found after the worker claimed the job, or times$start if none yet.

    heartbeat_at

    Modification timestamp of that file (NA until the first fire-map appears).

    started_at

    Modification timestamp of the running-flag file (i.e. when the worker claimed the job).

    done

    TRUE when a burnMap file containing year<times$end> is found.

    finished_at

    Timestamp of the final-year burnMap (set only when done).

    iterationsTotal

    The end year extracted from the burnMap filename (set only when done).

  • statusCalculate_LandR: Heartbeat calculator for LandR vegetation simulations.

    Scans the job's output directory for cohortData_year<XXXX>.rds checkpoint files (written at each SpaDES save event) and maps them to the standard queue meta-columns:

    heartbeat_iter

    Current simulation year reached (character).

    heartbeat_at

    Timestamp of the latest checkpoint file.

    started_at

    Timestamp of the earliest checkpoint file (may be refined later by the running-flag-file logic in tmuxRefreshQueueStatus()).

    done

    Set to TRUE when heartbeat_iter >= outs$times$end, triggering a status transition to DONE.

    finished_at

    Timestamp of the final checkpoint (set only when done).

    iterationsTotal

    The end year as a character string (set only when done).

Variables required in scope

The expressions below expect the following to be available, either as queue-data-frame columns or as named objects in the ... passed to tmuxRefreshQueueStatus():

pathBuild

A function whose arguments match the queue columns used to construct the output-directory path. For statusCalculate_LandR the call is pathBuild(.ELFind, .samplingRange, .GCM, .SSP, .rep).

outs

A list (typically stored in dots_path and loaded into the worker's environment before global.R is sourced) whose element outs$times$end gives the simulation end year.

Variables required in scope (statusCalculate_FireSenseFit only)

times

A list with elements $start and $end giving the simulation start and end years (integers). Typically a queue column.