Difference between revisions of "Application examples"

From SNIC Documentation
Jump to: navigation, search
(Generic examples)
(Generic examples)
Line 7: Line 7:
 
'''XRSL job description (ex1.xrsl):'''
 
'''XRSL job description (ex1.xrsl):'''
  
<pre>&
+
<pre>&(executable=run.sh)
(executable=run.sh)
 
 
(wallTime="5 minutes")
 
(wallTime="5 minutes")
 
(stdout="stdout.txt")
 
(stdout="stdout.txt")
Line 31: Line 30:
  
 
=== Example 2 ===
 
=== Example 2 ===
 +
 +
Debug information from the used resources can be retrieved using the "gmlog" attribute. The value of the attribute specifies the name of the directory to store the debug information.
 +
 +
'''XRSL job description (ex2.xrsl):'''
 +
 +
<pre>&(executable=run.sh)
 +
(cpuTime="5 minutes")
 +
(stdout="stdout.txt")
 +
(stderr="stderr.txt")
 +
(inputFiles=("run.sh" ""))
 +
(outputFiles=("/" ""))
 +
(gmlog="grid.debug")
 +
</pre>
 +
 +
'''Executable shell script (run.sh):'''
 +
 +
<pre>#!/bin/sh
 +
echo "Hello, grid"
 +
</pre>
 +
 +
'''Usage:'''
 +
 +
<pre>arcsub ex2.xrsl</pre>
  
 
== Octave / MATLAB examples ==
 
== Octave / MATLAB examples ==

Revision as of 16:47, 11 October 2011

Generic examples

Example 1

This job just sends a script to a grid resource which writes "Hello, grid!" to standard output. The scripts stores standard input and output to the files stdout.txt och stderr.txt. All output is collected upon retrieval using the directive "/" in the outputFiles attribute. Walltime is set to 5 minutes. The executable is also added to the input files section.

XRSL job description (ex1.xrsl):

&(executable=run.sh)
(wallTime="5 minutes")
(stdout="stdout.txt")
(stderr="stderr.txt")
(inputFiles=("run.sh" ""))
(outputFiles=("/" ""))

Executable shell script (run.sh):

#!/bin/sh
echo "Hello, grid"

Usage:

arcsub ex1.xrsl

More verbose output is achieved with:

arcsub --debug=INFO ex1.xrsl

Example 2

Debug information from the used resources can be retrieved using the "gmlog" attribute. The value of the attribute specifies the name of the directory to store the debug information.

XRSL job description (ex2.xrsl):

&(executable=run.sh)
(cpuTime="5 minutes")
(stdout="stdout.txt")
(stderr="stderr.txt")
(inputFiles=("run.sh" ""))
(outputFiles=("/" ""))
(gmlog="grid.debug")

Executable shell script (run.sh):

#!/bin/sh
echo "Hello, grid"

Usage:

arcsub ex2.xrsl

Octave / MATLAB examples

SciPy / Numpy examples

ARC Python API examples