Jan K. Labanowski: Computational Portals for Chemistry  

status.xml -- the XMLlet!!! (continued)

Under example1 directory you find the following files:
-rw-r--r--   1 tomcat4  tomcat4      818 Nov 14 10:25 description
-rw-r--r--   1 tomcat4  tomcat4      254 Nov 11 10:34 example1.in
-rw-r--r--   1 tomcat4  tomcat4      992 Nov 13 11:06 example1.script
-rw-r--r--   1 tomcat4  tomcat4     3203 Nov 11 09:41 example1.xyz
-rw-r--r--   1 tomcat4  tomcat4     2606 Nov 13 04:10 input-files.xml
-rw-r--r--   1 tomcat4  tomcat4     3567 Nov 13 11:23 output-files.xml
-rw-r--r--   1 tomcat4  tomcat4     2513 Nov 17 08:18 status.xml
status.xml -- the status file which has its tags replaced (a moment before the job actually starts -- no status events are reported yet and event timestamp and message are set to none). This file contains information and the actual shell scripts (the <eventCommand> body is actually saved in the file and run as a shell script by the RunEvents class). The scripts run the job and then postprocess it when it job is finished. Since the web server can access the compute server, shell commands can also be are on the compute server in response to the events coming from the running job (or jobs). You can do it as complex as you want it to be. You can run jobs in parallel, and have the last one to start next batch of jobs, etc...

<status>
  <applicationName>Wilkins Code</applicationName>
  <fileVersion>1.0</fileVersion>
  <event name="CreateRemoteRunDirectory">
     <eventPassword>M9kLeQH0iqB1BaW</eventPassword>
     <eventTimestamp>none</eventTimestamp>
     <eventType>COMMAND_ON_WEB_SERVER</eventType>
     <eventCommand>ssh -l portal oscbw.ccl.net mkdir -p \
 /f/portal/PortalRuns/jkl@asdn.net/example1</eventCommand>
     <eventMessage>none</eventMessage>
  </event>
  <event name="CopyFilesToBackend">
     <eventPassword>tucy3AJig372oqG</eventPassword>
     <eventTimestamp>none</eventTimestamp>
     <eventType>COMMAND_ON_WEB_SERVER</eventType>
     <eventCommand>scp -pAv /usr/local/tomcat_4.0/jakarta-tomcat-4.0/\
webapps/sciPortal/WEB-INF/Users/jkl@asdn.net/example1/example1.* \
 portal@oscbw.ccl.net:/f/portal/PortalRuns/jkl@asdn.net/example1</eventCommand>
     <eventMessage>none</eventMessage>
  </event>
  <event name="SubmitJob">
     <eventPassword>tvdYxRPzOvyrPr0</eventPassword>
     <eventTimestamp>none</eventTimestamp>
     <eventType>COMMAND_ON_WEB_SERVER</eventType>
     <eventCommand>ssh -l  portal oscbw.ccl.net \
 '( cd /f/portal/PortalRuns/jkl@asdn.net/example1; \
 /usr/local/pbs/bin/qsub example1.script )'</eventCommand>
     <eventMessage>none</eventMessage>
  </event>
  <event name="JobStarted">
     <eventPassword>uqiQoLVr0O7CFzK</eventPassword>
     <eventTimestamp>none</eventTimestamp>
     <eventType>COMMAND_ON_WEB_SERVER</eventType>
     <eventCommand>ssh -l portal oscbw.ccl.net \
 '/usr/local/pbs/bin/qstat -a | grep example1'</eventCommand>
     <eventMessage>none</eventMessage>
  </event>
  <event name="CopyOutputFiles">
     <eventPassword>t5GBECPzArrSYVI</eventPassword>
     <eventTimestamp>none</eventTimestamp>
     <eventType>COMMAND_ON_WEB_SERVER</eventType>
     <eventCommand>/usr/bin/batch <<EOF
sleep 5
/usr/local/bin/scp -pAvr \
 'portal@oscbw.ccl.net:/f/portal/PortalRuns/jkl@asdn.net/example1/*' \
 /usr/local/tomcat_4.0/jakarta-tomcat-4.0/webapps/sciPortal/WEB-INF/Users/jkl@asdn.net/example1
EOF
</eventCommand>
     <eventMessage>none</eventMessage>
  </event>
  <event name="JobFinished">
     <eventPassword>NwFnozEUq0fu1I5</eventPassword>
     <eventTimestamp>none</eventTimestamp>
     <eventType>NO_ACTION</eventType>
     <eventCommand>none</eventCommand>
     <eventMessage>none</eventMessage>
  </event>
</status>