taucmdr.model.trial module¶
Trial data model.
Every application of an Experiment produces a new Trial. The trial
record completely describes the hardware and software environment that produced
the performance data.
- class taucmdr.model.trial.Trial(record)[source]¶
Bases:
ModelTrial data model.
- _attributes = {'begin_time': {'description': 'date and time the trial began', 'type': 'datetime'}, 'command': {'description': 'command line executed when performing the trial', 'required': True, 'type': 'string'}, 'cwd': {'description': 'directory the trial was performed in', 'required': True, 'type': 'string'}, 'data_size': {'description': 'the size in bytes of the trial data', 'type': 'integer'}, 'description': {'argparse': {'flags': ('--description',), 'metavar': '<text>'}, 'description': 'description of this trial', 'type': 'string'}, 'elapsed': {'description': 'seconds spent executing the application command only (excludes all other operations)', 'type': 'float'}, 'end_time': {'description': 'date and time the trial ended', 'type': 'datetime'}, 'environment': {'description': 'shell environment in which the trial was performed, encoded as a base64 string', 'type': 'string'}, 'experiment': {'description': "this trial's experiment", 'model': <class 'taucmdr.model.experiment.Experiment'>, 'required': True}, 'number': {'description': 'trial number', 'primary_key': True, 'required': True, 'type': 'integer'}, 'output': {'description': 'stdout and stderr of program', 'type': 'string'}, 'phase': {'description': 'phase of trial: initializing, executing, complete, or failed', 'type': 'string'}, 'return_code': {'description': 'return code of the command executed when performing the trial', 'type': 'integer'}}¶
- _key_attribute = 'number'¶
- classmethod _separate_launcher_cmd(cmd)[source]¶
Separate the launcher command and it’s arguments from the application command(s) and arguments.
- Parameters:
cmd (list) – Command line.
- Returns:
(Launcher command, Remainder of command line)
- Return type:
- Raises:
ConfigurationError – No application config files or executables found after a recognized launcher command.
- associations = {'experiment': (<class 'taucmdr.model.experiment.Experiment'>, 'trials')}¶
(Controller, str) tuples keyed by attribute name defining attribute associations.
- attributes = {'begin_time': {'description': 'date and time the trial began', 'type': 'datetime'}, 'command': {'description': 'command line executed when performing the trial', 'required': True, 'type': 'string'}, 'cwd': {'description': 'directory the trial was performed in', 'required': True, 'type': 'string'}, 'data_size': {'description': 'the size in bytes of the trial data', 'type': 'integer'}, 'description': {'argparse': {'flags': ('--description',), 'metavar': '<text>'}, 'description': 'description of this trial', 'type': 'string'}, 'elapsed': {'description': 'seconds spent executing the application command only (excludes all other operations)', 'type': 'float'}, 'end_time': {'description': 'date and time the trial ended', 'type': 'datetime'}, 'environment': {'description': 'shell environment in which the trial was performed, encoded as a base64 string', 'type': 'string'}, 'experiment': {'description': "this trial's experiment", 'model': <class 'taucmdr.model.experiment.Experiment'>, 'required': True}, 'number': {'description': 'trial number', 'primary_key': True, 'required': True, 'type': 'integer'}, 'output': {'description': 'stdout and stderr of program', 'type': 'string'}, 'phase': {'description': 'phase of trial: initializing, executing, complete, or failed', 'type': 'string'}, 'return_code': {'description': 'return code of the command executed when performing the trial', 'type': 'integer'}}¶
Model attributes.
- execute_command(expr, cmd, cwd, env, record_output=False)[source]¶
Execute a command as part of an experiment trial.
Creates a new subprocess for the command and checks for TAU data files when the subprocess exits.
- Parameters:
expr (Experiment) – Experiment data.
cmd (str) – Command to profile, with command line arguments.
cwd (str) – Working directory to perform trial in.
env (dict) – Environment variables to set before performing the trial.
- Returns:
Subprocess return code.
- Return type:
- export(dest)[source]¶
Export experiment trial data.
- Parameters:
dest (str) – Path to directory to contain exported data.
- Raises:
ConfigurationError – This trial has no data.
- get_data_files()[source]¶
Return paths to the trial’s data files or directories mapped by data type.
Post-process trial data if necessary and return a dictionary mapping the types of data produced by this trial to paths to related data files or directories. The paths should be suitable for passing on a command line to one of the known data analysis tools. For example, a trial producing SLOG2 traces and TAU profiles would return
{"slog2": "/path/to/tau.slog2", "tau": "/path/to/directory/"}.- Returns:
Keys are strings indicating the data type; values are filesystem paths.
- Return type:
- key_attribute = 'number'¶
Name of an attribute that serves as a unique identifier.
- name = 'Trial'¶
Name of the model.
- classmethod parse_launcher_cmd(cmd)[source]¶
Parses a command line to split the launcher command and application commands.
- property prefix¶
- references = {}¶
(Controller, str) tuples listing foreign models referencing this model.
- class taucmdr.model.trial.TrialController(model_cls, storage, context=None)[source]¶
Bases:
ControllerTrial data controller.
- exception taucmdr.model.trial.TrialError(value, *hints)[source]¶
Bases:
ConfigurationErrorIndicates there was an error while performing an experiment trial.
- message_fmt = "%(value)s\n\n%(hints)s\nPlease check the selected configuration for errors or send '%(logfile)s' to %(contact)s for assistance."¶
Format string for the error message.