Queue class

The Queue class is an abstract base class. All other analysis batch queue classes are derived from it. The class has no explicit constructor or members. The following methods of the Queue class are common to all derived classes:

__repr__(...)

This method returns the class name as a string. The string is printed as a description for the queue when abaqus information=environment is executed. Derived classes should override this method to provide a useful description of the queue objects instantiated from them.

createScript(...)

This method creates a Python script named job-name.com in the current working directory. This script is used to run the analysis. This method is called by the analysis execution procedure prior to the submit method. If the job-name.com file cannot be written in the current working directory, a FileCreationError exception is raised. The following argument is required:

options

A dictionary containing the analysis options.

getDriverName(...)

This method returns the name of the command used to invoke the Abaqus execution procedure.

getPython(...)

This method returns the absolute path to the Abaqus Python interpreter as a string.

getNumRequiredTokens(...)

This method returns the number of license tokens required for an analysis as an integer. The following argument is required:

options

A dictionary containing the analysis options.

spawn(...)

This method executes a command in a new process, waits for it to complete, and returns an integer representing the exit status of the command. If the command cannot be executed, a SpawnError exception is raised. The following arguments are required:

cmd

A valid command string to be executed in the new process. If analyses are submitted to this queue from Abaqus/CAE, the command must return the status immediately; otherwise, the ability to monitor the progress of the analysis jobs in Abaqus/CAE may fail. Examples of commands that return the status immediately are qsub, bsub, at, batch, etc.

env

A dictionary of environment variables available to the process.

The following argument is optional:

verbose

A Boolean specifying whether the command string is printed to stdout. The default value is OFF.

submit(...)

This abstract method must be implemented by a derived class. This method is called by the analysis execution procedure to submit the analysis to a queue. The submit method must return an integer; a value of 0 indicates success, and a nonzero value indicates failure. When this method is called, the analysis execution procedure supplies the following required arguments:

options

A dictionary containing the analysis options.

env

A dictionary of environment variables available to the process.

Most derived classes call the spawn method from this method and return its exit status.