.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "JobDescription 3pm" .TH JobDescription 3pm "2020-12-12" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Globus::GRAM::JobDescription \- GRAM Job Description Globus::GRAM::DefaultHandlingJobDescription \- GRAM Job Description with relative path handling .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Globus::GRAM::JobDescription; \& \& $hash = { executable => [ \*(Aq/bin/echo\*(Aq ], arguments => [ \*(Aqhello\*(Aq ] }; \& $description = new Globus::GRAM::JobDescription($filename); \& $description = new Globus::GRAM::JobDescription($hash); \& $executable = $description\->executable(); \& $description\->add($new_attribute, $new_value); \& $description\->save(); \& $description\->save($filename); \& $description\->print_recursive($file_handle); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" 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 \s-1RSL\s0 parameter, may be updated with new parameters, and may be saved in the filesystem for later use. .SS "Methods" .IX Subsection "Methods" .ie n .IP "new Globus::GRAM::JobDescription(\fI\fI$filename\fI\fR)" 4 .el .IP "new Globus::GRAM::JobDescription(\fI\f(CI$filename\fI\fR)" 4 .IX Item "new Globus::GRAM::JobDescription($filename)" A JobDescription is constructed from a file consisting of a Perl hash of parameter => array mappings. Every value in the Job Description is stored internally as an array, even single literals, similar to the way an \s-1RSL\s0 tree is parsed in C. An example of such a file is .Sp .Vb 11 \& $description = \& { \& executable => [ \*(Aq/bin/echo\*(Aq ], \& arguments => [ \*(Aqhello\*(Aq, \*(Aqworld\*(Aq ], \& environment => [ \& [ \& \*(AqGLOBUS_GRAM_JOB_CONTACT\*(Aq, \& \*(Aqhttps://globus.org:1234/2345/4332\*(Aq \& ] \& ] \& }; .Ve .Sp which corresponds to the rsl fragment .Sp .Vb 5 \& &(executable = /bin/echo) \& (arguments = hello world) \& (environment = \& (GLOBUS_GRAM_JOB_CONTACT \*(Aqhttps://globus.org:1234/2345/4332\*(Aq) \& ) .Ve .Sp When the library_path \s-1RSL\s0 attribute is specified, this object modifies the environment \s-1RSL\s0 attribute value to append its value to any system specific variables. .ie n .IP "$description\->\fIadd\fR('name', \fI\fI$value\fI\fR);" 4 .el .IP "\f(CW$description\fR\->\fIadd\fR('name', \fI\f(CI$value\fI\fR);" 4 .IX Item "$description->add('name', $value);" 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, .Sp .Vb 1 \& $description\->add(\*(Aqnew_attribute\*(Aq, $new_value) .Ve .Sp will create a new attribute in the JobDescription, which can be accessed by calling the \fI\f(CI$description\fI\-\fRnew_attribute>() method. .ie n .IP "\fI\fI$value\fI\fR $description\->\fIget\fR('name');" 4 .el .IP "\fI\f(CI$value\fI\fR \f(CW$description\fR\->\fIget\fR('name');" 4 .IX Item "$value $description->get('name');" Get a parameter from a job description. As an example, .Sp .Vb 1 \& $description\->get(\*(Aqattribute\*(Aq) .Ve .Sp will return the appropriate attribute in the JobDescription by name. .ie n .IP "$description\->\fIsave\fR([$filename])" 4 .el .IP "\f(CW$description\fR\->\fIsave\fR([$filename])" 4 .IX Item "$description->save([$filename])" Save the JobDescription, including any added parameters, to the file named by \f(CW$filename\fR if present, or replacing the file used in constructing the object. .ie n .IP "$description\->\fIprint_recursive\fR($file_handle)" 4 .el .IP "\f(CW$description\fR\->\fIprint_recursive\fR($file_handle)" 4 .IX Item "$description->print_recursive($file_handle)" Write the value of the job description object to the file handle specified in the argument list. .ie n .IP "$description\->\fIparameter\fR()" 4 .el .IP "\f(CW$description\fR\->\fIparameter\fR()" 4 .IX Item "$description->parameter()" 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). .Sp If the attributes does not in this object, then undef will be returned. .Sp In a list context, this returns the list of values associated with an attribute. .Sp 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. .Sp For example, from a JobDescription called \f(CW$d\fR constructed from a description file containing .Sp .Vb 4 \& { \& executable => [ \*(Aq/bin/echo\*(Aq ], \& arguments => [ \*(Aqhello\*(Aq, \*(Aqworld\*(Aq ] \& } .Ve .Sp The following will hold: .Sp .Vb 6 \& $executable = $d\->executable() # \*(Aq/bin/echo\*(Aq \& $arguments = $d\->arguments() # undef \& @executable = $d\->executable() # (\*(Aq/bin/echo\*(Aq) \& @arguments = $d\->arguments() # (\*(Aqhello\*(Aq, \*(Aqworld\*(Aq) \& $not_present = $d\->not_present() # undef \& @not_present = $d\->not_present() # () .Ve .Sp To test for existence of a value: .Sp .Vb 2 \& @not_present = $d\->not_present() \& print "Not defined\en" if(!defined($not_present[0])); .Ve