[Swift-commit] r4143 - SwiftApps/SwiftR/Swift/exec

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Feb 24 17:27:03 CST 2011


Author: tga
Date: 2011-02-24 17:27:03 -0600 (Thu, 24 Feb 2011)
New Revision: 4143

Modified:
   SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh
   SwiftApps/SwiftR/Swift/exec/rserver.swift
Log:
oops... didn't mean to check in these changes yet.


Modified: SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh
===================================================================
--- SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh	2011-02-24 23:25:50 UTC (rev 4142)
+++ SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh	2011-02-24 23:27:03 UTC (rev 4143)
@@ -83,31 +83,6 @@
 
 RPIDS=
 
-TIMEOUT=5
-
-function start_timeout {
-    ppid=$$
-    trap "timeout_handler" SIGHUP
-    (
-    sleep $TIMEOUT
-    kill -1 $ppid  &> /dev/null #SIGHUP 
-    ) &
-}
-
-function stop_timeout {
-    trap "" SIGHUP
-}
-
-function timeout_handler {
-    echo 'Timed out waiting to contact R process'
-    echo 'R log follows:'
-    echo '====================='
-    cat $SLOTDIR/R.log
-    exit 1
-}
-
-
-
 # Try to make slotdir.
 # If the mkdir succeeds, this is the first request to the slot,
 # so we create a new R server and send the current request to it;
@@ -124,18 +99,18 @@
   #which Rscript >> $SLOTDIR/R.log
   echo $PATH
   $RServerScript $SLOTDIR >> $SLOTDIR/R.log 2>&1 &   # launch R server
-  start_timeout
   # idletimer $SLOTDIR </dev/null >/dev/null 2>&1 & # R saves pid in R.pid for idletimer to kill it
   echo "$0: INFO: Launched $RServerScript $SLOTDIR Rscript"
 else
   # wait to make sure fifo exists
   # fromR fifo is created last, so wait for that one
-  start_timeout
-  while 1; do
-    if [ -p $SLOTDIR/fromR.fifo ]; then
-      break
+  if [ ! -p $SLOTDIR/fromR.fifo ]; then
+    sleep 5  # FIXME: try a few times, or wait longer?
+    if [ ! -p $SLOTDIR/fromR.fifo ]; then
+      echo "$0: ERROR: FIFO $SLOTDIR/fromR.fifo did not appear within 5 seconds.\n"
+      exit 1
     fi
-  done
+  fi
 fi
 
 # Ready to talk to the server: send request and read response
@@ -155,7 +130,7 @@
     touch $SLOTDIR/lastwrite
 
     echo DB: Sent request
-    stop_timeout # started up ok
+
     echo dummy stderr response 1>&2 # FIXME - testing if this is the provider staging problem (not xfering zero len stderr)
 
     res=$(cat < $SLOTDIR/fromR.fifo)

Modified: SwiftApps/SwiftR/Swift/exec/rserver.swift
===================================================================
--- SwiftApps/SwiftR/Swift/exec/rserver.swift	2011-02-24 23:25:50 UTC (rev 4142)
+++ SwiftApps/SwiftR/Swift/exec/rserver.swift	2011-02-24 23:27:03 UTC (rev 4143)
@@ -10,7 +10,7 @@
 
 app (external e, RData result, file stout, file sterr) runR (file shellscript, file RServerScript, RData rcall)
 {
-  bash @shellscript @RServerScript @rcall @result stdout=@stout stderr=@sterr;
+  bash "--noprofile" @shellscript @RServerScript @rcall @result stdout=@stout stderr=@sterr;
 }
 
 app ack (external e[])




More information about the Swift-commit mailing list