8.3.2. Customizable Commands

RSM will invoke a custom implementation for the following commands:

8.3.2.1. Submit Command

The submit command is invoked to submit a job to the cluster. The command should return as soon as the queuing system has taken ownership of the job and a unique Job ID is available.

The parsing of the output of the submit command is handled by the post command parseSubmit, which will look through all of the output from the submit script, find the Job ID, and return it in a formal manner. For details see Parsing of the Commands Output.

The custom integration infrastructure provides the Python script, ClusterJobs.py, in the [RSMInstall]\Config\scripts directory. The script serves as a layer of abstraction that allows a user-selected operation (such as a component update for one or more of the applications or a design point update) to be invoked without the need to be aware of the command line arguments and options required for the appropriate submission of the job.

In the Submit command, the ClusterJobs.py script should be invoked (rather than executing the individual applications). This Python script should be considered as a layer that builds the appropriate command line and sets the appropriate environment variables for the remote execution. The usage of application specific command line in the Submit script is strongly discouraged and cannot be properly supported in a general way.

For user convenience, the complete Python command that contains the job to be executed by the Submit command (for instance, by LSF bsub) is provided through the environment variable RSM_HPC_COMMAND.

Examples: 

  • Custom server examples for LSF, PBS Pro, SGE, and MSCC are located in the [RSMInstall]\Config\scripts\EXAMPLES directory.

  • A generalized custom client example (for all cluster types) is provided in the file submitGeneric.py, located in the [RSMInstall]\Config\scripts directory.

  • More examples may be available on the ANSYS Customer Portal. For further information about tutorials and documentation on the ANSYS Customer Portal, go to http://support.ansys.com/docinfo.

8.3.2.2. queryStatus Command

The queryStatus command has access to the Job ID through the environment variable RSM_HPC_JOBID. Given a Job ID, the command should query the cluster for the status of the job and return the status of that job in string format.

The output of the queryStatus command should be direct output from the cluster. Any parsing of this output can be done by the post command parseStatus, which will look through all of the output from the queryStatus command, find the job status, and return it in a formal manner. For details see Parsing of the Commands Output.

Examples: 

  • Custom server examples are not provided for this command.

  • A generalized custom client example (for all cluster types) is provided in the file statusGeneric.py, located in the [RSMInstall]\Config\scripts directory.

  • More examples may be available on the ANSYS Customer Portal. For further information about tutorials and documentation on the ANSYS Customer Portal, go to http://support.ansys.com/docinfo.

8.3.2.3. Cancel Command

The cancel command has access to the Job ID through the environment variable RSM_HPC_JOBID. Given a Job ID, the command should invoke the cluster command to cancel the job.

No output is required from the cancel command. However, an output statement should be given for verification in the RSM log.

Examples: 

  • Custom server examples are not provided for this command.

  • A generalized custom client example (for all cluster types) is provided in the file cancelGeneric.py, located in the[RSMInstall]\Config\scripts directory.

8.3.2.4. Transfer Command

The transfer command is invoked in order to transfer files to and from the cluster.

No output is required from the transfer command. However, it is suggested to output the files that are being copied for verification in the RSM log.

The transfer command can check if the environment variable RSM_HPC_FILEDIRECTION equals UPLOAD or DOWNLOAD to detect whether files should be uploaded to the cluster or downloaded from the cluster.

The transfer command is invoked to upload files to and retrieve files from the cluster, as follows:

  • Uploading of files is invoked for input files and also when the user interrupts an application. (Applications typically look for an interrupt file in a specified location.)

  • Retrieving of files is invoked for output files once the job is completed. It is also invoked for inquiring (downloading) files during the execution of the job. Inquiring of files is typically invoked from Workbench for small files (such as convergence information).

The list of files to be uploaded or downloaded is provided through a semi-colon delimited list in the environment variable RSM_HPC_FILELIST. File names can possibly contain wildcards (for example *.out). The files are located in the current Working Directory in which the script is invoked (that is, the RSM job Working Directory).

The command can also access the environment variable RSM_HPC_FILECONTEXT is set to INPUTS (beginning of job), OUTPUTS (end of job), CANCEL (cancelling a job) or INQUIRE (request for files while job running). This information may be useful especially in the case of inquire, when extra processing may be required to locate files for a running job.

Examples: 

  • Custom server integrations do not use this command.

  • A custom client example is provided in the file transferSSH.py, located in the [RSMInstall]\Config\scripts directory.

  • More examples may be available on the ANSYS Customer Portal. For further information about tutorials and documentation on the ANSYS Customer Portal, go to http://support.ansys.com/docinfo.

8.3.2.5. Cleanup Command

The cleanup command is called at the very end of the execution when all the other actions have been completed. It can be used by the user to perform clean-up operation or other actions that are needed at the end of a job.

No output is required from the cleanup command. However, an output statement should be given for verification in the RSM log.

Examples: 

  • Custom server integrations do not use this command.

  • A custom client example is provided in the file cleanupSSH.py, located in the [RSMInstall]\Config\scripts directory.

  • More examples may be available on the ANSYS Customer Portal. For further information about tutorials and documentation on the ANSYS Customer Portal, go to http://support.ansys.com/docinfo.


Release 18.2 - © ANSYS, Inc. All rights reserved.