This section presents information on how you can define external applications using XML. See Defining External Applications Directly in EKM if you want to define an application using a dialog box in EKM.
application.xsd defines the format for .app.xml (or .appxml) files that
are used to define the external applications in EKM. The listing
for the application.xsd schema definition file
is shown in Figure 9.4: File listing for application.xsd Schema File. A full listing
is provided in the EKM_HOME/schema folder.
application.xsd consists of a root element
named applications that contains one application element. The application
element consists of a key, execPath, 0 or more param elements, 0 or more env elements and an optional nativeOptions element.
keyUsed to identify the application. For example, a batch node in a process will use the key to refer to a particular external application.
labelThe name that will be used to identify the application in the interface (for example, in the job wizard, or in the Job Details view).
execPathDefines the full path of the application executable. This must correspond to the fully qualified application path on the execution host.
paramCan be used to specify command line parameters. Each command line parameters is defined separately. You should not define just a single parameter and use space as a separator for multiple parameters.
envCan be used for environment variables. Each env element consists of a name and value attribute.
nativeOptionsSpecifies any batch submission system-specific options.
This is useful if you integrate with a queuing or batch submission
system such as LSF and you want to specify some additional parameters
for controlling the job execution. You can use the nativeOptions element to control the resources granted to a batch job (such as
OS type, number of nodes, minimum RAM, and so on). For example, for
an SGE system, you could define:
<nativeOptions>-hard -l arch="lx24 amd64"</nativeOptions>
to specify that the job can run only on machines matching that architecture.
Figure 9.4: File listing for application.xsd Schema File
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ansys.com/ekm/application" xmlns:ekmApplication="http://www.ansys.com/ekm/application"> <xsd:complexType name="NameValue"> <xsd:attribute name="name" type="xsd:string" use="required" /> <xsd:attribute name="value" type="xsd:string" use="required" /> </xsd:complexType> <xsd:complexType name="Application"> <xsd:sequence> <xsd:element name="key" type="xsd:string"/> <xsd:element name="label" type="xsd:string" minOccurs="0"/> <xsd:element name="execPath" type="xsd:string"/> <xsd:element name="param" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="env" type="ekmApplication:NameValue" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="nativeOptions" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Applications"> <xsd:sequence> <xsd:element name="application" type="ekmApplication:Application" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> <xsd:element name="applications" type="ekmApplication:Applications" /> </xsd:schema>
Application definitions are stored in XML files in EKM. Because of this, EKM supports adding new applications simply by uploading XML files in the proper format. See Schema Definition for Applications for details on the format of these files. Only one application is defined per file.
Once you have defined an application in an XML file and saved it with the .app.xml or .appxml file extension, you can upload it to an existing queue. EKM will recognize the file as an External Application type based on its file extension.
For example, to add an application to the Local queue, go to /Administration/Servers/Master/Local, and then upload the application using the
(Upload) > Files/Archives Using the
Browser action. The usual naming convention is to name
the file after the Application key. For example,
if the Application key is myAppKey, the file name is myAppKey.app.xml.
The content of the sample application named myAppKey.app.xml is shown in Figure 9.5: myAppKey.app.xml listing.
Figure 9.5: myAppKey.app.xml listing
<?xml version="1.0" encoding="UTF-8"?>
<ekmApplication:applications xmlns:ekmApplication="http://www.ansys.com/ekm/application"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<application>
<key>myAppKey</key>
<label>My Application</label>
<execPath>{$APP_PATH}/myApp.exe</execPath>
<param>-x</param>
<param>1</param>
<env name="VAR1" value="a" />
<env name="VAR2" value="b" />
<nativeOptions />
</application>
</ekmApplication:applications>
When configuring external applications, you can use the syntax {$ENV_NAME} to include the value of an environment variable
while defining any of the application’s element values such
as execPath, param, or env.
Important: Always use the forward slash (/) as a path separator in all configuration files even when running EKM on Windows.