[Swift-commit] r2835 - usertools/cio/bin

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sun Apr 5 18:07:02 CDT 2009


Author: aespinosa
Date: 2009-04-05 18:07:02 -0500 (Sun, 05 Apr 2009)
New Revision: 2835

Modified:
   usertools/cio/bin/ciologic-bgp.sh
Log:
Merged DHT service from Zhao's codebase

Modified: usertools/cio/bin/ciologic-bgp.sh
===================================================================
--- usertools/cio/bin/ciologic-bgp.sh	2009-04-05 23:06:26 UTC (rev 2834)
+++ usertools/cio/bin/ciologic-bgp.sh	2009-04-05 23:07:02 UTC (rev 2835)
@@ -88,6 +88,9 @@
 ifs_mount() {
   ifs_rank=$1
   # For Chirp, just start the server
+  if [ -d /dev/shm/share ]; then
+    rm -rf /dev/shm/share
+  fi
   mkdir -p /dev/shm/share
   cat > /dev/shm/share/.__acl << EOF
 address:192.168.1.* rwlda
@@ -98,12 +101,15 @@
   $CHIRPROOT/bin/chirp_server -r /dev/shm/share &
   mkdir /chirp
   $CHIRPROOT/bin/chirp_fuse -a address /chirp
+  # TODO: make a symlink to a slave's proper IFS to 
+  #       prevent always recalculating it in higher-level
+  #       scripts
+  # ln -sf /chirp/`get_ip $ifs_rank`@stripe /ifsmount
 }
 
-PART_SIZE=$8
+PART_SIZE=$8 # also BG_SIZE
 IFS_NUM=$9
 STRIPE_SIZE=${10}
-echo $PART_SIZE $IFS_NUM $STRIPE_SIZE
 
 RANK=`get_rank`
 IFS_GRP=$(( PART_SIZE / IFS_NUM ))
@@ -113,18 +119,33 @@
 export IFS_RANK
 export CHIRP_ADD=`get_ip $IFS_RANK`
 
-echo "RANK: $RANK" "IFS_RANK: $IFS_RANK"
+# Save information
+echo $RANK > /dev/shm/RANK
+echo $IFS_RANK > /dev/shm/IFS_RANK
 
+# Generate Hash services
+DHT=$(( RANK % 128 ))
+if [ -f /dev/shm/DHTlist ]; then
+  rm -f /dev/shm/DHTlist
+fi
+for (( i = 0; i < $PART_SIZE; i = i + 128 )); do
+  echo `get_ip $i` >> /dev/shm/DHTlist
+done
+
 #Core MTIO logic
-if [ $RANK -eq 0 ]; then
-    $CIOROOT/libexec/hashserver.rb 
-elif [ $RANK -eq $IFS_RANK ]; then
+if [ $DHT -eq 0 ]; then
+    $CIOROOT/libexec/hashserver.rb
+else [ $RANK -eq $IFS_RANK ]; then
     ifs_head $STRIPE_SIZE
-    /home/zzhang/cio/bin/collector.sh 
+    /home/zzhang/cio/bin/collector.sh
 elif [ $RANK -lt $IFS_SLAVE ]; then
     ifs_slave $IFS_RANK
-    sleep 3600
 else
     ifs_mount $IFS_RANK
     $CIOROOT/libexec/falkon/runworker-bgp.sh $1 $2 $3 $4 $5 $6 $7
 fi
+
+# Quick hack
+# Make sure this job does not finish
+# Guarantee to not miss any background processes
+sleep 30d




More information about the Swift-commit mailing list