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 SUBMITTED
Job has been submitted to a JobManager.
-
enumerator 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)
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_location – the location from which to delete the file
- Returns:
a file delete 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_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_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 the job.
- Parameters:
name – the action’s name (if empty, a unique name will be picked for you)
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_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_location – the file location
- Returns:
Add a file registry delete entry action.
- Parameters:
name – the action’s name
file_registry – the file registry
file_location – the file location
- Returns:
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 file write action to the job.
- Parameters:
name – the action’s name (if empty, a unique name will be picked for you)
file_location – the file’s location where it should be written
- Returns:
a file write action
Add an MPI action to the job. The intended use-case for an MPI action is that never runs concurrently with other actions within its job, and that that job is submitted to a BatchComputeService, so that it has a set of resources dedicated to it. If the job is submitted to a BareMetalComputeService, this action will use all of that service’s resources, regardless of other running actions/jobs on that service.
- Parameters:
name – the action’s name (if empty, a unique name will be picked for you)
mpi_code – a lambda/function that implements the MPI code that MPI processes should execute
num_processes – the number of MPI processes that will be started.
num_cores_per_process – the number of core that each MPI process should use. Note that this is not enforced by the runtime system. If the processes compute with more cores, then they will cause time-sharing on cores.
- Returns:
an MPI 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
Remove an action from the job.
- Parameters:
action – the action to remove
-
void setPriority(double p) override
Set the job’s priority (the higher the value, the higher the priority)
- Parameters:
p – a priority
-
enum State