MoleQueue 0.9.0
Loading...
Searching...
No Matches
Program Class Reference

#include <molequeue/program.h>

Inheritance diagram for Program:

Public Types

enum  LaunchSyntax {
  CUSTOM = 0 ,
  PLAIN ,
  INPUT_ARG ,
  INPUT_ARG_NO_EXT ,
  REDIRECT ,
  INPUT_ARG_OUTPUT_REDIRECT ,
  SYNTAX_COUNT
}
 

Signals

void nameChanged (const QString &newName, const QString &oldName)
 

Public Member Functions

 Program (Queue *parentQueue=0)
 
 Program (const Program &other)
 
Programoperator= (const Program &other)
 
Serverserver ()
 
const Serverserver () const
 
QueueManagerqueueManager ()
 
const QueueManagerqueueManager () const
 
Queuequeue ()
 
const Queuequeue () const
 
QString queueName () const
 
bool importSettings (const QString &fileName)
 
bool exportSettings (const QString &fileName) const
 
bool writeJsonSettings (QJsonObject &json, bool exportOnly) const
 
bool readJsonSettings (const QJsonObject &json, bool importOnly)
 
void setName (const QString &newName)
 
QString name () const
 
void setExecutable (const QString &str)
 
QString executable () const
 
void setArguments (const QString &str)
 
QString arguments () const
 
void setOutputFilename (const QString &str)
 
QString outputFilename () const
 
void setLaunchSyntax (LaunchSyntax s)
 
LaunchSyntax launchSyntax () const
 
void setCustomLaunchTemplate (const QString &str)
 
QString customLaunchTemplate () const
 
QString launchTemplate () const
 

Static Public Member Functions

static QString generateFormattedExecutionString (const QString &executable_, const QString &arguments_, const QString &outputFilename_, LaunchSyntax syntax_)
 

Protected Attributes

Queuem_queue
 
QueueManagerm_queueManager
 
Serverm_server
 
QString m_name
 
QString m_executable
 
QString m_arguments
 
QString m_outputFilename
 
LaunchSyntax m_launchSyntax
 
QString m_customLaunchTemplate
 

Detailed Description

A class defining interactions with an executable accessible by a Queue.

Author
Marcus D. Hanwell, David C. Lonie

The Program class describes an executable which runs a Job on a particular Queue. Each Program object is unique to the Queue, and contains details for running the executable, any arguments it needs, and the names of files it reads/produces.

Member Enumeration Documentation

◆ LaunchSyntax

Enum used for various common styles of execution syntax.

Enumerator
CUSTOM 

Use custom launch script.

PLAIN 

Only run the executable, e.g. "vasp".

INPUT_ARG 

Single argument is the name of the input file with extension, e.g. "mopac job.mop"

INPUT_ARG_NO_EXT 

Single argument is the name of the input file without extension, e.g. "mopac job"

REDIRECT 

Redirect input file to stdin and stdout to output file, e.g. "gulp < job.gin > job.got"

INPUT_ARG_OUTPUT_REDIRECT 

Input as argument, redirect stdout to output file, e.g. "gamess job.inp > job.out"

SYNTAX_COUNT 

Use to get total number of syntax types.

Member Function Documentation

◆ server() [1/2]

Server * server ( )
Returns
The parent Server

◆ server() [2/2]

const Server * server ( ) const
Returns
The parent Server

◆ queueManager() [1/2]

QueueManager * queueManager ( )
Returns
The parent QueueManager

◆ queueManager() [2/2]

const QueueManager * queueManager ( ) const
Returns
The parent Server

◆ queue() [1/2]

Queue * queue ( )
Returns
The Queue that this Program belongs to.

◆ queue() [2/2]

const Queue * queue ( ) const
Returns
The Queue that this Program belongs to.

◆ queueName()

QString queueName ( ) const
Returns
The name of the Queue that this Program belongs to.

◆ importSettings()

bool importSettings ( const QString & fileName)

Import the program's configuration from the indicated file (.mqp format)

◆ exportSettings()

bool exportSettings ( const QString & fileName) const

Export the program's configuration into the indicated file (.mqp format)

◆ writeJsonSettings()

bool writeJsonSettings ( QJsonObject & json,
bool exportOnly ) const

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

Parameters
valueTarget JSON object.
exportOnlyIf true, instance specific information (e.g. system specific paths, etc) is omitted.
Returns
True on success, false on failure.

◆ readJsonSettings()

bool readJsonSettings ( const QJsonObject & json,
bool importOnly )

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

Parameters
valueSource JSON object.
importOnlyIf true, instance specific information (e.g. system specific paths, etc) is ignored.
Returns
True on success, false on failure.

◆ setName()

void setName ( const QString & newName)

Set the name of the program. This is the name that will show up in the GUI, and many common names such as GAMESS, GAMESS-UK, Gaussian, MolPro etc are used by GUIs such as Avogadro with its input generator dialogs to match up input files to programs.

Parameters
newNameName to use in GUIs

◆ name()

QString name ( ) const
Returns
The name of the program. Often used by GUIs etc.

◆ launchTemplate()

QString launchTemplate ( ) const
Returns
Either the custom launch template or a default generated template, depending on the value of launchSyntax.

◆ nameChanged

void nameChanged ( const QString & newName,
const QString & oldName )
signal

Emitted when the name of the program is changed.

Member Data Documentation

◆ m_queue

Queue* m_queue
protected

The Queue that the Program belongs to/is being run by.

◆ m_queueManager

QueueManager* m_queueManager
protected

The QueueManager owning the Queue this Program belongs to.

◆ m_server

Server* m_server
protected

The Server this program is associated with.

◆ m_name

QString m_name
protected

GUI-visible name.

◆ m_executable

QString m_executable
protected

Name of executable.

◆ m_arguments

QString m_arguments
protected

Executable arguments.

◆ m_outputFilename

QString m_outputFilename
protected

Output filename.

◆ m_launchSyntax

LaunchSyntax m_launchSyntax
protected

Launch syntax style.

◆ m_customLaunchTemplate

QString m_customLaunchTemplate
protected

Bash/Shell/Queue script template used to launch program.


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