...
Variables can be defined within the <task> or <process> tag.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<variables> <var name="configdir">${jobdirroot}/config</var> <var name="mcSrcIdfile">${outdir}/${pipeline.task}-${sixdigstream}_mcsrcId.txt</var> <var name="jobdirroot">/nfs/farm/g/glast/u26/MC-tasks/${pipeline.task}/</var> <var name="outdir">${jobdirroot}/output/${sixdigstream}</var> <var name="scDatafileLD">${LDprefix}/scData:run-${sixdigstream}</var> <var name="mcSrcIdfileLD">${LDprefix}/mcSrcId:run-${sixdigstream}</var> <var name="scDatafile">${outdir}/${pipeline.task}-${sixdigstream}_scData_0000.fits</var> <var name="eventfile">${outdir}/${pipeline.task}-${sixdigstream}_events_0000.fits</var> <var name="LDprefix">/ServiceChallenge/${pipeline.task}</var> <var name="sixdigstream">${format(pipeline.stream,"%06d")}</var> <var name="eventfileLD">${LDprefix}/events:run-${sixdigstream}</var> </variables> |
...
If it is required for a batch job to access a variable from a previous process this can be achieved by explicitly setting a variable in the process which defines the job.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<process name="stepB"> <notation>Scriptlet Test Step B</notation> <variables> <var name="DERIVED">Stream ${pipeline.stream} ${pipeline.getProcessInstance("stepA").getVariable("message")}</var> </variables> <job> pipeline-set message "Hello from batch: ${DERIVED}" </job> <depends> <after process="stepA"/> </depends> </process> |
...
The following example shows many of the features discussed above.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8"?> <pipeline xmlns="http://glast-ground.slac.stanford.edu/pipeline" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://glast-ground.slac.stanford.edu/pipeline http://glast-ground.slac.stanford.edu/Pipeline-II/schemas/2.0/pipeline.xsd"> <task name="ScriptletTest" version="2.2" type="Data"> <notation>Just Testing</notation> <process name="step1"> <notation>Scriptlet Test Step 1</notation> <!-- <script language="python"> <![CDATA[ pipeline.setVariable("message","Hello from Step1") for i in range(10,12): pipeline.createSubstream("TestSubtask",i) |
...