taucmdr.model.experiment module

Experiment data model.

An Experiment uniquely groups a Target, Application, and Measurement and will have zero or more Trial. There is one selected experiment per project. The selected experiment will be used for application compilation and trial visualization.

class taucmdr.model.experiment.Experiment(record)[source]

Bases: taucmdr.mvc.model.Model

Experiment data model.

associations = {'project': (<class 'taucmdr.model.project.Project'>, 'experiments'), 'trials': (<class 'taucmdr.model.trial.Trial'>, 'experiment')}
attributes = {'name': {'primary_key': True, 'type': 'string', 'description': 'human-readable experiment name', 'unique': True}, 'project': {'model': <class 'taucmdr.model.project.Project'>, 'required': True, 'description': 'Project this experiment belongs to', 'unique': True}, 'target': {'model': <class 'taucmdr.model.target.Target'>, 'required': True, 'description': "The experiment's hardware/software configuration", 'argparse': {'flags': ('--target',), 'metavar': '<name>'}}, 'application': {'model': <class 'taucmdr.model.application.Application'>, 'required': True, 'description': 'Application this experiment uses', 'argparse': {'flags': ('--application',), 'metavar': '<name>'}}, 'measurement': {'model': <class 'taucmdr.model.measurement.Measurement'>, 'required': True, 'description': 'Measurement parameters for this experiment', 'argparse': {'flags': ('--measurement',), 'metavar': '<name>'}}, 'trials': {'collection': <class 'taucmdr.model.trial.Trial'>, 'via': 'experiment', 'description': 'Trials of this experiment'}, 'tau_makefile': {'type': 'string', 'description': 'TAU Makefile used during this experiment, if any.'}, 'record_output': {'type': 'boolean', 'default': False, 'description': 'Record application stdout', 'argparse': {'flags': ('--record-output',)}}}
configure()[source]

Sets up the Experiment for a new trial.

Installs or configures TAU and all its dependencies. After calling this function, the experiment is ready to operate on the user’s application.

Returns:Object handle for the TAU installation.
Return type:TauInstallation
classmethod controller(storage=<taucmdr.cf.storage.storage_dispatch.ProjectStorageDispatch object>)[source]
data_size()[source]
key_attribute = 'name'
managed_build(compiler_cmd, compiler_args)[source]

Uses this experiment to perform a build operation.

Checks that this experiment is compatible with the desired build operation, prepares the experiment, and performs the operation.

Parameters:
  • compiler_cmd (str) – The compiler command intercepted by TAU Commander.
  • compiler_args (list) – Compiler command line arguments intercepted by TAU Commander.
Raises:

ConfigurationError – The experiment is not configured to perform the desired build.

Returns:

Build subprocess return code.

Return type:

int

managed_rewrite(rewrite_package, executable, inst_file)[source]
managed_run(launcher_cmd, application_cmds, description=None)[source]

Uses this experiment to run an application command.

Performs all relevant system preparation tasks to run the user’s application under the specified experimental configuration.

Parameters:
  • launcher_cmd (list) – Application launcher with command line arguments.
  • application_cmds (list) – List of application executables with command line arguments (list of lists).
  • description (str) – If not None, a description of the run.
Raises:

ConfigurationError – The experiment is not configured to perform the desired run.

Returns:

Application subprocess return code.

Return type:

int

name = 'Experiment'
next_trial_number()[source]
on_create()[source]
on_delete()[source]
prefix
classmethod rebuild_required()[source]

Builds a string indicating if an application rebuild is required.

Rebuild information is taken from the ‘rebuild_required’ topic.

Returns:String indicating why an application rebuild is required.
Return type:str
references = {(<class 'taucmdr.model.project.Project'>, 'experiment'), (<class 'taucmdr.model.trial.Trial'>, 'experiment')}
classmethod select(name)[source]

Changes the selected experiment in the current project.

Raises:ExperimentSelectionError – No experiment with the given name in the currently selected project.
Parameters:name (str) – Name of the experiment to select.
trials(trial_numbers=None)[source]

Get a list of modeled trial records.

If bool(trial_numbers) is False, return the most recent trial. Otherwise return a list of Trial objects for the given trial numbers.

Parameters:trial_numbers (list) – List of numbers of trials to retrieve.
Returns:Modeled trial records.
Return type:list
Raises:ConfigurationError – Invalid trial number or no trials in selected experiment.
verify()[source]

Checks all components of the experiment for mutual compatibility.

class taucmdr.model.experiment.ExperimentController(model_cls, storage, context=None)[source]

Bases: taucmdr.mvc.controller.Controller

Experiment data controller.

_check_unique(data, match_any=False)[source]

Default match_any to False to prevent matches outside the selected project.

all(context=True)[source]
count()[source]
create(data)[source]
delete(keys)[source]
exists(keys)[source]
one(keys, context=True)[source]
search(keys=None, context=True)[source]
unset(fields, keys)[source]
update(data, keys)[source]
taucmdr.model.experiment.attributes()[source]