#include <Job.hpp>
Public Member Functions | |
void | addChild (const Job &t_job) |
Adds a new child job to this job. More... | |
Files | allFiles () const |
Return the set of all files (input and output) from this job and its dependencies. More... | |
Files | allInputFiles () const |
Return the set of all input files available to this job. More... | |
JobParams | allParams () const |
return all the specific params this job has appended onto the list of params acquired from all dependencies More... | |
bool | canceled () const |
Returns the canceled state of the job. More... | |
std::vector< Job > | children () const |
Returns a vector of all children that this job has. More... | |
boost::optional < openstudio::DateTime > | childrenLastRun () const |
Returns the most recent DateTime that any child was run. More... | |
bool | childrenOutOfDate () const |
Returns true if any child process is out of date. More... | |
bool | childrenRunning () const |
Returns true if any child is currently running. More... | |
bool | childrenTreesOutOfDate () const |
Returns true if any child process's tree is out of date. More... | |
bool | childrenTreesRunning () const |
Returns true if any child's tree is currently running. More... | |
void | cleanup () |
Cleanup the output generated by this job removing any output files that have been created. More... | |
bool | connect (const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::QueuedConnection) const |
Connect a Qt signal/slot pair through to the underlying Job_Impl object that this object is a handle to. More... | |
std::string | description () const |
Return a user friendly description of the job. More... | |
std::string | detailedDescription () const |
Return a detailed description of the job. More... | |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *method=nullptr) |
Pass a disconnect call through to the underlying Job_Impl object. More... | |
boost::optional < openstudio::DateTime > | endTime () const |
JobErrors | errors () const |
Return an object representing the errors and warnings that this job has generated. More... | |
bool | externallyManaged () const |
boost::optional< Job > | finishedJob () const |
openstudio::path | getBasePath () const |
std::string | getOutput () const |
Get all stdout output generated by the Job so far. More... | |
bool | hasMergedJobs () const |
std::vector< std::pair < boost::posix_time::ptime, AdvancedStatus > > | history () const |
Returns the history of the status changes of the job. More... | |
int | index () const |
std::vector< FileInfo > | inputFiles () const |
Return a vector of all input files the job was created with. More... | |
Job (const Job &temp) | |
JobParams | jobParams () const |
Return a JobParams object for the params in this job. More... | |
JobType | jobType () const |
Return the JobType of the Job. More... | |
boost::optional < openstudio::DateTime > | lastRun () const |
Return last time that the Job was run (set at the "start" time) More... | |
void | makeExternallyManaged () |
sets this job (and children) as being externally managed More... | |
std::vector< MergedJobResults > | mergedJobResults () const |
void | mergeJob (const openstudio::runmanager::Job &t_job) |
Merge the t_job into the current job, if possible. More... | |
void | moveToThread (QThread *targetThread) |
bool | operator< (const Job &rhs) const |
Job & | operator= (Job rhs) |
bool | operator== (const Job &rhs) const |
openstudio::path | outdir () const |
bool | outOfDate () const |
Return true if the job is out of date. More... | |
std::vector< FileInfo > | outputFiles () const |
Return a vector of all output files generated by the Job. More... | |
std::vector< JobParam > | params () const |
Return a vector of all params this job was created with. More... | |
boost::optional< Job > | parent () const |
bool | ranBefore (const openstudio::runmanager::Job &t_rhs) const |
Return true if this job was run before t_rhs This function provides a higher resolution comparison than lhs.lastRun() < rhs.lastRun() More... | |
std::vector< FileInfo > | rawInputFiles () const |
Return a vector of all input files the job was created with, with no base path application. More... | |
Files | relativeOutputFiles () const |
bool | removeChild (const Job &t_job) |
Deparents the provided Job from this Job. More... | |
void | requestStop () |
Requests that a job stops. More... | |
bool | runnable () const |
bool | running () const |
Return true if the job is currently running. More... | |
void | sendSignals () |
void | setBasePath (const openstudio::path &t_basePath) |
Sets the base path by which relative paths will be evaluated from this job. More... | |
void | setBasePathRecursive (const openstudio::path &t_basePath) |
Sets the base path for this job and all child jobs. More... | |
void | setCanceled (bool t_canceled=true) |
Set the canceled state of the job The job will continue processing if it has already begun, but will refuse to restart processing if the job becomes out of date later. More... | |
void | setFinishedJob (const Job &t_job) |
Sets the "finishedJob" This is a job that executes after the parent and all parallel children have finished executing. More... | |
void | setIndex (int index) |
void | setRunnable (bool force=false) |
Set the runnable state of the job. More... | |
void | setStatus (const AdvancedStatus &t_status) |
Sets the advancedstatus of the current job. Only allowed on externally managed jobs. More... | |
void | setTreeCanceled (bool t_canceled=true) |
Set the canceled state of this job and all child jobs. More... | |
void | setTreeRunnable (bool force=false) |
Sets the runnable state for this job and all child jobs. More... | |
void | showErrors () const |
Present the warnings and errors generated by this job to the user. More... | |
void | showTreeErrors () const |
Present the warnings and errors generated by this job and all children jobs to the user. More... | |
void | start (const std::shared_ptr< ProcessCreator > &t_pc) |
Begin execution of the job. More... | |
boost::optional < openstudio::DateTime > | startTime () const |
AdvancedStatus | status () const |
void | swap (Job &rhs) |
Swap the internals of this job with rhs. More... | |
std::string | toJSON () const |
std::vector< ToolInfo > | tools () const |
Return a vector of all tools this job was created with. More... | |
Files | treeAllFiles () const |
std::string | treeDescription () const |
std::vector< std::string > | treeDetailedDescription () const |
JobErrors | treeErrors () const |
boost::optional < openstudio::DateTime > | treeLastRun () const |
bool | treeOutOfDate () const |
Files | treeOutputFiles () const |
bool | treeRunning () const |
openstudio::runmanager::TreeStatusEnum | treeStatus () const |
void | updateJob (const Job &t_other, bool t_allowUUIDUpdate) |
Update this job tree with the details from the other job tree. More... | |
UUID | uuid () const |
Return the UUID of the Job. More... | |
void | waitForFinished (int t_msecs=-1) |
Synchronously block until the Job has been finished. More... | |
Static Public Member Functions | |
static Job | fromJSON (const std::string &t_json) |
Protected Member Functions | |
Job (const std::shared_ptr< detail::Job_Impl > &t_impl) | |
Related Functions | |
(Note that these are not member functions.) | |
typedef boost::optional< Job > | OptionalJob |
A handle to a job that must be created with the JobFactory class.
Jobs are reference counted objects can may be safely copied
openstudio::runmanager::Job::Job | ( | const Job & | temp | ) |
|
protected |
void openstudio::runmanager::Job::addChild | ( | const Job & | t_job | ) |
Adds a new child job to this job.
All child jobs will be executed in parallel after the parent finishes Any child added will be reparented to this Job
Files openstudio::runmanager::Job::allFiles | ( | ) | const |
Return the set of all files (input and output) from this job and its dependencies.
Files openstudio::runmanager::Job::allInputFiles | ( | ) | const |
Return the set of all input files available to this job.
JobParams openstudio::runmanager::Job::allParams | ( | ) | const |
return all the specific params this job has appended onto the list of params acquired from all dependencies
bool openstudio::runmanager::Job::canceled | ( | ) | const |
Returns the canceled state of the job.
std::vector<Job> openstudio::runmanager::Job::children | ( | ) | const |
Returns a vector of all children that this job has.
boost::optional<openstudio::DateTime> openstudio::runmanager::Job::childrenLastRun | ( | ) | const |
Returns the most recent DateTime that any child was run.
bool openstudio::runmanager::Job::childrenOutOfDate | ( | ) | const |
Returns true if any child process is out of date.
bool openstudio::runmanager::Job::childrenRunning | ( | ) | const |
Returns true if any child is currently running.
bool openstudio::runmanager::Job::childrenTreesOutOfDate | ( | ) | const |
Returns true if any child process's tree is out of date.
bool openstudio::runmanager::Job::childrenTreesRunning | ( | ) | const |
Returns true if any child's tree is currently running.
void openstudio::runmanager::Job::cleanup | ( | ) |
Cleanup the output generated by this job removing any output files that have been created.
bool openstudio::runmanager::Job::connect | ( | const char * | signal, |
const QObject * | receiver, | ||
const char * | method, | ||
Qt::ConnectionType | type = Qt::QueuedConnection |
||
) | const |
Connect a Qt signal/slot pair through to the underlying Job_Impl object that this object is a handle to.
Available slots:
[in] | signal | signal to connect to |
[in] | receiver | signal receiver |
[in] | method | receiving slot |
[in] | type | Type of connection to make |
std::string openstudio::runmanager::Job::description | ( | ) | const |
Return a user friendly description of the job.
std::string openstudio::runmanager::Job::detailedDescription | ( | ) | const |
Return a detailed description of the job.
bool openstudio::runmanager::Job::disconnect | ( | const char * | signal = nullptr , |
const QObject * | receiver = nullptr , |
||
const char * | method = nullptr |
||
) |
Pass a disconnect call through to the underlying Job_Impl object.
[in] | signal | signal to disconnect from |
[in] | receiver | signal receiver to disconnect |
[in] | method | receiving slot to disconnect |
boost::optional<openstudio::DateTime> openstudio::runmanager::Job::endTime | ( | ) | const |
JobErrors openstudio::runmanager::Job::errors | ( | ) | const |
Return an object representing the errors and warnings that this job has generated.
bool openstudio::runmanager::Job::externallyManaged | ( | ) | const |
boost::optional<Job> openstudio::runmanager::Job::finishedJob | ( | ) | const |
|
static |
std::exception | if any part of the parsing fails, with description of where and why. |
openstudio::path openstudio::runmanager::Job::getBasePath | ( | ) | const |
std::string openstudio::runmanager::Job::getOutput | ( | ) | const |
Get all stdout output generated by the Job so far.
bool openstudio::runmanager::Job::hasMergedJobs | ( | ) | const |
std::vector<std::pair<boost::posix_time::ptime, AdvancedStatus> > openstudio::runmanager::Job::history | ( | ) | const |
Returns the history of the status changes of the job.
int openstudio::runmanager::Job::index | ( | ) | const |
std::vector<FileInfo> openstudio::runmanager::Job::inputFiles | ( | ) | const |
Return a vector of all input files the job was created with.
JobParams openstudio::runmanager::Job::jobParams | ( | ) | const |
Return a JobParams object for the params in this job.
boost::optional<openstudio::DateTime> openstudio::runmanager::Job::lastRun | ( | ) | const |
void openstudio::runmanager::Job::makeExternallyManaged | ( | ) |
sets this job (and children) as being externally managed
std::vector<MergedJobResults> openstudio::runmanager::Job::mergedJobResults | ( | ) | const |
void openstudio::runmanager::Job::mergeJob | ( | const openstudio::runmanager::Job & | t_job | ) |
Merge the t_job into the current job, if possible.
If not possible, throw MergeJobError with description as to why. accepts NullJobs automatically, passes off to mergeJobImpl if otherwise.
void openstudio::runmanager::Job::moveToThread | ( | QThread * | targetThread | ) |
bool openstudio::runmanager::Job::operator< | ( | const Job & | rhs | ) | const |
bool openstudio::runmanager::Job::operator== | ( | const Job & | rhs | ) | const |
openstudio::path openstudio::runmanager::Job::outdir | ( | ) | const |
bool openstudio::runmanager::Job::outOfDate | ( | ) | const |
Return true if the job is out of date.
std::vector<FileInfo> openstudio::runmanager::Job::outputFiles | ( | ) | const |
Return a vector of all output files generated by the Job.
The list may change as the job generates more output files.
std::vector<JobParam> openstudio::runmanager::Job::params | ( | ) | const |
Return a vector of all params this job was created with.
boost::optional<Job> openstudio::runmanager::Job::parent | ( | ) | const |
bool openstudio::runmanager::Job::ranBefore | ( | const openstudio::runmanager::Job & | t_rhs | ) | const |
Return true if this job was run before t_rhs This function provides a higher resolution comparison than lhs.lastRun() < rhs.lastRun()
[in] | t_rhs | the job to compare to. |
std::vector<FileInfo> openstudio::runmanager::Job::rawInputFiles | ( | ) | const |
Return a vector of all input files the job was created with, with no base path application.
Files openstudio::runmanager::Job::relativeOutputFiles | ( | ) | const |
bool openstudio::runmanager::Job::removeChild | ( | const Job & | t_job | ) |
void openstudio::runmanager::Job::requestStop | ( | ) |
Requests that a job stops.
bool openstudio::runmanager::Job::runnable | ( | ) | const |
bool openstudio::runmanager::Job::running | ( | ) | const |
Return true if the job is currently running.
void openstudio::runmanager::Job::sendSignals | ( | ) |
void openstudio::runmanager::Job::setBasePath | ( | const openstudio::path & | t_basePath | ) |
Sets the base path by which relative paths will be evaluated from this job.
void openstudio::runmanager::Job::setBasePathRecursive | ( | const openstudio::path & | t_basePath | ) |
Sets the base path for this job and all child jobs.
void openstudio::runmanager::Job::setCanceled | ( | bool | t_canceled = true | ) |
Set the canceled state of the job The job will continue processing if it has already begun, but will refuse to restart processing if the job becomes out of date later.
void openstudio::runmanager::Job::setFinishedJob | ( | const Job & | t_job | ) |
Sets the "finishedJob" This is a job that executes after the parent and all parallel children have finished executing.
void openstudio::runmanager::Job::setIndex | ( | int | index | ) |
[in] | index | Set the job's index in the work queue |
void openstudio::runmanager::Job::setRunnable | ( | bool | force = false | ) |
Set the runnable state of the job.
[in] | force | Forces the job to be runnable even if it is not out of date or has been marked as canceled |
void openstudio::runmanager::Job::setStatus | ( | const AdvancedStatus & | t_status | ) |
Sets the advancedstatus of the current job. Only allowed on externally managed jobs.
void openstudio::runmanager::Job::setTreeCanceled | ( | bool | t_canceled = true | ) |
Set the canceled state of this job and all child jobs.
void openstudio::runmanager::Job::setTreeRunnable | ( | bool | force = false | ) |
Sets the runnable state for this job and all child jobs.
void openstudio::runmanager::Job::showErrors | ( | ) | const |
Present the warnings and errors generated by this job to the user.
void openstudio::runmanager::Job::showTreeErrors | ( | ) | const |
Present the warnings and errors generated by this job and all children jobs to the user.
void openstudio::runmanager::Job::start | ( | const std::shared_ptr< ProcessCreator > & | t_pc | ) |
Begin execution of the job.
Note that execution does not necessarily begin immediately. Check isRunning or handle the started() signal to know when the job state has changed
[in] | t_pc | ProcessCreator to use if any process needs to be executed by the job |
boost::optional<openstudio::DateTime> openstudio::runmanager::Job::startTime | ( | ) | const |
AdvancedStatus openstudio::runmanager::Job::status | ( | ) | const |
void openstudio::runmanager::Job::swap | ( | Job & | rhs | ) |
Swap the internals of this job with rhs.
std::string openstudio::runmanager::Job::toJSON | ( | ) | const |
All paths and tools are left as-is, as if the job were being persisted in the runmanager database.
Main uses for this function are transporting the status of a job tree across a network and for display locally and for persisting of complex workflows.
With care to use relative paths, or care to re-create the job file structure on two computers it could be used to begin a job tree on one computer and continue it on another.
std::vector<ToolInfo> openstudio::runmanager::Job::tools | ( | ) | const |
Return a vector of all tools this job was created with.
Files openstudio::runmanager::Job::treeAllFiles | ( | ) | const |
std::string openstudio::runmanager::Job::treeDescription | ( | ) | const |
std::vector<std::string> openstudio::runmanager::Job::treeDetailedDescription | ( | ) | const |
JobErrors openstudio::runmanager::Job::treeErrors | ( | ) | const |
boost::optional<openstudio::DateTime> openstudio::runmanager::Job::treeLastRun | ( | ) | const |
bool openstudio::runmanager::Job::treeOutOfDate | ( | ) | const |
Files openstudio::runmanager::Job::treeOutputFiles | ( | ) | const |
bool openstudio::runmanager::Job::treeRunning | ( | ) | const |
openstudio::runmanager::TreeStatusEnum openstudio::runmanager::Job::treeStatus | ( | ) | const |
void openstudio::runmanager::Job::updateJob | ( | const Job & | t_other, |
bool | t_allowUUIDUpdate | ||
) |
Update this job tree with the details from the other job tree.
Throws an error if the UUID's do not match
Specifically, the static content: input files, params and tools remain static but the state, output files, last runtime are updated.
UUID openstudio::runmanager::Job::uuid | ( | ) | const |
Return the UUID of the Job.
void openstudio::runmanager::Job::waitForFinished | ( | int | t_msecs = -1 | ) |
Synchronously block until the Job has been finished.
[in] | t_msecs | Number of milliseconds to wait for if -1, wait indefinitely |
|
related |