MoleQueue 0.9.0
Loading...
Searching...
No Matches
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 * jobManager ( ) const
Returns
The parent JobManager

◆ setQueue()

void setQueue ( const QString & newQueue)
Parameters
newQueuename of the queue.

◆ queue()

QString queue ( ) const
Returns
Name of queue to use.

◆ setProgram()

void setProgram ( const QString & newProgram)
Parameters
newProgramName of the program.

◆ program()

QString program ( ) const
Returns
Name of program to run.

◆ setJobState()

void setJobState ( JobState state)
Parameters
stateStatus of job

◆ jobState()

JobState jobState ( ) const
Returns
Status of job

◆ setDescription()

void setDescription ( const QString & newDesc)
Parameters
newDescDescription of job

◆ description()

QString description ( ) const
Returns
newDesc Description of job

◆ setInputFile()

void setInputFile ( const FileSpecification & filespec)
Parameters
filespecFileSpecification describing the main input file (called by the executable)

◆ inputFile()

FileSpecification inputFile ( ) const
Returns
FileSpecification describing the main input file (called by the executable)

◆ setAdditionalInputFiles()

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.

◆ additionalInputFiles()

QList< FileSpecification > additionalInputFiles ( ) const
Returns
FileSpecification objects describing additional input files to be placed in the working directory of the job prior to execution.

◆ additionalInputFilesRef()

QList< FileSpecification > & additionalInputFilesRef ( )
Returns
A reference to the additional input files list.

◆ setOutputDirectory()

void setOutputDirectory ( const QString & path)
Parameters
pathString containing a location to copy the output files to after the job completes. Ignored if empty.

◆ outputDirectory()

QString outputDirectory ( ) const
Returns
String containing a location to copy the output files to after the job completes. Ignored if empty.

◆ setLocalWorkingDirectory()

void setLocalWorkingDirectory ( const QString & path)
Parameters
pathTemporary working directory where files are stored during job execution.

◆ localWorkingDirectory()

QString localWorkingDirectory ( ) const
Returns
Temporary working directory where files are stored during job execution.

◆ setCleanRemoteFiles()

void setCleanRemoteFiles ( bool clean)
Parameters
cleanIf true, delete any working files on the remote server. Default: false.

◆ cleanRemoteFiles()

bool cleanRemoteFiles ( ) const
Returns
If true, delete any working files on the remote server. Default: false.

◆ setRetrieveOutput()

void setRetrieveOutput ( bool b)
Parameters
bIf true, copies files back from remote server. Default: true

◆ retrieveOutput()

bool retrieveOutput ( ) const
Returns
If true, copies files back from remote server. Default: true

◆ setCleanLocalWorkingDirectory()

void setCleanLocalWorkingDirectory ( bool b)
Parameters
bIf true, the local working files are removed after job is complete. Should be used with setOutputDirectory. Default: false

◆ cleanLocalWorkingDirectory()

bool cleanLocalWorkingDirectory ( ) const
Returns
If true, the local working files are removed after job is complete. Should be used with setOutputDirectory. Default: false

◆ setHideFromGui()

void setHideFromGui ( bool b)
Parameters
bIf true, the job will not appear in the queue. Default: false

◆ hideFromGui()

bool hideFromGui ( ) const
Returns
If true, the job will not appear in the queue. Default: false

◆ setPopupOnStateChange()

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

◆ popupOnStateChange()

bool popupOnStateChange ( ) const
Returns
If true, changes in the job state will trigger a popup notification from the MoleQueue system tray icon. Default: false

◆ setNumberOfCores()

void setNumberOfCores ( int num)
Parameters
numThe total number of processor cores to use (if applicable). Default: 1

◆ numberOfCores()

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

◆ setMaxWallTime()

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.

◆ maxWallTime()

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.

◆ setMoleQueueId()

void setMoleQueueId ( IdType id)
Parameters
idInternal MoleQueue identifier

◆ moleQueueId()

IdType moleQueueId ( ) const
Returns
Internal MoleQueue identifier

◆ setQueueId()

void setQueueId ( IdType id)
Parameters
idQueue Job ID

◆ queueId()

IdType queueId ( ) const
Returns
Queue Job ID

◆ keywordsRef()

QHash< QString, QString > & keywordsRef ( )
Returns
A reference to the job's keyword hash

◆ setKeywords()

void setKeywords ( const QHash< QString, QString > & keyrep)
Parameters
keyrepThe keyword replacement hash

◆ keywords()

QHash< QString, QString > keywords ( ) const
Returns
The keyword replacement hash

◆ toJsonObject()

QJsonObject toJsonObject ( ) const
Returns
The Job's internal state as a QJsonObject

◆ setFromJson()

void setFromJson ( const QJsonObject & state)

Update the Job's internal state from a QJsonObject.

◆ load()

bool load ( const QString & stateFilename)

Initialize the JobData from the state in JSON file stateFileName.

◆ save()

bool save ( )

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

◆ needsSync()

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

◆ modified()

void modified ( )

Called when the JobData is modified.

Member Data Documentation

◆ m_jobManager

JobManager* m_jobManager
protected

Parent JobManager.

◆ m_queue

QString m_queue
protected

Name of queue to use.

◆ m_program

QString m_program
protected

Name of program to run.

◆ m_jobState

JobState m_jobState
protected

Current state of job.

◆ m_description

QString m_description
protected

Description of job.

◆ m_inputFile

FileSpecification m_inputFile
protected

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

◆ m_additionalInputFiles

QList<FileSpecification> m_additionalInputFiles
protected

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

◆ m_outputDirectory

QString m_outputDirectory
protected

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

◆ m_localWorkingDirectory

QString m_localWorkingDirectory
protected

Temporary working directory where files are stored during job execution.

◆ m_cleanRemoteFiles

bool m_cleanRemoteFiles
protected

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

◆ m_retrieveOutput

bool m_retrieveOutput
protected

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

◆ m_cleanLocalWorkingDirectory

bool m_cleanLocalWorkingDirectory
protected

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

◆ m_hideFromGui

bool m_hideFromGui
protected

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

◆ m_popupOnStateChange

bool m_popupOnStateChange
protected

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

◆ m_numberOfCores

int m_numberOfCores
protected

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

◆ m_maxWallTime

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.

◆ m_moleQueueId

IdType m_moleQueueId
protected

Internal MoleQueue identifier.

◆ m_queueId

IdType m_queueId
protected

Queue Job ID.

◆ m_keywords

QHash<QString, QString> m_keywords
protected

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

◆ m_needsSync

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: