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]¶
-
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: Raises: ConfigurationError
– The experiment is not configured to perform the desired build.Returns: Build subprocess return code.
Return type:
-
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: Raises: ConfigurationError
– The experiment is not configured to perform the desired run.Returns: Application subprocess return code.
Return type:
-
name
= 'Experiment'¶
-
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.
-
-
class
taucmdr.model.experiment.
ExperimentController
(model_cls, storage, context=None)[source]¶ Bases:
taucmdr.mvc.controller.Controller
Experiment data controller.