dedalus.core.evaluator
Class for centralized evaluation of expression trees.
Module Contents
- FILEHANDLER_MODE_DEFAULT
- FILEHANDLER_PARALLEL_DEFAULT
- FILEHANDLER_TOUCH_TMPFILE
- logger
- class Evaluator(domain, vars)
Coordinates evaluation of operator trees through various handlers.
- Parameters
domain (domain object) – Problem domain
vars (dict) – Variables for parsing task expression strings
- add_dictionary_handler(**kw)
Create a dictionary handler and add to evaluator.
- add_system_handler(**kw)
Create a system handler and add to evaluator.
- add_file_handler(filename, **kw)
Create a file handler and add to evaluator.
- add_handler(handler)
Add a handler to evaluator.
- evaluate_group(group, **kw)
Evaluate all handlers in a group.
- evaluate_scheduled(wall_time, sim_time, iteration, **kw)
Evaluate all scheduled handlers.
- evaluate_handlers(handlers, id=None, **kw)
Evaluate a collection of handlers.
- require_coeff_space(fields)
Move all fields to coefficient layout.
- static get_fields(tasks)
Get field set for a collection of tasks.
- static attempt_tasks(tasks, **kw)
Attempt tasks and return the unfinished ones.
- class Handler(domain, vars, group=None, wall_dt=np.inf, sim_dt=np.inf, iter=np.inf)
Group of tasks with associated scheduling data.
- Parameters
domain (domain object) – Problem domain
vars (dict) – Variables for parsing task expression strings
group (str, optional) – Group name for forcing selected handelrs (default: None)
wall_dt (float, optional) – Wall time cadence for evaluating tasks (default: infinite)
sim_dt (float, optional) – Simulation time cadence for evaluating tasks (default: infinite)
iter (int, optional) – Iteration cadence for evaluating tasks (default: infinite)
- add_task(task, layout='g', name=None, scales=None)
Add task to handler.
- add_tasks(tasks, **kw)
Add multiple tasks.
- add_system(system, **kw)
Add fields from a FieldSystem.
- class DictionaryHandler(*args, **kw)
Handler that stores outputs in a dictionary.
- process(**kw)
Reference fields from dictionary.
- class SystemHandler(domain, vars, group=None, wall_dt=np.inf, sim_dt=np.inf, iter=np.inf)
Handler that sets fields in a FieldSystem.
- build_system()
Build FieldSystem and set task outputs.
- process(**kw)
Gather fields into system.
- class FileHandler(base_path, *args, max_writes=np.inf, max_size=2 ** 30, parallel=None, mode=None, **kw)
Handler that writes tasks to an HDF5 file.
- Parameters
base_path (str) – Base path for analyis output folder
max_writes (int, optional) – Maximum number of writes per set (default: infinite)
max_size (int, optional) – Maximum file size to write to, in bytes (default: 2**30 = 1 GB). (Note: files may be larger after final write.)
parallel (bool, optional) – Perform parallel writes from each process to single file (True), or separately write to individual process files (False). Default behavior set by config option.
mode (str, optional) – ‘overwrite’ to delete any present analysis output with the same base path. ‘append’ to begin with set number incremented past any present analysis output. Default behavior set by config option.
- property current_path
- check_file_limits()
Check if write or size limits have been reached.
- get_file()
Return current HDF5 file, creating if necessary.
- create_current_file()
Generate new HDF5 file in current_path.
- setup_file(file)
- process(world_time, wall_time, sim_time, timestep, iteration, **kw)
Save task outputs to HDF5 file.
- get_write_stats(layout, scales, constant, index)
Determine write parameters for nonconstant subspace of a field.
- get_hdf5_spaces(layout, scales, constant, index)
Create HDF5 space objects for writing nonconstant subspace of a field.