Execution Macros

The macros are the main user interface. They resolve a configuration by name, run it, and handle plugin loading and world-age issues for you.

Global settings

VariableMeaning
CONFIG_SEARCH_PATHSFolders searched recursively for name.jl (default ["configs", "experiments"]).
CONFIG_ROOT_OVERWRITEProject root for that search. Defaults to PDEStudioCore.get_save_path().
BONITO_LISTEN_URL, BONITO_LISTEN_PORT, BONITO_PROXY_URLServer settings for browser plots with WGLMakie.

All of them are Refs, e.g. HyperCloud.CONFIG_SEARCH_PATHS[] = ["my_cases"].

@sim

@sim name
@sim "name"
@sim :name

Runs the configuration returned by name():

  1. If a function name exists in the calling module, it is used.
  2. Otherwise the macro searches CONFIG_SEARCH_PATHS for name.jl, includes it, and calls the function of the same name.
  3. The call goes through Base.invokelatest, so functions defined by a freshly included file work in the same session.

If neither exists, @sim throws an ErrorException.

Failed runs do not abort a batch

The simulation runners catch exceptions, log them with @error, and return nothing. A batch therefore continues past a failing method; check the log for errors.

@plot

@plot
@plot name

Opens the PDEStudio viewer. With name, the configuration is resolved like in @sim, passed to the viewer with set_sim_config!, and computed (or loaded from cache).

The backend is chosen from what is loaded in the calling module:

  • GLMakie: a local window.
  • WGLMakie: plots are served by a Bonito server (configured once per session with the BONITO_* settings). If Bonito itself is not loaded, a warning is printed.
  • Neither: a warning is printed and the figure is returned without being displayed.

@backup

@backup name

Copies the file that defines name into a backups folder next to it, with a timestamp in the file name (name_YYYYMMDD_HHMMSS.jl). Use it to archive the exact configuration behind a result.

API

HyperCloud.@sim — Macro
@sim name

Evaluates the configuration and runs the simulation. Checks the local module scope first; if not found, dynamically loads the configuration from the user's configured search paths. Accepts strings ("name"), bare words (name), or symbols (:name).

source
HyperCloud.@plot — Macro
@plot()

Launches the PDEStudio plotter utilizing the active module's backend.

source
@plot name

Launches the PDEStudio plotter, loads the configuration from the function or plugin name, and forces a plot update.

source
HyperCloud.@backup — Macro
@backup name

Manually triggers a backup of the source file where the configuration function or script name is defined.

source