wrench::CompoundJob
-
class CompoundJob : public wrench::Job, public std::enable_shared_from_this<CompoundJob>
A compound job class.
Public Types
-
enum State
Compound job states.
Values:
-
enumerator NOT_SUBMITTED
Job hasn’t been submitted yet.
-
enumerator SUBMITTED
Job has been submitted to a JobManager.
-
enumerator COMPLETED
Job has finished executing and all actions were successfully completed.
-
enumerator DISCONTINUED
Job has finished executing but not all actions were successfully completed. Actions may have failed, the job may have been terminated/killed, or parent jobs may have been discontinued.
-
enumerator NOT_SUBMITTED
Public Functions
Add a dependency between two actions (does nothing if dependency already exists)
- Parameters
parent – the parent action
child – the child action
Add a child job to this job (be careful not to add circular dependencies, which may lead to deadlocks)
- Parameters
child – the child job
Add a compute action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
flops – the number of flops to perform
ram – the amount of RAM required
min_num_cores – the minimum number of cores needed
max_num_cores – the maximum number of cores allowed
parallel_model – the parallel speedup model
- Returns
a compute action
Add a custom action to the job.
- Parameters
custom_action – a custom action
- Returns
the custom action that was passed in
Add a file copy action to a job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file to copy
src_storage_service – the source storage service
dst_storage_service – the destination storage service
- Returns
a file copy action
Add a file copy action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file
src_file_location – the file’s location where it should be read
dst_file_location – the file’s location where it should be written
- Returns
a file copy action
Add a file delete action to a job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file to delete
storage_service – the storage service on which the file is
- Returns
a file delete action
Add a file delete action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file
file_location – the location from which to delete the file
- Returns
a file delete action
Add a file read action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file
file_location – the file’s location
- Returns
a file read action
Add a file read action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file
file_location – the file’s location
num_bytes_to_read – the number of bytes to read
- Returns
a file read action
Add a file read action to a job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file to read
storage_service – the storage service to read the file from
- Returns
a file read action
Add a file read action to a job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file to read
storage_service – the storage service to read the file from
num_bytes_to_read – the number of bytes to read
- Returns
a file read action
Add a file read action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file
file_locations – the locations to read the file from (will be tried in order until one succeeds)
- Returns
a file read action
Add a file read action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file
file_locations – the locations to read the file from (will be tried in order until one succeeds)
num_bytes_to_read – number of bytes to read
- Returns
a file read action
Add a file registry add entry action.
- Parameters
name – the action’s name
file_registry – the file registry
file – the file
file_location – the file location
- Returns
Add a file registry add entry action.
- Parameters
name – the action’s name
file_registry – the file registry
file – the file
file_location – the file location
- Returns
Add a file write action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file
file_location – the file’s location where it should be written
- Returns
a file write action
Add a file write action to a job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
file – the file to write
storage_service – the storage service to write the file to
- Returns
a file write action
Add a parent job to this job (be careful not to add circular dependencies, which may lead to deadlocks)
- Parameters
parent – the parent job
-
std::shared_ptr<SleepAction> addSleepAction(const std::string &name, double sleep_time)
Add a sleep action to the job.
- Parameters
name – the action’s name (if empty, a unique name will be picked for you)
sleep_time – the time to sleep, in seconds
- Returns
a sleep action
-
std::set<std::shared_ptr<Action>> getActions()
Get the job’s actions.
- Returns
the set of actions in the job
-
std::set<std::shared_ptr<CompoundJob>> getChildrenJobs()
Get the job’s children.
- Returns
the (possibly empty) set of children jobs
-
double getMinimumRequiredMemory()
Get the minimum required amount of memory to run the job.
- Returns
a number of bytes
-
unsigned long getMinimumRequiredNumCores()
Get the minimum required num cores to run the job.
- Returns
a number of cores
-
std::set<std::shared_ptr<CompoundJob>> getParentJobs()
Get the job’s parents.
- Returns
the (possibly empty) set of parent jobs
Get the shared pointer for this object.
- Returns
a shared pointer to the object
-
CompoundJob::State getState()
Get the state of the standard job.
- Returns
the state
-
std::string getStateAsString()
Get the state of the standard job.
- Returns
the state
-
bool hasFailed()
Return whether the job has terminated and has done so with some tasks having failed.
- Returns
true or false
-
bool hasSuccessfullyCompleted()
Return whether the job has terminated and has done so successfully.
- Returns
true or false
-
void printActionDependencies()
Print the list of actions with their children and parents.
-
void printTaskMap()
Print the task map.
Remove an action from the job.
- Parameters
action – the action to remove
-
virtual void setPriority(double p) override
Set the job’s priority (the higher the value, the higher the priority)
- Parameters
p – a priority
-
bool usesScratch()
Determine whether the job uses scratch.
- Returns
true if the job uses scratch, false otherwise
-
enum State