#include <RunManager.hpp>
Public Member Functions | |
void | clearJobs () |
safely clears all jobs from the runmanager More... | |
bool | connect (const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::QueuedConnection) const |
Connect a Qt SLOT to a signal in the underlying RunManager_Impl object available signals: More... | |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::QueuedConnection) const |
Connect a Qt SIGNAL to a slot in the underlying RunManager_Impl object available slots: More... | |
openstudio::path | dbPath () const |
Return the file location this RunManager DB was created from. More... | |
void | deleteWorkflowByName (const std::string &t_name) |
void | deleteWorkflows () |
deletes the workflows from the database More... | |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *method=nullptr) |
Disconnects signal or signals from the underlying RunManager_Impl object. More... | |
bool | enqueue (const Job &job, bool force, const openstudio::path &basePath=openstudio::path()) |
Queue up a job (and all children) for processing. More... | |
bool | enqueue (const std::vector< openstudio::runmanager::Job > &jobs, bool force, const openstudio::path &t_basePath=openstudio::path()) |
Queue up a job (and all children) for processing. More... | |
boost::optional< Job > | enqueueOrReturnExisting (const Job &job, bool force, const openstudio::path &basePath=openstudio::path()) |
openstudio::runmanager::ConfigOptions | getConfigOptions () const |
Return a copy of the current openstudio::runmanager::ConfigOptions object. More... | |
QModelIndex | getIndex (const Job &t_job) const |
openstudio::runmanager::Job | getJob (const openstudio::UUID &t_uuid) const |
Return the job that is represented by the given openstudio::UUID throw an std::out_of_range if a job with the UUID does not exist. More... | |
openstudio::runmanager::Job | getJob (const QModelIndex &t_index) const |
Return the job at the current QModelIndex throw an std::out_of_range if the job could not be found. More... | |
std::vector < openstudio::runmanager::Job > | getJobs () const |
Return a vector of all Jobs the RunManager knows about. More... | |
std::vector < openstudio::runmanager::Job > | getJobs (const QModelIndexList &t_indexes) const |
QAbstractItemModel * | getQItemModel () |
Return a QAbstractItemModel which represents the RunManager work queue. More... | |
void | hideStatusDialog () |
Hide the status dialog. More... | |
std::vector< Job > | jobsForExport () const |
std::string | jobsToJson () const |
void | loadJobs (const openstudio::path &t_db) |
Load all of the jobs from the given database file into the current RunManager, enqueuing them. More... | |
Workflow | loadWorkflow (const std::string &key) const |
Workflow | loadWorkflowByName (const std::string &t_name) const |
std::vector< Workflow > | loadWorkflows () const |
void | lowerPriority (const Job &t_job) |
Lower the priority of the given job. More... | |
void | lowerPriority (const std::vector< Job > &t_jobs) |
Lower the priority of the given jobs. More... | |
bool | outOfDate (const openstudio::runmanager::Job &job) const |
Return true if the given job is out of date. More... | |
bool | paused () const |
std::string | persistWorkflow (const Workflow &_wf) |
Persist a workflow to the database. More... | |
void | raisePriority (const Job &t_job) |
Raise the priority of the given job. More... | |
void | raisePriority (const std::vector< Job > &t_jobs) |
Raise the priority of the given jobs. More... | |
void | remove (const openstudio::runmanager::Job &job) |
Remove the given job and all child jobs from the queue. More... | |
RunManager (bool t_paused=false, bool t_initializeui=true, bool t_useStatusGUI=true) | |
Construct a RunManager using a new temporary database file for this one use only. More... | |
RunManager (const openstudio::path &DB, bool t_new=false, bool t_paused=false, bool t_initializeui=true, bool t_useStatusGUI=true) | |
Construct a RunManager from a given database file path. More... | |
openstudio::runmanager::Job | runWorkflow (const std::string &t_json, const openstudio::path &t_basePath, const openstudio::path &t_runPath, const openstudio::runmanager::Tools &t_tools, const openstudio::runmanager::JSONWorkflowOptions &t_options) |
Executes a workflow which is defined by a JSON string from Nick. More... | |
openstudio::runmanager::Job | runWorkflow (const openstudio::path &t_jsonPath, const openstudio::path &t_basePath, const openstudio::path &t_runPath, const openstudio::runmanager::Tools &t_tools, const openstudio::runmanager::JSONWorkflowOptions &t_options) |
Executes a workflow which is defined by a JSON string from Nick. More... | |
void | setConfigOptions (const openstudio::runmanager::ConfigOptions &co) |
Update the configuration options in one atomic step. More... | |
void | setOutOfDateRunnable () |
Update all out of date jobs to be runnable again Jobs do not automatically restart as soon as they are out of date. More... | |
void | setPaused (bool t_paused=true) |
set paused state More... | |
void | showConfigGui () |
Launch the openstudio::runmanager::Configuration UI. More... | |
RunManagerStatusHandle | showStatusDialog () |
Show a status dialog of the processes taking place if one is not already open. More... | |
std::map< std::string, double > | statistics () const |
void | updateJob (const Job &t_job) |
update job tree More... | |
void | updateJob (const openstudio::UUID &t_uuid, const Job &t_job) |
update job tree, and be willing to change the UUID in the process More... | |
void | updateJob (const Job &t_job, const openstudio::path &t_dir) |
update job tree More... | |
void | updateJobs (const std::string &t_json, bool t_externallyManaged) |
Load all of the jobs from the given JSON string, updating job trees. More... | |
void | updateJobs (const QVariant &t_variant, const VersionString &t_version, bool t_externallyManaged) |
Load all of the jobs from the given JSON structure represented by a QVariant, updating job trees. More... | |
void | updateJobs (const std::vector< Job > &t_jobs) |
update job trees More... | |
void | waitForFinished (int m_secs=-1) |
Block until the RunManager has finished processing all work. More... | |
bool | workPending () const |
~RunManager () | |
Static Public Member Functions | |
static openstudio::path | defaultDBLocation () |
Return default path to use for the RunManager settings/queue database something such as $HOME/.runmanager_default_db. More... | |
static void | simplifyModelForPerformance (openstudio::model::Model &t_model) |
perform some model simplifications that reduce the simulation time with accuracy being an acceptable loss More... | |
Public Attributes | |
void showConfigGui * | t_parent |
Launch the openstudio::runmanager::Configuration UI for choosing configuration options. More... | |
A handle to an underlying RunManager_Impl object, can be copied and passed around freely.
If two RunManager objects are created using the same DB path, the same RunManager is loaded and shared between the two objects. This prevents any issues between file sharing for the DB's and ensures that each instantiation receives the same signals
openstudio::runmanager::RunManager::RunManager | ( | bool | t_paused = false , |
bool | t_initializeui = true , |
||
bool | t_useStatusGUI = true |
||
) |
Construct a RunManager using a new temporary database file for this one use only.
[in] | t_paused | If true the processor is started in paused mode. |
[in] | t_initializeui | If true the application's UI subsystem is initialized. Used in a standalone application that utilized RunManager |
[in] | t_useStatusGUI | Enable the use of Job status GUI elements |
openstudio::runmanager::RunManager::RunManager | ( | const openstudio::path & | DB, |
bool | t_new = false , |
||
bool | t_paused = false , |
||
bool | t_initializeui = true , |
||
bool | t_useStatusGUI = true |
||
) |
Construct a RunManager from a given database file path.
[in] | DB | The file location for the database storing prefs and job queue |
[in] | t_new | If true, the database file is truncated and started from scratch |
[in] | t_paused | If true the processor is started in paused mode. |
[in] | t_initializeui | If true the application's UI subsystem is initialized. Used in a standalone application that utilized RunManager |
[in] | t_useStatusGUI | Enable the use of Job status GUI elements |
openstudio::runmanager::RunManager::~RunManager | ( | ) |
void openstudio::runmanager::RunManager::clearJobs | ( | ) |
safely clears all jobs from the runmanager
bool openstudio::runmanager::RunManager::connect | ( | const char * | signal, |
const QObject * | receiver, | ||
const char * | method, | ||
Qt::ConnectionType | type = Qt::QueuedConnection |
||
) | const |
Connect a Qt SLOT to a signal in the underlying RunManager_Impl object available signals:
signal | signal on RunManager_Impl to connect to |
receiver | object receiving signal |
method | slot on receiver to connect to |
type | type of Qt connection |
bool openstudio::runmanager::RunManager::connect | ( | const QObject * | sender, |
const char * | signal, | ||
const char * | method, | ||
Qt::ConnectionType | type = Qt::QueuedConnection |
||
) | const |
Connect a Qt SIGNAL to a slot in the underlying RunManager_Impl object available slots:
sender | object that SIGNAL is coming from |
signal | signal on object to connect |
method | slot on RunManager_Impl to connect to |
type | type of Qt connection to make |
openstudio::path openstudio::runmanager::RunManager::dbPath | ( | ) | const |
Return the file location this RunManager DB was created from.
|
static |
Return default path to use for the RunManager settings/queue database something such as $HOME/.runmanager_default_db.
void openstudio::runmanager::RunManager::deleteWorkflowByName | ( | const std::string & | t_name | ) |
void openstudio::runmanager::RunManager::deleteWorkflows | ( | ) |
deletes the workflows from the database
bool openstudio::runmanager::RunManager::disconnect | ( | const char * | signal = nullptr , |
const QObject * | receiver = nullptr , |
||
const char * | method = nullptr |
||
) |
Disconnects signal or signals from the underlying RunManager_Impl object.
bool openstudio::runmanager::RunManager::enqueue | ( | const Job & | job, |
bool | force, | ||
const openstudio::path & | basePath = openstudio::path() |
||
) |
bool openstudio::runmanager::RunManager::enqueue | ( | const std::vector< openstudio::runmanager::Job > & | jobs, |
bool | force, | ||
const openstudio::path & | t_basePath = openstudio::path() |
||
) |
Queue up a job (and all children) for processing.
[in] | jobs | Vector of Jobs to enqueue |
[in] | force | Process job even if it is out of date |
[in] | t_basePath | Path by which relative paths in this job should be evaluated. If not provided, the path of the runmanager db is used. |
boost::optional<Job> openstudio::runmanager::RunManager::enqueueOrReturnExisting | ( | const Job & | job, |
bool | force, | ||
const openstudio::path & | basePath = openstudio::path() |
||
) |
openstudio::runmanager::ConfigOptions openstudio::runmanager::RunManager::getConfigOptions | ( | ) | const |
Return a copy of the current openstudio::runmanager::ConfigOptions object.
QModelIndex openstudio::runmanager::RunManager::getIndex | ( | const Job & | t_job | ) | const |
openstudio::runmanager::Job openstudio::runmanager::RunManager::getJob | ( | const openstudio::UUID & | t_uuid | ) | const |
Return the job that is represented by the given openstudio::UUID throw an std::out_of_range if a job with the UUID does not exist.
[in] | t_uuid | UUID to look up |
openstudio::runmanager::Job openstudio::runmanager::RunManager::getJob | ( | const QModelIndex & | t_index | ) | const |
Return the job at the current QModelIndex throw an std::out_of_range if the job could not be found.
[in] | t_index | QModelIndex to look up |
std::vector<openstudio::runmanager::Job> openstudio::runmanager::RunManager::getJobs | ( | ) | const |
Return a vector of all Jobs the RunManager knows about.
std::vector<openstudio::runmanager::Job> openstudio::runmanager::RunManager::getJobs | ( | const QModelIndexList & | t_indexes | ) | const |
QAbstractItemModel* openstudio::runmanager::RunManager::getQItemModel | ( | ) |
Return a QAbstractItemModel which represents the RunManager work queue.
The model is appropriate for using with a QTreeView widget
void openstudio::runmanager::RunManager::hideStatusDialog | ( | ) |
Hide the status dialog.
std::vector<Job> openstudio::runmanager::RunManager::jobsForExport | ( | ) | const |
std::string openstudio::runmanager::RunManager::jobsToJson | ( | ) | const |
void openstudio::runmanager::RunManager::loadJobs | ( | const openstudio::path & | t_db | ) |
Load all of the jobs from the given database file into the current RunManager, enqueuing them.
Workflow openstudio::runmanager::RunManager::loadWorkflow | ( | const std::string & | key | ) | const |
Workflow openstudio::runmanager::RunManager::loadWorkflowByName | ( | const std::string & | t_name | ) | const |
std::vector<Workflow> openstudio::runmanager::RunManager::loadWorkflows | ( | ) | const |
void openstudio::runmanager::RunManager::lowerPriority | ( | const Job & | t_job | ) |
Lower the priority of the given job.
void openstudio::runmanager::RunManager::lowerPriority | ( | const std::vector< Job > & | t_jobs | ) |
Lower the priority of the given jobs.
bool openstudio::runmanager::RunManager::outOfDate | ( | const openstudio::runmanager::Job & | job | ) | const |
Return true if the given job is out of date.
bool openstudio::runmanager::RunManager::paused | ( | ) | const |
std::string openstudio::runmanager::RunManager::persistWorkflow | ( | const Workflow & | _wf | ) |
Persist a workflow to the database.
void openstudio::runmanager::RunManager::raisePriority | ( | const Job & | t_job | ) |
Raise the priority of the given job.
void openstudio::runmanager::RunManager::raisePriority | ( | const std::vector< Job > & | t_jobs | ) |
Raise the priority of the given jobs.
void openstudio::runmanager::RunManager::remove | ( | const openstudio::runmanager::Job & | job | ) |
Remove the given job and all child jobs from the queue.
openstudio::runmanager::Job openstudio::runmanager::RunManager::runWorkflow | ( | const std::string & | t_json, |
const openstudio::path & | t_basePath, | ||
const openstudio::path & | t_runPath, | ||
const openstudio::runmanager::Tools & | t_tools, | ||
const openstudio::runmanager::JSONWorkflowOptions & | t_options | ||
) |
Executes a workflow which is defined by a JSON string from Nick.
To monitor the progress of the workflow use the RunManagerWatcher object
[in] | t_json | the JSON string to execute. See various input files from Nick for definition. |
[in] | t_basePath | the path of the directory containing the input files necessary |
[in] | t_runPath | directory to execute the simulations in |
[in] | t_tools | tools to use for executing job |
[in] | t_options | set of options for job creation |
openstudio::runmanager::Job openstudio::runmanager::RunManager::runWorkflow | ( | const openstudio::path & | t_jsonPath, |
const openstudio::path & | t_basePath, | ||
const openstudio::path & | t_runPath, | ||
const openstudio::runmanager::Tools & | t_tools, | ||
const openstudio::runmanager::JSONWorkflowOptions & | t_options | ||
) |
Executes a workflow which is defined by a JSON string from Nick.
[in] | t_jsonPath | the path to a json file to load and parse |
[in] | t_basePath | the path of the directory containing the input files necessary |
[in] | t_runPath | directory to execute the simulations in |
[in] | t_tools | tools to use for executing job |
[in] | t_options | set of options for job creation |
void openstudio::runmanager::RunManager::setConfigOptions | ( | const openstudio::runmanager::ConfigOptions & | co | ) |
Update the configuration options in one atomic step.
void openstudio::runmanager::RunManager::setOutOfDateRunnable | ( | ) |
Update all out of date jobs to be runnable again Jobs do not automatically restart as soon as they are out of date.
void openstudio::runmanager::RunManager::setPaused | ( | bool | t_paused = true | ) |
set paused state
void openstudio::runmanager::RunManager::showConfigGui | ( | ) |
Launch the openstudio::runmanager::Configuration UI.
This method creates one that is parentless
RunManagerStatusHandle openstudio::runmanager::RunManager::showStatusDialog | ( | ) |
Show a status dialog of the processes taking place if one is not already open.
A handle to the dialog is returned. When the last copy of the handle goes out of scope the dialog is destroyed.
|
static |
perform some model simplifications that reduce the simulation time with accuracy being an acceptable loss
std::map<std::string, double> openstudio::runmanager::RunManager::statistics | ( | ) | const |
void openstudio::runmanager::RunManager::updateJob | ( | const Job & | t_job | ) |
update job tree
void openstudio::runmanager::RunManager::updateJob | ( | const openstudio::UUID & | t_uuid, |
const Job & | t_job | ||
) |
update job tree, and be willing to change the UUID in the process
void openstudio::runmanager::RunManager::updateJob | ( | const Job & | t_job, |
const openstudio::path & | t_dir | ||
) |
update job tree
void openstudio::runmanager::RunManager::updateJobs | ( | const std::string & | t_json, |
bool | t_externallyManaged | ||
) |
Load all of the jobs from the given JSON string, updating job trees.
void openstudio::runmanager::RunManager::updateJobs | ( | const QVariant & | t_variant, |
const VersionString & | t_version, | ||
bool | t_externallyManaged | ||
) |
Load all of the jobs from the given JSON structure represented by a QVariant, updating job trees.
void openstudio::runmanager::RunManager::updateJobs | ( | const std::vector< Job > & | t_jobs | ) |
update job trees
void openstudio::runmanager::RunManager::waitForFinished | ( | int | m_secs = -1 | ) |
Block until the RunManager has finished processing all work.
This method is generally only recommended for a non-gui scenario.
bool openstudio::runmanager::RunManager::workPending | ( | ) | const |
void showConfigGui * openstudio::runmanager::RunManager::t_parent |
Launch the openstudio::runmanager::Configuration UI for choosing configuration options.
t_parent | The parent widget for the created Configuration UI |