MoleQueue  0.8.0
 All Classes Functions Variables Enumerations Enumerator Pages
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
QueueLocal Class Reference

#include <local.h>

Inheritance diagram for QueueLocal:
Queue

Public Slots

bool submitJob (MoleQueue::Job job)
 
void killJob (MoleQueue::Job job)
 
- Public Slots inherited from Queue
virtual bool submitJob (MoleQueue::Job job)=0
 
virtual void killJob (MoleQueue::Job job)=0
 
virtual void setLaunchTemplate (const QString &script)
 
virtual void setLaunchScriptName (const QString &scriptName)
 

Public Member Functions

 QueueLocal (QueueManager *parentManager=0)
 
QString typeName () const
 
bool writeJsonSettings (QJsonObject &json, bool exportOnly, bool includePrograms) const
 
bool readJsonSettings (const QJsonObject &json, bool importOnly, bool includePrograms)
 
AbstractQueueSettingsWidgetsettingsWidget ()
 
int maxNumberOfCores () const
 
void setMaxNumberOfCores (int cores)
 
- Public Member Functions inherited from Queue
Serverserver ()
 
const Serverserver () const
 
QueueManagerqueueManager ()
 
const QueueManagerqueueManager () const
 
virtual void setName (const QString &newName)
 
QString name () const
 
bool readSettings (const QString &filePath)
 
bool writeSettings () const
 
bool exportSettings (const QString &fileName, bool includePrograms=true) const
 
bool importSettings (const QString &fileName, bool includePrograms=true)
 
QString stateFileName () const
 
bool addProgram (Program *newProgram, bool replace=false)
 
bool removeProgram (Program *programToRemove)
 
bool removeProgram (const QString &programName)
 
ProgramlookupProgram (const QString &programName) const
 
QStringList programNames () const
 
QList< Program * > programs () const
 
int numPrograms () const
 
virtual QString launchTemplate () const
 
QString launchScriptName () const
 
int jobFailureCount (IdType moleQueueId) const
 
virtual void replaceKeywords (QString &launchScript, const Job &job, bool addNewline=true)
 

Protected Slots

bool prepareJobForSubmission (Job &job)
 
void processStarted ()
 
void processFinished (int exitCode, QProcess::ExitStatus exitStatus)
 
void processError (QProcess::ProcessError error)
 
- Protected Slots inherited from Queue
virtual void jobAboutToBeRemoved (const MoleQueue::Job &job)
 
void programNameChanged (const QString &newName, const QString &oldName)
 
void cleanLocalDirectory (const MoleQueue::Job &job)
 

Protected Member Functions

bool addJobToQueue (const Job &job)
 
void connectProcess (QProcess *proc)
 
void checkJobQueue ()
 
bool startJob (IdType moleQueueId)
 
void timerEvent (QTimerEvent *theEvent)
 
- Protected Member Functions inherited from Queue
 Queue (const QString &queueName="Undefined", QueueManager *parentManager=0)
 
bool writeInputFiles (const Job &job)
 
bool addJobFailure (IdType moleQueueId)
 
void clearJobFailures (IdType moleQueueId)
 

Protected Attributes

int m_checkJobLimitTimerId
 
QList< IdType > m_pendingJobQueue
 
QMap< IdType, QProcess * > m_runningJobs
 
int m_cores
 
- Protected Attributes inherited from Queue
QueueManagerm_queueManager
 
Serverm_server
 
QString m_name
 
QString m_launchTemplate
 
QString m_launchScriptName
 
QMap< QString, Program * > m_programs
 
QMap< IdType, IdType > m_jobs
 
QMap< IdType, int > m_failureTracker
 

Additional Inherited Members

- Signals inherited from Queue
void programAdded (const QString &name, MoleQueue::Program *program)
 
void programRemoved (const QString &name, MoleQueue::Program *program)
 
void programRenamed (const QString &newName, Program *prog, const QString &oldName)
 
void nameChanged (const QString &newName, const QString &oldName)
 
- Static Public Member Functions inherited from Queue
static QString queueTypeFromFile (const QString &mqqFile)
 

Detailed Description

Queue for running jobs locally.

Member Function Documentation

QString typeName ( ) const
virtual

Returns the type of the queue as a string.

Reimplemented from Queue.

bool writeJsonSettings ( QJsonObject &  value,
bool  exportOnly,
bool  includePrograms 
) const
virtual

writeJsonSettings Write the queue's internal state into a JSON object.

Parameters
valueTarget JSON object.
exportOnlyIf true, instance specific information (e.g. currently running jobs, login details, etc) is omitted.
includeProgramsWhether or not to include the Queue's program configurations.
Returns
True on success, false on failure.

Reimplemented from Queue.

bool readJsonSettings ( const QJsonObject &  value,
bool  importOnly,
bool  includePrograms 
)
virtual

readJsonSettings Initialize the queue's internal state from a JSON object.

Parameters
valueSource JSON object.
importOnlyIf true, instance specific information (e.g. currently running jobs, login details, etc) is ignored.
includeProgramsWhether or not to include the Queue's program configurations.
Returns
True on success, false on failure.
Note
When reimplementing this method, verify and parse the Json object into temporary variables, then call the base class implementation and only modify the queue if the call returns true.

Reimplemented from Queue.

AbstractQueueSettingsWidget* settingsWidget ( )
virtual

Returns a widget that can be used to configure the settings for the queue.

Reimplemented from Queue.

int maxNumberOfCores ( ) const

The number of cores available.

void setMaxNumberOfCores ( int  cores)

The number of cores available.

bool prepareJobForSubmission ( Job job)
protectedslot

Write the input files for the job and add to the queue

Parameters
jobThe Job.
Returns
True on success, false otherwise.
void processStarted ( )
protectedslot

Called when a process starts.

void processFinished ( int  exitCode,
QProcess::ExitStatus  exitStatus 
)
protectedslot

Called when a process exits.

Parameters
exitCodeExit code of process
exitStatusExit status of process
void processError ( QProcess::ProcessError  error)
protectedslot

Called when a error occurs with a process.

Parameters
errorthe specific error that occurred
bool addJobToQueue ( const Job job)
protected

Insert the job into the queue.

void connectProcess ( QProcess *  proc)
protected

Connect proc to handlers prior to submitting job.

void checkJobQueue ( )
protected

Submit any queued jobs that can be started.

bool startJob ( IdType  moleQueueId)
protected

Submit the job with MoleQueue id moleQueueId.

void timerEvent ( QTimerEvent *  theEvent)
protected

Reimplemented to monitor queue events.

Member Data Documentation

int m_checkJobLimitTimerId
protected

Internal timer id.

QList<IdType> m_pendingJobQueue
protected

FIFO queue of MoleQueue ids.

QMap<IdType, QProcess*> m_runningJobs
protected

List of running processes. MoleQueue Id to QProcess*.

int m_cores
protected

The number of cores available.


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