blob: aa9468cba0e3c19ceb89f25b29a5e7e7199cf36f [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!-- ******************************************************************************* -->
<!-- * Copyright (c) 2011 University of Illinois All rights reserved. This program -->
<!-- * and the accompanying materials are made available under the terms of the -->
<!-- * Eclipse Public License v1.0 which accompanies this distribution, and is -->
<!-- * available at http://www.eclipse.org/legal/epl-v10.html -->
<!-- * -->
<!-- * Contributors: -->
<!-- * Albert L. Rossi - design and implementation -->
<!-- ****************************************************************************** -->
<resource-manager-builder xmlns="http://org.eclipse.ptp/rm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="resource_manager_type.xsd" name="demo-example-full">
<control-data>
<!-- this is a necessary property for the functioning of LML; link it to the batch-specific variable name -->
<property name="control.queue.name" visible="false">
<link-value-to>destination</link-value-to>
</property>
<!-- we set this to invisible because the values are not really modifiable -->
<property name="queues" visible="false"/>
<!-- needed by RM internals for fetch; name is fixed by convention -->
<property name="stdout_remote_path" visible="false">
<default>${ptp_rm:directory#value}/${ptp_rm:Job_Name#value}.o${ptp_rm:@jobId#default}</default>
<link-value-to>Output_Path</link-value-to>
</property>
<!-- needed by RM internals for fetch; name is fixed by convention -->
<property name="stderr_remote_path" visible="false">
<default>${ptp_rm:directory#value}/${ptp_rm:Job_Name#value}.e${ptp_rm:@jobId#default}</default>
<link-value-to>Error_Path</link-value-to>
</property>
<property name="local.input.file" visible="true"/>
<property name="remote.input.files" visible="false"/>
<attribute name="remote.input.file" visible="true" type="choice">
<items-from>remote.input.files</items-from>
</attribute>
<attribute name="mpiCommand" type="string">
<description>Which mpi command to use.</description>
</attribute>
<attribute name="mpiCores" min="1" type="integer">
<description>the '-np' value</description>
</attribute>
<attribute name="destination" type="string">
<description>Designation of the queue to which to submit the job.</description>
</attribute>
<attribute name="Error_Path" type="string">
<description>The final path name for the file containing the job's standard error stream.</description>
</attribute>
<attribute name="Job_Name" type="string">
<description>The name assigned to the job by the qsub or qalter command.</description>
<default>ptp_job</default>
<validator>
<regex expression="[a-zA-Z_][0-9a-zA-Z_]*"/>
<error-message>must be at least one alphanumeric character</error-message>
</validator>
</attribute>
<attribute name="Output_Path" type="string">
<description>The final path name for the file containing the job's standard output stream.</description>
</attribute>
<attribute name="Resource_List.mem" type="string">
<description>Maximum amount of memory used by all concurrent processes in the job.</description>
</attribute>
<attribute name="Resource_List.nodes" type="string">
<description>Number and/or type of nodes to be reserved for exclusive use by the job.</description>
<default>1</default>
</attribute>
<attribute name="Resource_List.walltime" type="string">
<description>Maximum amount of real time during which the job can be in the running state.</description>
<default>00:30:00</default>
<validator>
<regex expression="\d\d:\d\d:\d\d"/>
<error-message>format must be hh:mm:ss</error-message>
</validator>
</attribute>
<managed-files>
<file-staging-location>.eclipsesettings</file-staging-location>
<file name="menu.input">
<path>${ptp_rm:local.input.file#value}</path>
</file>
</managed-files>
<script>
<line>
<arg>#!/bin/bash</arg>
</line>
<line>
<arg isUndefinedIfMatches="#PBS -q">#PBS -q ${ptp_rm:destination#value}</arg>
</line>
<line>
<arg isUndefinedIfMatches="#PBS -e">#PBS -e ${ptp_rm:Error_Path#value}</arg>
</line>
<line>
<arg isUndefinedIfMatches="#PBS -N">#PBS -N ${ptp_rm:Job_Name#value}</arg>
</line>
<line>
<arg isUndefinedIfMatches="#PBS -o">#PBS -o ${ptp_rm:Output_Path#value}</arg>
</line>
<line>
<arg isUndefinedIfMatches="#PBS -l mem=">#PBS -l mem=${ptp_rm:Resource_List.mem#value}</arg>
</line>
<line>
<arg isUndefinedIfMatches="#PBS -l nodes=">#PBS -l nodes=${ptp_rm:Resource_List.nodes#value}</arg>
</line>
<line>
<arg isUndefinedIfMatches="#PBS -l walltime=">#PBS -l walltime=${ptp_rm:Resource_List.walltime#value}</arg>
</line>
<line>
<arg>#PBS -V</arg>
</line>
<line>
<arg>MPI_ARGS="-np ${ptp_rm:mpiCores#value}"</arg>
</line>
<line>
<arg resolve="false">if [ "-np" == "${MPI_ARGS}" ] ; then</arg>
</line>
<line>
<arg resolve="false"> MPI_ARGS=</arg>
</line>
<line>
<arg resolve="false">fi</arg>
</line>
<line>
<arg>COMMAND=${ptp_rm:mpiCommand#value}</arg>
</line>
<line>
<arg resolve="false">if [ -n "${COMMAND}" ] ; then</arg>
</line>
<line>
<arg resolve="false"> COMMAND="${COMMAND} ${MPI_ARGS}</arg>
<arg>${ptp_rm:executablePath#value} ${ptp_rm:progArgs#value}</arg>
<arg resolve="false">${INPUT}"</arg>
</line>
<line>
<arg resolve="false">else</arg>
</line>
<line>
<arg> COMMAND="${ptp_rm:executablePath#value} ${ptp_rm:progArgs#value}</arg>
<arg resolve="false">${INPUT}"</arg>
</line>
<line>
<arg resolve="false">fi</arg>
</line>
<line>
<arg isUndefinedIfMatches="cd">cd ${ptp_rm:directory#value}</arg>
</line>
<line>
<arg>env</arg>
<arg>&gt;</arg>
<arg>ENV</arg>
</line>
<line>
<arg resolve="false">${COMMAND}</arg>
</line>
</script>
<start-up-command name="get-queues">
<arg>qstat</arg>
<arg>-Q</arg>
<arg>-f</arg>
<stdout-parser delim="\n">
<target ref="queues">
<match>
<expression>Queue: ([\w\d]+)</expression>
<add field="value">
<entry valueGroup="1"/>
</add>
</match>
</target>
</stdout-parser>
</start-up-command>
<submit-batch name="submit-batch" waitForId="true">
<arg>qsub</arg>
<arg>${ptp_rm:managed_file_for_script#value}</arg>
<environment name="INPUT">
<arg isUndefinedIfMatches="-f">-f ${ptp_rm:remote.input.file#value}</arg>
</environment>
<environment name="INPUT">
<arg isUndefinedIfMatches="-f">-f ${ptp_rm:menu.input#value}</arg>
</environment>
<stdout-parser delim="\n" all="true" save="1">
<target ref="@jobId">
<match>
<expression>([\d]+)([.])(.+)[\s]+.*</expression>
<append field="name">
<entry valueGroup="1"/>
<entry valueGroup="2"/>
<entry valueGroup="3"/>
</append>
<set field="default">
<entry valueGroup="1"/>
</set>
<set field="value">
<entry value="SUBMITTED"/>
</set>
</match>
<match>
<expression>([\d]+)[.].+</expression>
<set field="name">
<entry valueGroup="0"/>
</set>
<set field="default">
<entry valueGroup="1"/>
</set>
<set field="value">
<entry value="SUBMITTED"/>
</set>
</match>
</target>
<target ref="@jobId">
<match>
<expression flags="DOTALL">.*Job not submitted.*</expression>
<set field="value">
<entry value="FAILED"/>
</set>
</match>
</target>
</stdout-parser>
<stderr-parser delim="\n">
<target ref="@jobId">
<match>
<expression>.*Job not submitted.*</expression>
<throw message="Job Submit Failed"/>
</match>
</target>
</stderr-parser>
</submit-batch>
<get-job-status name="get-job-status" ignoreExitStatus="true">
<arg>qstat</arg>
<arg>${ptp_rm:@jobId#name}</arg>
<stdout-parser delim="\n">
<target ref="@jobId">
<match>
<expression>[\d]+[.].+[\s]+.+[\s]+.+[\s]+.+[\s]+([A-Z])[\s]+.+</expression>
<set field="value">
<entry valueGroup="1"/>
</set>
</match>
<test op="EQ">
<value>#value</value>
<value>Q</value>
<set field="value">
<entry value="QUEUED_ACTIVE"/>
</set>
</test>
<test op="EQ">
<value>#value</value>
<value>R</value>
<set field="value">
<entry value="RUNNING"/>
</set>
</test>
<test op="EQ">
<value>#value</value>
<value>S</value>
<set field="value">
<entry value="SUSPENDED"/>
</set>
</test>
<test op="EQ">
<value>#value</value>
<value>C</value>
<set field="value">
<entry value="COMPLETED"/>
</set>
</test>
<test op="EQ">
<value>#value</value>
<value>E</value>
<set field="value">
<entry value="COMPLETED"/>
</set>
</test>
<test op="EQ">
<value>#value</value>
<value>H</value>
<set field="value">
<entry value="SYSTEM_ON_HOLD"/>
</set>
</test>
</target>
</stdout-parser>
<stderr-parser delim="\n">
<target ref="@jobId">
<match>
<expression>.+</expression>
<set field="value">
<entry value="COMPLETED"/>
</set>
</match>
</target>
</stderr-parser>
</get-job-status>
<terminate-job name="cancel" ignoreExitStatus="true">
<arg>qdel</arg>
<arg>${ptp_rm:@jobId#name}</arg>
</terminate-job>
<button-action name="get-input">
<arg>ls</arg>
<arg>-l</arg>
<arg>${ptp_rm:directory#value}/input</arg>
<stdout-parser delim="\n">
<target ref="remote.input.files">
<match>
<expression>[-drwx+@]+.+[\d:]+[\s]+(.+)</expression>
<add field="value">
<entry valueGroup="1"/>
</add>
</match>
</target>
</stdout-parser>
</button-action>
<launch-tab>
<dynamic>
<title>Demo Example</title>
<layout>
<grid-layout/>
</layout>
<composite>
<layout>
<fill-layout type="SWT.HORIZONTAL"/>
</layout>
<composite group="true">
<layout>
<grid-layout numColumns="3" makeColumnsEqualWidth="false" horizontalSpacing="10" verticalSpacing="15"/>
</layout>
<!-- row 1 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>Job Name: </fixed-text>
</widget>
<widget type="text" style="SWT.BORDER" saveValueTo="Job_Name">
<layout-data>
<grid-data horizontalAlign="SWT.FILL" horizontalSpan="2" grabExcessHorizontal="false" widthHint="150"/>
</layout-data>
</widget>
<!-- row 2 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>Queue: </fixed-text>
</widget>
<widget type="combo" style="SWT.BORDER" readOnly="true" saveValueTo="destination">
<layout-data>
<grid-data horizontalAlign="SWT.FILL" horizontalSpan="2" grabExcessHorizontal="false"/>
</layout-data>
<items-from>queues</items-from>
</widget>
<!-- row 3 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>Wallclock Time: </fixed-text>
</widget>
<widget type="text" style="SWT.BORDER" saveValueTo="Resource_List.walltime">
<layout-data>
<grid-data horizontalAlign="SWT.FILL" horizontalSpan="2" grabExcessHorizontal="false" widthHint="150"/>
</layout-data>
</widget>
<!-- row 4 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>Number of nodes: </fixed-text>
</widget>
<widget type="text" style="SWT.BORDER" saveValueTo="Resource_List.nodes">
<layout-data>
<grid-data horizontalAlign="SWT.FILL" horizontalSpan="2" grabExcessHorizontal="false" widthHint="150"/>
</layout-data>
</widget>
<!-- row 5 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>Total Memory Needed: </fixed-text>
</widget>
<widget type="text" style="SWT.BORDER" saveValueTo="Resource_List.mem">
<layout-data>
<grid-data horizontalAlign="SWT.FILL" horizontalSpan="2" grabExcessHorizontal="false" widthHint="150"/>
</layout-data>
</widget>
</composite>
<composite group="true">
<layout>
<grid-layout numColumns="2" makeColumnsEqualWidth="false" horizontalSpacing="10" verticalSpacing="15"/>
</layout>
<!-- row 1 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>MPI Command: </fixed-text>
</widget>
<button-group saveValueTo="mpiCommand" group="true">
<layout>
<row-layout type="SWT.HORIZONTAL" center="true" fill="true" justify="true"/>
</layout>
<button type="radiobutton" title=""/>
<button type="radiobutton" title="mpiexec"/>
<button type="radiobutton" title="mpirun"/>
</button-group>
<!-- row 2 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>MPI Number of Cores: </fixed-text>
</widget>
<widget type="spinner" style="SWT.BORDER" readOnly="true" saveValueTo="mpiCores">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" horizontalSpan="1" grabExcessHorizontal="false" widthHint="100"/>
</layout-data>
</widget>
</composite>
</composite>
<composite group="true">
<layout>
<grid-layout numColumns="4" makeColumnsEqualWidth="false" horizontalSpacing="10" verticalSpacing="15"/>
</layout>
<!-- row 1 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>Remote Input File: </fixed-text>
</widget>
<widget type="combo" style="SWT.BORDER" readOnly="true" saveValueTo="remote.input.file">
<layout-data>
<grid-data horizontalAlign="SWT.FILL" horizontalSpan="2" grabExcessHorizontal="false"/>
</layout-data>
</widget>
<action title="Refresh">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" widthHint="100" horizontalSpan="1" grabExcessHorizontal="false"/>
</layout-data>
<button-action clearValue="remote.input.files" refresh="true">
<action>get-input</action>
</button-action>
</action>
<!-- row 2 -->
<widget type="label" style="SWT.LEFT">
<layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" grabExcessHorizontal="false"/>
</layout-data>
<fixed-text>Local Input File: </fixed-text>
</widget>
<browse textStyle="SWT.BORDER" localOnly="true" title="Browse" saveValueTo="local.input.file">
<text-layout-data>
<grid-data horizontalAlign="SWT.FILL" widthHint="200" horizontalSpan="2" grabExcessHorizontal="true"/>
</text-layout-data>
<button-layout-data>
<grid-data horizontalAlign="SWT.BEGINNING" widthHint="100" horizontalSpan="1" grabExcessHorizontal="false"/>
</button-layout-data>
</browse>
</composite>
<composite group="true">
<layout>
<grid-layout numColumns="1" makeColumnsEqualWidth="false" horizontalSpacing="10" verticalSpacing="15"/>
</layout>
<viewer name="environment" style="SWT.BORDER | SWT.MULTI" sort="true" type="table">
<layout-data>
<grid-data widthHint="600" heightHint="40" horizontalSpan="1"/>
</layout-data>
<column-data name="Name" width="175"/>
<column-data name="Value" width="400"/>
<items>
<include>remote.input.file</include>
</items>
<value pattern="export @name='@value'" separator="; "/>
</viewer>
</composite>
</dynamic>
</launch-tab>
</control-data>
<monitor-data schedulerType="PBS">
<driver>
<name></name>
</driver>
</monitor-data>
</resource-manager-builder>