[Swift-commit] r6889 - SwiftApps/Swift-MapRed/swift-t-simple/put-get

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Mon Aug 19 16:20:44 CDT 2013


Author: wozniak
Date: 2013-08-19 16:20:44 -0500 (Mon, 19 Aug 2013)
New Revision: 6889

Added:
   SwiftApps/Swift-MapRed/swift-t-simple/put-get/job.sh
   SwiftApps/Swift-MapRed/swift-t-simple/put-get/setup.zsh
   SwiftApps/Swift-MapRed/swift-t-simple/put-get/stop-servers.zsh
Modified:
   SwiftApps/Swift-MapRed/swift-t-simple/put-get/chirp_service.sh
   SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift
Log:
Sketching data movement test


Modified: SwiftApps/Swift-MapRed/swift-t-simple/put-get/chirp_service.sh
===================================================================
--- SwiftApps/Swift-MapRed/swift-t-simple/put-get/chirp_service.sh	2013-08-19 20:25:56 UTC (rev 6888)
+++ SwiftApps/Swift-MapRed/swift-t-simple/put-get/chirp_service.sh	2013-08-19 21:20:44 UTC (rev 6889)
@@ -1,11 +1,15 @@
-#!/bin/bash
+#!/bin/bash -e
 
 trap "echo SCRIPT CAUGHT TERM" TERM
 
 HOST=$( hostname )
 echo HOST: ${HOST}
 
-chirp_server -p 9080 -r ${HOME}/cr_${HOST} &
+# This should have been created by setup.sh:
+DEFAULT_ACL=${HOME}/chirp-acl.txt
+[[ -f ${DEFAULT_ACL} ]]
+
+chirp_server -p 9080 -r ${HOME}/cr_${HOST} -A ${DEFAULT_ACL} &
 JOB=${!}
 
 wait

Added: SwiftApps/Swift-MapRed/swift-t-simple/put-get/job.sh
===================================================================
--- SwiftApps/Swift-MapRed/swift-t-simple/put-get/job.sh	                        (rev 0)
+++ SwiftApps/Swift-MapRed/swift-t-simple/put-get/job.sh	2013-08-19 21:20:44 UTC (rev 6889)
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+
+# Pretend user job
+
+OUTPUT=$1
+INPUT=$2
+
+export PARROT_TIMEOUT=5
+
+# Retrieve input
+NAME=$( basename ${INPUT} )
+parrot_run cp -v ${INPUT} /tmp/${NAME}
+
+# Emulate some compute time (0-9 seconds based on my PID)
+DELAY=$(( ${$} % 10 + 1))
+sleep ${DELAY}
+
+# Store output
+parrot_run cp -v /tmp/${NAME} ${OUTPUT}


Property changes on: SwiftApps/Swift-MapRed/swift-t-simple/put-get/job.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Swift-MapRed/swift-t-simple/put-get/setup.zsh
===================================================================
--- SwiftApps/Swift-MapRed/swift-t-simple/put-get/setup.zsh	                        (rev 0)
+++ SwiftApps/Swift-MapRed/swift-t-simple/put-get/setup.zsh	2013-08-19 21:20:44 UTC (rev 6889)
@@ -0,0 +1,50 @@
+#!/bin/zsh -e
+
+HOSTS=$1
+PORT=$2
+
+zmodload zsh/files
+
+if [[ ${#*} != 2 ]]
+then
+  print "usage: setup.sh HOSTS PORT"
+  exit 1
+fi
+
+DEFAULT_ACL=${HOME}/chirp-acl.txt
+{
+  print "unix:${USER} rwlda"
+  print "hostname:*.mcs.anl.gov rwlda"
+} > ${DEFAULT_ACL}
+
+set -x
+
+# Start servers
+for H in $( < ${HOSTS} )
+do
+  CHIRP_ROOT=${HOME}/cr_${H}
+  ssh ${HOST} mkdir -p ${HOME}/cr_${H}
+  ssh ${H} chirp_server -p ${PORT} -r ${CHIRP_ROOT} -A ${DEFAULT_ACL} &
+done
+
+# Create and post some initial data
+i=0
+for H in $( < ${HOSTS} )
+do
+  for (( j=0 ; j<10 ; j++ ))
+  do
+    F=file-${i}.txt
+    echo "FILE:${i}" > ${F}
+    chirp -a hostname ${H}:${PORT} put ${F} /${F}
+    rm ${F}
+    (( i++ )) || true
+  done
+done
+
+# Stop servers- we start them with TURBINE_WORKER_SERVICE
+./stop-servers.zsh ${HOSTS}
+
+wait
+
+print DONE
+exit 0


Property changes on: SwiftApps/Swift-MapRed/swift-t-simple/put-get/setup.zsh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Swift-MapRed/swift-t-simple/put-get/stop-servers.zsh
===================================================================
--- SwiftApps/Swift-MapRed/swift-t-simple/put-get/stop-servers.zsh	                        (rev 0)
+++ SwiftApps/Swift-MapRed/swift-t-simple/put-get/stop-servers.zsh	2013-08-19 21:20:44 UTC (rev 6889)
@@ -0,0 +1,15 @@
+#!/bin/zsh -e
+
+HOSTS=$1
+
+if [[ ${#*} != 1 ]]
+then
+  print "usage: stop-servers.zsh HOSTS"
+  exit 1
+fi
+
+# Kill servers
+for H in $( < ${HOSTS} )
+do
+  ssh ${H} killall chirp_server
+done


Property changes on: SwiftApps/Swift-MapRed/swift-t-simple/put-get/stop-servers.zsh
___________________________________________________________________
Added: svn:executable
   + *

Modified: SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift
===================================================================
--- SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift	2013-08-19 20:25:56 UTC (rev 6888)
+++ SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift	2013-08-19 21:20:44 UTC (rev 6889)
@@ -1,10 +1,18 @@
 
 import io;
+import files;
+import string;
 import sys;
 
 main
 {
-  printf("Hello");
-  // Give the chirp server some time to start up
-  sleep(2);
+  string hosts_txt = argv("hosts");
+  string hosts[] = split(read(input(hosts_txt)), "\n");
+  foreach host in hosts
+  {
+    if (host != "")
+    {
+      printf("host: %s", host);
+    }
+  }
 }




More information about the Swift-commit mailing list