wrench.compound_job
- class wrench.compound_job.CompoundJob(simulation, name: str)
Bases:
SimulationItemWRENCH Action class
- add_action_dependency(parent_action: Action, child_action: Action)
Add a dependency between two actions
- add_compute_action(name: str, flops: float, ram: int, max_num_cores: int, min_num_cores: int, parallel_model: Tuple[str, float]) ComputeAction
Add a sleep action to the compound job
- Parameters:
name (str) – name of compute action
flops (float) – flops associated with this action
ram (int) – minimum amount of ram needed
min_num_cores (int) – minimum amount of cores this action needs
max_num_cores (int) – maximum amount of cores this action can use
parallel_model – type of parallel model and settings for it. Allowed types
are “AMDAHL” or “CONSTANTEFFICIENCY”, both of which take a float parameters between 0.0 and 1.0. The AMDAHL model’s parameter denotes the fraction of the sequential execution time that is perfectly parallelizable. The CONSTANTEFFICIENCY model’s parameter is simply the parallel efficiency. For instance, one could pass (“AMDAHL”, 0.8). :type parallel_model: tuple
- add_file_copy_action(name: str, file: File, src_storage_service: StorageService, dest_storage_service: StorageService) FileCopyAction
Add a file copy action to the compound job
- Parameters:
name (str) – name of file copy action
file (File) – name of file being copied
src_storage_service (StorageService) – source storage service being copied from
dest_storage_service (StorageService) – destination storage service being copied to
- add_file_delete_action(name: str, file: File, storage_service: StorageService) FileDeleteAction
Add a file delete action to the compound job
- Parameters:
name (str) – name of file delete action
file (File) – name of file being deleted
storage_service (StorageService) – storage service file is deleted from
- add_file_read_action(name: str, file: File, storage_service: StorageService, num_bytes_to_read: int = 0) FileReadAction
Add a file write action to the compound job
- Parameters:
name (str) – name of file write action
file (File) – name of file to write
storage_service (StorageService) – storage service to write the file to
num_bytes_to_read (int) – number of bytes to read in file
- add_file_write_action(name: str, file: File, storage_service: StorageService) FileWriteAction
Add a file write action to the compound job
- Parameters:
name (str) – name of file write action
file (File) – name of file to write
storage_service (StorageService) – storage service to write the file to
- add_parent_job(parent_compound_job: CompoundJob)
Add a parent compound job to this compound job
- Parameters:
parent_compound_job (CompoundJob) – name of parent compound job
- Returns:
- add_sleep_action(name: str, sleep_time: float) SleepAction
Add a sleep action to the compound job
- Parameters:
name (str) – name of the sleep action
sleep_time (float) – the time to sleep
- Returns:
- get_actions() List[Action]
Get the list of tasks in the job
- Returns:
a list of task objects
- Return type:
List[Task]
- get_name() str
Get the name