From: <Mic...@lo...> - 2007-03-28 00:24:14
|
Hi Sharon, As far as I can tell, the <job> element will not allow me to execute stax jobs on different machines. The machine attribute of <job-file> and <job-scriptfile> allows you to specify on which machine the stax job or script is located, not where it will be run. Perhaps I am missing something? Here is a simple example which should reproduce the behavior. Two machines are required. start.xml uses stafcmd to execute launch.xml with three different delay values on hostA. Each launch.xml job calls delay.xml on hostB with the given argument. One would expect jobname "launch:60" on hostA to exit when jobname "delay:60" exits on hostB. This is not always the case. If these files are executed on a single machine the behavior is as expected. launch:60 terminates immediately after delay:60 terminates, and so on. When run on two separate hosts, however, launch:60 may terminate after delay:60, delay:120, or delay:180 terminates with no apparent pattern. Many thanks! Michael Emch start.xml: run on hostA <?xml version="1.0" encoding="UTF-8" standalone="no"?>> <!DOCTYPE stax SYSTEM "stax.dtd"> <stax> <defaultcall function="main" /> <function name="main"> <function-no-args /> <sequence> <paralleliterate var="delay" in="('60', '120', '180')"> <sequence> <log message="1">'starting launch.xml: %s' % delay</log> <stafcmd> <location>'hostA'</location> <service>'stax'</service> <request>'execute file /path/to/launch.xml jobname "launch:%s" args "\'%s\'"' % (delay,delay)</request> </stafcmd> <log message="1">'RC: %s' % RC</log> <log message="1">'STAFResult: %s' % STAFResult</log> </sequence> </paralleliterate> </sequence> </function> </stax> launch.xml: lives on hostA <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE stax SYSTEM "stax.dtd"> <stax> <defaultcall function="main" /> <function name="main"> <function-single-arg> <function-required-arg name="delay"/> </function-single-arg> <sequence> <log message="1">'starting job: sleep for %s seconds' % delay </log> <stafcmd> <location>'hostB'</location> <service>'stax'</service> <request>'execute file /path/to/delay.xml machine "hostB" jobname "delay:%s" args "\'%s\'" clearlogs enabled wait returnresult' % (delay,delay)</request> </stafcmd> <log message="1">'RC: %s' % RC</log> <log message="1">'STAFResult: %s' % STAFResult</log> </sequence> </function> </stax> delay.xml: lives on hostB <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE stax SYSTEM "stax.dtd"> <stax> <defaultcall function="main" /> <function name="main"> <function-single-arg> <function-required-arg name="delay"/> </function-single-arg> <sequence> <log message="1">'sleeping for %s seconds' % delay</log> <script> sleep = int(delay) * 1000 </script> <stafcmd> <location>'local'</location> <service>'delay'</service> <request>'delay %s' % str(sleep)</request> </stafcmd> <log message="1">'RC: %s' % RC</log> <log message="1">'STAFResult: %s' % STAFResult</log> </sequence> </function> </stax> Sharon Lucas To <lu...@us... Mic...@lo... m> cc sta...@li... Sent by: Subject staf-users-bounce Re: [staf-users] return behavior of s...@li...urcefor STAX jobs lauched through stafcmd ge.net 03/27/2007 04:39 PM I don't really understand exactly how you implemented your STAX jobs from your description. It would be helpful if you provided the actual STAX jobs that you are executing (or at least the relevant information from them). Also, why are you using the <stafcmd> element to submit a STAX job instead of the <job> element? If you want to submit a STAX job (e.g. a sub-job) from within a STAX job and wait for it to complete, you should use the <job> element. See the STAX User's Guide for more information on the <job> element. For example: <script> jobFileList = [ {'jobFile': 'C:/tests/J1.xml', 'jobName': 'J1'}, {'jobFile': 'C:/tests/J2.xml', 'jobName': 'J2'}, {'jobFile': 'C:/tests/J3.xml', 'jobName': 'J3'} ] staxMachine = 'hostA' </script> <paralleliterate var="jobInfo" in="jobFileList"> <sequence> <script> jobFile = jobInfo['jobFile'] jobName = jobInfo['jobName'] </script> <job name="jobName" clearlogs="1"> <job-file machine="staxMachine">jobFile</job-file> </job> <if expr="RC == 0"> <log message="1"> 'Sub-job ID %s with name %s completed on machine %s with Result: %s' % \ (STAXSubJobID, jobName, staxMachine, STAXResult) </log> <else> <log message="1"> 'Sub-job with name %s could not be started on machine %s. RC: %s Result: %s' % \ (jobName, staxMachine, RC, STAFResult) </log> </else> </if> </sequence> </paralleliterate> -------------------------------------------------------------- Sharon Lucas IBM Austin, lu...@us... (512) 838-8347 or Tieline 678-8347 Mic...@lo... Sent by: sta...@li...ur ceforge.net To sta...@li... t 03/27/2007 05:20 PM cc Subject [staf-users] return behavior of STAX jobs lauched through stafcmd Hello, I'm having a problem where stax jobs launched on a different machine via stafcmd are not returning as they finish. An example scenario would be: stax job S1 starts stax jobs J1, J2, and J3 using stafcmd inside of a paralleliterate block on host A. Then, J1, J2, and J3 each start jobs T1, T2, and T3 respectively through stafcmd on host B using the parameters "clearlogs enabled wait returnresult". When jobs T1, T2, T3 finish, J1, J2, and J3 should then sequentially call jobs R1, R2, and R3 respectively on host C with the same parameters. The problem I am facing is that when T1 finishes on host B, J1 does not necessarily immediately call job R1 on host C. It may call R1 when T2 completes (or T3) apparently exhibiting random behavior. Is this behavior expected? I'm using STAF version 3.1.5 and STAX version 3.1.4 on RHEL4 ES. Thank you for any help you can give regarding this issue. Michael Emch ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ staf-users mailing list sta...@li... https://lists.sourceforge.net/lists/listinfo/staf-users ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ staf-users mailing list sta...@li... https://lists.sourceforge.net/lists/listinfo/staf-users |