WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
wrench::Workunit Class Reference

A class to describe a unit of work that's a sub-component of a StandardJob. More...

#include <Workunit.h>

Public Member Functions

 Workunit (std::shared_ptr< StandardJob > job, double sleep_time, std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation >>> pre_file_copies, WorkflowTask *task, std::map< WorkflowFile *, std::vector< std::shared_ptr< FileLocation >>> file_locations, std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation >>> post_file_copies, std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >>> cleanup_file_deletions)
 Constructor. More...
 
std::shared_ptr< StandardJobgetJob ()
 Retrieve the standard job this workunit belongs to. More...
 

Static Public Member Functions

static void addDependency (std::shared_ptr< Workunit > parent, std::shared_ptr< Workunit > child)
 Add a dependency between two work units (does nothing if the dependency already exists) More...
 
static std::set< std::shared_ptr< Workunit > > createWorkunits (std::shared_ptr< StandardJob > job)
 Create all work units for a newly dispatched job. More...
 

Public Attributes

std::set< std::shared_ptr< Workunit > > children
 The Workunits that depend on this Workunit.
 
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation > > > cleanup_file_deletions
 File deletions to perform last.
 
std::map< WorkflowFile *, std::vector< std::shared_ptr< FileLocation > > > file_locations
 Locations where computational tasks should read/write files.
 
std::shared_ptr< StandardJobjob
 The StandardJob this Workunit belongs to.
 
unsigned long num_pending_parents
 The number of Workunits this Workunit depends on.
 
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > > > post_file_copies
 File copies to perform after computational tasks completes.
 
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > > > pre_file_copies
 File copies to perform before computational tasks begin.
 
double sleep_time
 A sleep time, in seconds.
 
WorkflowTasktask = nullptr
 Computational task to perform.
 

Detailed Description

A class to describe a unit of work that's a sub-component of a StandardJob.

Constructor & Destructor Documentation

◆ Workunit()

wrench::Workunit::Workunit ( std::shared_ptr< StandardJob job,
double  sleep_time,
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation >>>  pre_file_copies,
WorkflowTask task,
std::map< WorkflowFile *, std::vector< std::shared_ptr< FileLocation >>>  file_locations,
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation >>>  post_file_copies,
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >>>  cleanup_file_deletions 
)

Constructor.

Parameters
jobthe job this workunit belongs to
sleep_timea sleep time before the execution, in seconds
pre_file_copiesa vector of file copy actions to perform in sequence first
taska WorkflowTask
file_locationslocations where tasks should read/write files
post_file_copiesa vector of file copy actions to perform in sequence after all tasks
cleanup_file_deletionsa vector of file deletion actions to perform last

Member Function Documentation

◆ addDependency()

void wrench::Workunit::addDependency ( std::shared_ptr< Workunit parent,
std::shared_ptr< Workunit child 
)
static

Add a dependency between two work units (does nothing if the dependency already exists)

Parameters
parentthe parent work unit
childthe child work unit
Exceptions
std::invalid_argument

◆ createWorkunits()

std::set< std::shared_ptr< Workunit > > wrench::Workunit::createWorkunits ( std::shared_ptr< StandardJob job)
static

Create all work units for a newly dispatched job.

Parameters
jobthe job
Returns
A set of work units

◆ getJob()

std::shared_ptr< StandardJob > wrench::Workunit::getJob ( )

Retrieve the standard job this workunit belongs to.

Returns
a standard job

The documentation for this class was generated from the following files: