Index: trunk/ippTasks/pantasks.pro
===================================================================
--- trunk/ippTasks/pantasks.pro	(revision 10760)
+++ trunk/ippTasks/pantasks.pro	(revision 11210)
@@ -18,8 +18,32 @@
 $runexec = 1
 
+$EXIT_SUCCESS     = 0
+$EXIT_UNKNOWN_ERR = 1
+$EXIT_SYS_ERR     = 2
+$EXIT_CONFIG_ERR  = 3
+$EXIT_PROG_ERR    = 4
+$EXIT_DATA_ERR    = 5
+
+$DB:n = 0
+
+macro init.simtest
+  $LOGDIR = `ipp_datapath.pl path://SIMTEST`
+  $LOGDIR = $LOGDIR/logs
+  exec mkdir -p $LOGDIR
+
+  list DB -add simtest
+
+  if ($parallel) 
+    controller exit true
+    controller host add alala
+  end
+end
+
 macro init.essence
   $LOGDIR = `ipp_datapath.pl path://ESSENCE`
   $LOGDIR = $LOGDIR/logs
   exec mkdir -p $LOGDIR
+
+  list DB -add essence_v2
 
   if ($parallel) 
@@ -36,4 +60,6 @@
   $LOGDIR = $LOGDIR/logs
   exec mkdir -p $LOGDIR
+
+  list DB -add isptest
 
   if ($parallel) 
@@ -55,5 +81,5 @@
 macro load.tasks
   input $scripts/phase0.pro
-  input $scripts/phase2.pro
+#  input $scripts/phase2.pro
 # input $scripts/phase3.pro
 
@@ -75,4 +101,6 @@
     if ($0 == 2)
       echo "$1 for: $command"
+      echo "job exit status: $JOB_STATUS"
+      echo "job dtime: $JOB_DTIME"
     else
       echo "command: $command"
@@ -80,2 +108,56 @@
   end
 end
+
+macro process_exit
+  if ($0 != 4)
+    echo "USAGE: process_exit (bookName) (pageName) (exitCode)"
+    break
+  end
+
+  $bookName = $1
+  $pageName = $2
+  $exitCode = $3
+
+  # success
+  if ($exitCode == $EXIT_SUCCESS) 
+    # the handler scripts update DB the tables; here we just update the page
+    book setword $bookName $pageName state DONE
+    return
+  end
+
+  # failure related to the data files
+  # jobs which result in DATAERR must have db state updated 
+  if ($exitCode == $EXIT_DATA_ERR)
+    showcommand failure
+    book setword $bookName $pageName state DATA_ERR
+    return
+  end
+
+  # failure related to the data files
+  if ($exitCode == $EXIT_SYS_ERR)
+    halt
+    showcommand "system failure"
+    book setword $bookName $pageName state SYS_ERR
+    return
+  end
+
+  # failure related to the data files
+  if ($exitCode == $EXIT_CONFIG_ERR)
+    halt
+    showcommand "config error"
+    book setword $bookName $pageName state CONFIG_ERR
+    return
+  end
+
+  # failure related to the data files
+  if ($exitCode == $EXIT_PROG_ERR)
+    halt
+    showcommand "programming error"
+    book setword $bookName $pageName state PROG_ERR
+    return
+  end
+
+  # any other exit status
+  showcommand failure
+  book setword $bookName $pageName state UNKNOWN_ERR
+end
