sierra.core.generators.exp_creator
Experiment creation classes.
Experiment creation takes an experiment definition generated by classes in
exp_generators.py
and writes the experiment to the filesystem.
ExpCreator
: Instantiate a generated experiment from an experiment definition.BatchExpCreator
: Instantiate a Batch Experiment.
- class sierra.core.generators.exp_creator.ExpCreator(cmdopts: Dict[str, Any], criteria: BatchCriteria, template_ipath: Path, exp_input_root: Path, exp_output_root: Path, exp_num: int)[source]
Instantiate a generated experiment from an experiment definition.
Takes generated Experiment definitions and writes them to the filesystem.
- template_ipath
Absolute path to the template XML configuration file.
- exp_input_root
Absolute path to experiment directory where generated XML input files for this experiment should be written.
- exp_output_root
Absolute path to root directory for run outputs for this experiment.
- cmdopts
Dictionary containing parsed cmdline options.
Inheritance
- __dict__ = mappingproxy({'__module__': 'sierra.core.generators.exp_creator', '__doc__': 'Instantiate a generated experiment from an experiment definition.\n\n Takes generated :term:`Experiment` definitions and writes them to the\n filesystem.\n\n Attributes:\n\n template_ipath: Absolute path to the template XML configuration file.\n\n exp_input_root: Absolute path to experiment directory where generated\n XML input files for this experiment should be written.\n\n exp_output_root: Absolute path to root directory for run outputs\n for this experiment.\n\n cmdopts: Dictionary containing parsed cmdline options.\n\n ', '__init__': <function ExpCreator.__init__>, 'from_def': <function ExpCreator.from_def>, '_create_exp_run': <function ExpCreator._create_exp_run>, '_get_launch_file_stempath': <function ExpCreator._get_launch_file_stempath>, '_update_cmds_file': <function ExpCreator._update_cmds_file>, '__dict__': <attribute '__dict__' of 'ExpCreator' objects>, '__weakref__': <attribute '__weakref__' of 'ExpCreator' objects>, '__annotations__': {}})
- __doc__ = 'Instantiate a generated experiment from an experiment definition.\n\n Takes generated :term:`Experiment` definitions and writes them to the\n filesystem.\n\n Attributes:\n\n template_ipath: Absolute path to the template XML configuration file.\n\n exp_input_root: Absolute path to experiment directory where generated\n XML input files for this experiment should be written.\n\n exp_output_root: Absolute path to root directory for run outputs\n for this experiment.\n\n cmdopts: Dictionary containing parsed cmdline options.\n\n '
- __init__(cmdopts: Dict[str, Any], criteria: BatchCriteria, template_ipath: Path, exp_input_root: Path, exp_output_root: Path, exp_num: int) None [source]
- __module__ = 'sierra.core.generators.exp_creator'
- __weakref__
list of weak references to the object (if defined)
- _get_launch_file_stempath(run_num: int) Path [source]
File is named as
<template input file stem>_run<run_num>
.
- _update_cmds_file(cmds_file, cmds_generator: IExpRunShellCmdsGenerator, paradigm: str, run_num: int, launch_stem_path: Path, for_host: str) None [source]
Add command to launch a given experimental run to the command file.
- from_def(exp_def: XMLExpDef)[source]
Create all experimental runs by writing input files to filesystem.
The passed
XMLExpDef
object contains all changes that should be made to all runs in the experiment. Additional changes to create a set of unique runs from which distributions of system behavior can be meaningfully computed post-hoc are added.
- class sierra.core.generators.exp_creator.BatchExpCreator(criteria: BatchCriteria, cmdopts: Dict[str, Any])[source]
Instantiate a Batch Experiment.
Calls
ExpCreator
on each experimental definition in the batch- batch_config_template
Absolute path to the root template XML configuration file.
- batch_input_root
Root directory for all generated XML input files all experiments should be stored (relative to current dir or absolute). Each experiment will get a directory within this root to store the xml input files for the experimental runs comprising an experiment; directory name determined by the batch criteria used.
- batch_output_root
Root directory for all experiment outputs. Each experiment will get a directory ‘exp<n>’ in this directory for its outputs.
- criteria
BatchCriteria
derived object instance created from cmdline definition.
Inheritance
- __dict__ = mappingproxy({'__module__': 'sierra.core.generators.exp_creator', '__doc__': "Instantiate a :term:`Batch Experiment`.\n\n Calls :class:`~sierra.core.generators.exp_creator.ExpCreator` on each\n experimental definition in the batch\n\n Attributes:\n\n batch_config_template: Absolute path to the root template XML\n configuration file.\n\n batch_input_root: Root directory for all generated XML input files all\n experiments should be stored (relative to current dir\n or absolute). Each experiment will get a directory\n within this root to store the xml input files for the\n experimental runs comprising an experiment; directory\n name determined by the batch criteria used.\n\n batch_output_root: Root directory for all experiment outputs. Each\n experiment will get a directory 'exp<n>' in this\n directory for its outputs.\n\n criteria: :class:`~sierra.core.variables.batch_criteria.BatchCriteria`\n derived object instance created from cmdline definition.\n\n ", '__init__': <function BatchExpCreator.__init__>, 'create': <function BatchExpCreator.create>, '__dict__': <attribute '__dict__' of 'BatchExpCreator' objects>, '__weakref__': <attribute '__weakref__' of 'BatchExpCreator' objects>, '__annotations__': {}})
- __doc__ = "Instantiate a :term:`Batch Experiment`.\n\n Calls :class:`~sierra.core.generators.exp_creator.ExpCreator` on each\n experimental definition in the batch\n\n Attributes:\n\n batch_config_template: Absolute path to the root template XML\n configuration file.\n\n batch_input_root: Root directory for all generated XML input files all\n experiments should be stored (relative to current dir\n or absolute). Each experiment will get a directory\n within this root to store the xml input files for the\n experimental runs comprising an experiment; directory\n name determined by the batch criteria used.\n\n batch_output_root: Root directory for all experiment outputs. Each\n experiment will get a directory 'exp<n>' in this\n directory for its outputs.\n\n criteria: :class:`~sierra.core.variables.batch_criteria.BatchCriteria`\n derived object instance created from cmdline definition.\n\n "
- __module__ = 'sierra.core.generators.exp_creator'
- __weakref__
list of weak references to the object (if defined)
- create(generator: BatchExpDefGenerator) None [source]