Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > a89793aba17cc958d74bb76555095614 > files > 4

globus-gram-job-manager-scripts-doc-2.12-1.fc14.noarch.rpm

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Globus::GRAM::JobDescription - GRAM Job Description</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<!--

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<ul>

		<li><a href="#methods">Methods</a></li>
	</ul>

</ul>

-->


</div>
<!-- INDEX END -->

<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Globus::GRAM::JobDescription - GRAM Job Description</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
    use Globus::GRAM::JobDescription;</pre>
<pre>
    $hash = { executable =&gt; [ '/bin/echo' ], arguments =&gt; [ 'hello' ] };
    $description = new Globus::GRAM::JobDescription($filename);
    $description = new Globus::GRAM::JobDescription($hash);
    $executable = $description-&gt;executable();
    $description-&gt;add($new_attribute, $new_value);
    $description-&gt;save();
    $description-&gt;save($filename);
    $description-&gt;print_recursive($file_handle);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>This object contains the parameters of a job request in a simple
object wrapper. The object may be queried to determine the value of
any RSL parameter, may be updated with new parameters, and may be saved
in the filesystem for later use.</p>
<p>
</p>
<h2><a name="methods">Methods</a></h2>
<dl>
<dt><strong><a name="jobdescription" class="item">new Globus::GRAM::JobDescription(<em>$filename</em>)</a></strong></dt>

<dd>
<p>A JobDescription is constructed from a 
file consisting of a Perl hash of parameter =&gt; array mappings. Every
value in the Job Description is stored internally as an array, even single
literals, similar to the way an RSL tree is parsed in C. An example of such
a file is</p>
<pre>
    $description =
    {
        executable  =&gt; [ '/bin/echo' ], 
        arguments   =&gt; [ 'hello', 'world' ],
        environment =&gt; [
                           [
                               'GLOBUS_GRAM_JOB_CONTACT',
                               'https://globus.org:1234/2345/4332'
                           ]
                       ]
    };</pre>
<p>which corresponds to the rsl fragment</p>
<pre>
    &amp;(executable  = /bin/echo)
     (arguments   = hello world)
     (environment =
         (GLOBUS_GRAM_JOB_CONTACT 'https://globus.org:1234/2345/4332')
     )</pre>
<p>When the library_path RSL attribute is specified, this object modifies
the environment RSL attribute value to append its value to any system specific
variables.</p>
</dd>
<dt><strong><a name="add" class="item">$description-&gt;<em>add</em>('name', <em>$value</em>);</a></strong></dt>

<dd>
<p>Add a parameter to a job description. The parameter will be normalized
internally so that the access methods described below will work with
this new parameter. As an example,</p>
<pre>
    $description-&gt;add('new_attribute', $new_value)</pre>
<p>will create a new attribute in the JobDescription, which can be accessed
by calling the <em>$description-</em>new_attribute&gt;() method.</p>
</dd>
<dt><strong><a name="get" class="item"><em>$value</em> $description-&gt;<em>get</em>('name');</a></strong></dt>

<dd>
<p>Get a parameter from a job description. As an example,</p>
<pre>
    $description-&gt;get('attribute')</pre>
<p>will return the appropriate attribute in the JobDescription by name.</p>
</dd>
<dt><strong><a name="save" class="item">$description-&gt;<em>save</em>([$filename])</a></strong></dt>

<dd>
<p>Save the JobDescription, including any added parameters, to the file
named by $filename if present, or replacing the file used in constructing
the object.</p>
</dd>
<dt><strong><a name="print_recursive" class="item">$description-&gt;<em>print_recursive</em>($file_handle)</a></strong></dt>

<dd>
<p>Write the value of the job description object to the file handle
specified in the argument list.</p>
</dd>
<dt><strong><a name="parameter" class="item">$description-&gt;<em>parameter</em>()</a></strong></dt>

<dd>
<p>For any parameter defined in the JobDescription can be accessed by calling
the method named by the parameter. The method names are automatically created
when the JobDescription is created, and may be invoked with arbitrary
SillyCaps or underscores. That is, the parameter gram_myjob may be accessed
by the GramMyJob, grammyjob, or gram_my_job method names (and others).</p>
<p>If the attributes does not in this object, then undef will be returned.</p>
<p>In a list context, this returns the list of values associated
with an attribute.</p>
<p>In a scalar context, if the attribute's value consist of a single literal,
then that literal will be returned, otherwise undef will be returned.</p>
<p>For example, from a JobDescription called $d constructed from a
description file containing</p>
<pre>
    {
        executable =&gt; [ '/bin/echo' ],
        arguments  =&gt; [ 'hello', 'world' ]
    }</pre>
<p>The following will hold:</p>
<pre>
    $executable = $d-&gt;executable()    # '/bin/echo'
    $arguments = $d-&gt;arguments()      # undef
    @executable = $d-&gt;executable()    # ('/bin/echo')
    @arguments = $d-&gt;arguments()      # ('hello', 'world')
    $not_present = $d-&gt;not_present()  # undef
    @not_present = $d-&gt;not_present()  # ()</pre>
<p>To test for existence of a value:</p>
<pre>
    @not_present = $d-&gt;not_present()
    print &quot;Not defined\n&quot; if(!defined($not_present[0]));</pre>
</dd>
</dl>

</body>

</html>