MoleQueue  0.8.0
 All Classes Functions Variables Enumerations Enumerator Pages
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
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

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* server ( )
Returns
The parent Server
const Server* server ( ) const
Returns
The parent Server
QueueManager* queueManager ( )
Returns
The parent QueueManager
const QueueManager* queueManager ( ) const
Returns
The parent Server
Queue* queue ( )
Returns
The Queue that this Program belongs to.
const Queue* queue ( ) const
Returns
The Queue that this Program belongs to.
QString queueName ( ) const
Returns
The name of the Queue that this Program belongs to.
bool importSettings ( const QString &  fileName)

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

bool exportSettings ( const QString &  fileName) const

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

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.
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.
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
QString name ( ) const
Returns
The name of the program. Often used by GUIs etc.
QString launchTemplate ( ) const
Returns
Either the custom launch template or a default generated template, depending on the value of launchSyntax.
void nameChanged ( const QString &  newName,
const QString &  oldName 
)
signal

Emitted when the name of the program is changed.

Member Data Documentation

Queue* m_queue
protected

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

QueueManager* m_queueManager
protected

The QueueManager owning the Queue this Program belongs to.

Server* m_server
protected

The Server this program is associated with.

QString m_name
protected

GUI-visible name.

QString m_executable
protected

Name of executable.

QString m_arguments
protected

Executable arguments.

QString m_outputFilename
protected

Output filename.

LaunchSyntax m_launchSyntax
protected

Launch syntax style.

QString m_customLaunchTemplate
protected

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


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