|
AvogadroLibs 1.103.0
|
The BatchJob class manages a collection of jobs that are configured using the same InputGenerator and MoleQueue options. For use with InputGeneratorDialog::configureBatchJob(BatchJob&).
#include <batchjob.h>
Public Types | |
| enum | JobState { Rejected = -2 , Unknown = -1 , None = 0 , Accepted , QueuedLocal , Submitted , QueuedRemote , RunningLocal , RunningRemote , Finished , Canceled , Error } |
| using | BatchId = int |
| using | RequestId = int |
| using | ServerId = unsigned int |
Public Slots | |
| virtual BatchId | submitNextJob (const Core::Molecule &mol) |
| bool | lookupJob (BatchId batchId) |
Signals | |
| void | jobUpdated (Avogadro::MoleQueue::BatchJob::BatchId batchId, bool success) |
| void | jobCompleted (Avogadro::MoleQueue::BatchJob::BatchId batchId, Avogadro::MoleQueue::BatchJob::JobState status) |
Public Member Functions | |
| BatchJob (QObject *parent=nullptr) | |
| BatchJob (const QString &scriptFilePath, QObject *parent=nullptr) | |
| QString | description () const |
| JobState | jobState (BatchId batchId) const |
| ServerId | serverId (BatchId batchId) const |
| JobObject | jobObject (BatchId batchId) const |
| bool | hasUnfinishedJobs () const |
| int | unfinishedJobCount () const |
| int | finishedJobCount () const |
| int | jobCount () const |
| void | setInputGeneratorOptions (const QJsonObject &opts) |
| QJsonObject | inputGeneratorOptions () const |
| void | setMoleQueueOptions (const QJsonObject &opts) |
| QJsonObject | moleQueueOptions () const |
| JobObject | moleQueueJobTemplate () const |
| const InputGenerator & | inputGenerator () const |
| InputGenerator & | inputGenerator () |
Static Public Member Functions | |
| static bool | isTerminal (JobState state) |
Static Public Attributes | |
| static const BatchId | InvalidBatchId |
| static const RequestId | InvalidRequestId |
| static const ServerId | InvalidServerId |
| using BatchId = int |
Type used to identify a job within this batch. Unique to this object.
| using RequestId = int |
Type used to identify requests sent to the MoleQueue server.
| using ServerId = unsigned int |
Type used by MoleQueue to identify jobs. Unique across the connected MoleQueue server.
| enum JobState |
Job status. Same as those defined in molequeueglobal.h. The 'Rejected' state is added to identify jobs that rejected by molequeue prior to having a MoleQueue id (ServerId) set.
|
explicit |
Construct a new BatchJob object. If provided, ese scriptFilePath to setup the input generator.
| void setInputGeneratorOptions | ( | const QJsonObject & | opts | ) |
Options for the input generator.
| QJsonObject inputGeneratorOptions | ( | ) | const |
Options for the input generator.
| void setMoleQueueOptions | ( | const QJsonObject & | opts | ) |
Options for MoleQueue.
| QJsonObject moleQueueOptions | ( | ) | const |
Options for MoleQueue.
| JobObject moleQueueJobTemplate | ( | ) | const |
Options for MoleQueue.
| const InputGenerator & inputGenerator | ( | ) | const |
The internal InputGenerator.
| InputGenerator & inputGenerator | ( | ) |
The internal InputGenerator.
| QString description | ( | ) | const |
A string that will be used in the MoleQueue interface to identify this batch job. Taken from the InputGenerator configured title.
| BatchJob::JobState jobState | ( | BatchJob::BatchId | id | ) | const |
| BatchJob::ServerId serverId | ( | BatchJob::BatchId | id | ) | const |
| JobObject jobObject | ( | BatchJob::BatchId | id | ) | const |
|
static |
| bool hasUnfinishedJobs | ( | ) | const |
| int unfinishedJobCount | ( | ) | const |
| int finishedJobCount | ( | ) | const |
| int jobCount | ( | ) | const |
|
virtualslot |
Submit a job using the current configuration for mol.
|
slot |
Request updated job details from the MoleQueue server for the job with the batch id batchId.
jobUpdated is emitted when the request is complete.
|
signal |
Emitted when the reply from lookupJob is received. success will be false if MoleQueue sends an error response (likely because the job was removed from the job manager).
|
signal |
Emitted when the job associated with batchId completes. status is the final state of the jobs and can be used to determine whether or not the job finished successfully.