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

#include <molequeue/jobdata.h>

Public Member Functions

 JobData (JobManager *parentManager)
 
 JobData (const JobData &)
 
JobManagerjobManager () const
 
void setQueue (const QString &newQueue)
 
QString queue () const
 
void setProgram (const QString &newProgram)
 
QString program () const
 
void setJobState (JobState state)
 
JobState jobState () const
 
void setDescription (const QString &newDesc)
 
QString description () const
 
void setInputFile (const FileSpecification &filespec)
 
FileSpecification inputFile () const
 
void setAdditionalInputFiles (const QList< FileSpecification > &files)
 
QList< FileSpecificationadditionalInputFiles () const
 
QList< FileSpecification > & additionalInputFilesRef ()
 
void setOutputDirectory (const QString &path)
 
QString outputDirectory () const
 
void setLocalWorkingDirectory (const QString &path)
 
QString localWorkingDirectory () const
 
void setCleanRemoteFiles (bool clean)
 
bool cleanRemoteFiles () const
 
void setRetrieveOutput (bool b)
 
bool retrieveOutput () const
 
void setCleanLocalWorkingDirectory (bool b)
 
bool cleanLocalWorkingDirectory () const
 
void setHideFromGui (bool b)
 
bool hideFromGui () const
 
void setPopupOnStateChange (bool b)
 
bool popupOnStateChange () const
 
void setNumberOfCores (int num)
 
int numberOfCores () const
 
void setMaxWallTime (int minutes)
 
int maxWallTime () const
 
void setMoleQueueId (IdType id)
 
IdType moleQueueId () const
 
void setQueueId (IdType id)
 
IdType queueId () const
 
QHash< QString, QString > & keywordsRef ()
 
void setKeywords (const QHash< QString, QString > &keyrep)
 
QHash< QString, QString > keywords () const
 
QJsonObject toJsonObject () const
 
void setFromJson (const QJsonObject &state)
 
bool load (const QString &stateFilename)
 
bool save ()
 
bool needsSync () const
 
void modified ()
 

Protected Attributes

JobManagerm_jobManager
 
QString m_queue
 
QString m_program
 
JobState m_jobState
 
QString m_description
 
FileSpecification m_inputFile
 
QList< FileSpecificationm_additionalInputFiles
 
QString m_outputDirectory
 
QString m_localWorkingDirectory
 
bool m_cleanRemoteFiles
 
bool m_retrieveOutput
 
bool m_cleanLocalWorkingDirectory
 
bool m_hideFromGui
 
bool m_popupOnStateChange
 
int m_numberOfCores
 
int m_maxWallTime
 
IdType m_moleQueueId
 
IdType m_queueId
 
QHash< QString, QString > m_keywords
 
bool m_needsSync
 

Detailed Description

Internal container for job details.

Author
David C. Lonie

Each JobData instance stores information about a specific job. All JobData objects are owned by a JobManager, which dispenses JobReferenceBase subclasses (Job and JobRequest) that are used to interact with the JobData members.

Member Function Documentation

JobManager* jobManager ( ) const
Returns
The parent JobManager
void setQueue ( const QString &  newQueue)
Parameters
newQueuename of the queue.
QString queue ( ) const
Returns
Name of queue to use.
void setProgram ( const QString &  newProgram)
Parameters
newProgramName of the program.
QString program ( ) const
Returns
Name of program to run.
void setJobState ( JobState  state)
Parameters
stateStatus of job
JobState jobState ( ) const
Returns
Status of job
void setDescription ( const QString &  newDesc)
Parameters
newDescDescription of job
QString description ( ) const
Returns
newDesc Description of job
void setInputFile ( const FileSpecification filespec)
Parameters
filespecFileSpecification describing the main input file (called by the executable)
FileSpecification inputFile ( ) const
Returns
FileSpecification describing the main input file (called by the executable)
void setAdditionalInputFiles ( const QList< FileSpecification > &  files)
Parameters
filesFileSpecification objects describing additional input files to be placed in the working directory of the job prior to execution.
QList<FileSpecification> additionalInputFiles ( ) const
Returns
FileSpecification objects describing additional input files to be placed in the working directory of the job prior to execution.
QList<FileSpecification>& additionalInputFilesRef ( )
Returns
A reference to the additional input files list.
void setOutputDirectory ( const QString &  path)
Parameters
pathString containing a location to copy the output files to after the job completes. Ignored if empty.
QString outputDirectory ( ) const
Returns
String containing a location to copy the output files to after the job completes. Ignored if empty.
void setLocalWorkingDirectory ( const QString &  path)
Parameters
pathTemporary working directory where files are stored during job execution.
QString localWorkingDirectory ( ) const
Returns
Temporary working directory where files are stored during job execution.
void setCleanRemoteFiles ( bool  clean)
Parameters
cleanIf true, delete any working files on the remote server. Default: false.
bool cleanRemoteFiles ( ) const
Returns
If true, delete any working files on the remote server. Default: false.
void setRetrieveOutput ( bool  b)
Parameters
bIf true, copies files back from remote server. Default: true
bool retrieveOutput ( ) const
Returns
If true, copies files back from remote server. Default: true
void setCleanLocalWorkingDirectory ( bool  b)
Parameters
bIf true, the local working files are removed after job is complete. Should be used with setOutputDirectory. Default: false
bool cleanLocalWorkingDirectory ( ) const
Returns
If true, the local working files are removed after job is complete. Should be used with setOutputDirectory. Default: false
void setHideFromGui ( bool  b)
Parameters
bIf true, the job will not appear in the queue. Default: false
bool hideFromGui ( ) const
Returns
If true, the job will not appear in the queue. Default: false
void setPopupOnStateChange ( bool  b)
Parameters
bIf true, changes in the job state will trigger a popup notification from the MoleQueue system tray icon. Default: false
bool popupOnStateChange ( ) const
Returns
If true, changes in the job state will trigger a popup notification from the MoleQueue system tray icon. Default: false
void setNumberOfCores ( int  num)
Parameters
numThe total number of processor cores to use (if applicable). Default: 1
int numberOfCores ( ) const
Returns
The total number of processor cores to use (if applicable). Default: 1
void setMaxWallTime ( int  minutes)
Parameters
minutesThe maximum walltime for this job in minutes. Setting this to a value <= 0 will use the queue-specific default max walltime. Only available for remote queues. Default is -1.
int maxWallTime ( ) const
Returns
The maximum walltime for this job in minutes. Setting this to a value <= 0 will use the queue-specific default max walltime. Only available for remote queues. Default is -1.
void setMoleQueueId ( IdType  id)
Parameters
idInternal MoleQueue identifier
IdType moleQueueId ( ) const
Returns
Internal MoleQueue identifier
void setQueueId ( IdType  id)
Parameters
idQueue Job ID
IdType queueId ( ) const
Returns
Queue Job ID
QHash<QString, QString>& keywordsRef ( )
Returns
A reference to the job's keyword hash
void setKeywords ( const QHash< QString, QString > &  keyrep)
Parameters
keyrepThe keyword replacement hash
QHash<QString, QString> keywords ( ) const
Returns
The keyword replacement hash
QJsonObject toJsonObject ( ) const
Returns
The Job's internal state as a QJsonObject
void setFromJson ( const QJsonObject &  state)

Update the Job's internal state from a QJsonObject.

bool load ( const QString &  stateFilename)

Initialize the JobData from the state in JSON file stateFileName.

bool save ( )

Write a mqjobinfo.json file to the JobData's local working directory with the job state.

bool needsSync ( ) const
Returns
true if the JobData has changed since load() or save() was called.
void modified ( )

Called when the JobData is modified.

Member Data Documentation

JobManager* m_jobManager
protected

Parent JobManager.

QString m_queue
protected

Name of queue to use.

QString m_program
protected

Name of program to run.

JobState m_jobState
protected

Current state of job.

QString m_description
protected

Description of job.

FileSpecification m_inputFile
protected

FileSpecification describing the main input file (called by the executable)

QList<FileSpecification> m_additionalInputFiles
protected

FileSpecification objects describing additional input files, to be placed in the working directory of the job prior to execution.

QString m_outputDirectory
protected

String containing a location to copy the output files to after the job completes. Ignored if empty.

QString m_localWorkingDirectory
protected

Temporary working directory where files are stored during job execution.

bool m_cleanRemoteFiles
protected

If true, delete any working files on the remote server. Default: false.

bool m_retrieveOutput
protected

If true, copies files back from remote server. Default: true.

bool m_cleanLocalWorkingDirectory
protected

If true, the local working files are removed after job is complete. Should be used with setOutputDirectory. Default: false

bool m_hideFromGui
protected

If true, the job will not appear in the queue. Default: false.

bool m_popupOnStateChange
protected

If true, changes in the job state will trigger a popup notification from the MoleQueue system tray icon. Default: true

int m_numberOfCores
protected

The total number of processor cores to use (if applicable). Default: 1

int m_maxWallTime
protected

The maximum walltime for this job in minutes. Setting this to a value <= 0 will use the queue-specific default max walltime. Only available for remote queues. Default is -1.

IdType m_moleQueueId
protected

Internal MoleQueue identifier.

IdType m_queueId
protected

Queue Job ID.

QHash<QString, QString> m_keywords
protected

List of custom keyword replacements for the job's launch script.

bool m_needsSync
protected

True if the JobData has changed since load() or save() was called.


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