[Swift-commit] r2752 - in usertools/cio: . falkon tools tools/src

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sat Mar 28 10:56:36 CDT 2009


Author: aespinosa
Date: 2009-03-28 10:56:36 -0500 (Sat, 28 Mar 2009)
New Revision: 2752

Added:
   usertools/cio/tools/
   usertools/cio/tools/ifshead.sh
   usertools/cio/tools/ifsmount.sh
   usertools/cio/tools/ifsstripe.sh
   usertools/cio/tools/src/
   usertools/cio/tools/src/getdata.c
   usertools/cio/tools/src/ipcal.c
   usertools/cio/tools/src/isdata.c
   usertools/cio/tools/src/rank.c
Modified:
   usertools/cio/falkon/ciologic-bgp.sh
Log:
Imported support tools in the CIO logic

Modified: usertools/cio/falkon/ciologic-bgp.sh
===================================================================
--- usertools/cio/falkon/ciologic-bgp.sh	2009-03-28 15:56:19 UTC (rev 2751)
+++ usertools/cio/falkon/ciologic-bgp.sh	2009-03-28 15:56:36 UTC (rev 2752)
@@ -39,22 +39,22 @@
 
 if [ $RANK -eq 0 ]; then
   # Run Central Hash Service
-  $CIOROOT/hashserver.rb
+  $CIOROOT/tools/hashserver.rb
 elif [ "$ISDATA" != 'app' ]; then
   if [ "$ROLE" = 'head' ]; then
-    echo "[ $BG_RANK@$IO_RANK-$PSET ] Starting Mosa Benefactor managed by $DATACN" >&2
-    echo "[ $BG_RANK@$IO_RANK-$PSET ] Starting Mosa Manager across $STR CNs" >&2
-    /home/espinosa/experiments/util/startchirp-wmosa.sh $DATACN $STR >&2 
+    # Run head IFS service
+    $CIOROOT/tools/ifshead.sh $DATACN $STR >&2 
   else
-    echo "[ $BG_RANK@$IO_RANK-$PSET ] Starting Mosa Benefactor managed by $DATACN" >&2
-    /home/espinosa/experiments/util/benefactor.sh $DATACN >&2
+    # Contribute stripes to the IFS service
+    $CIOROOT/tools/ifsslave.sh $DATACN >&2
   fi
 else
   echo "[ $BG_RANK@$IO_RANK-$PSET ] Mounting Mosa data CN filesystem from $DATACN" >&2
   /bin/mkdir /dataifs
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/fuse/lib:/usr/lib
   sleep 30
-  /home/espinosa/experiments/util/mosamount.sh $DATACN >&2
+  # Contact / mount assigned IFS head
+  $CIOROOT/tools/ifsmount.sh $DATACN >&2
  
   echo "worker started..." >> ${ERROR_LOG}
 

Added: usertools/cio/tools/ifshead.sh
===================================================================
--- usertools/cio/tools/ifshead.sh	                        (rev 0)
+++ usertools/cio/tools/ifshead.sh	2009-03-28 15:56:36 UTC (rev 2752)
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# Script      : ifshead.sh
+# Description : Starts the IFS directory service
+
+
+DATACN=$1
+STR=$2
+
+export LD_LIBRARY_PATH=/lib:/fuse/lib:/usr/lib
+
+if [ -d /dev/shm/indiv ];
+then
+  rm -rf /dev/shm/indiv 
+fi
+mkdir /dev/shm/indiv
+cat > /tmp/benefactor_config.cfg << EOF
+# the hostname or the IP address of the manager 
+manager_name = $DATACN
+
+# manager port number
+manager_port = 7005
+
+# The path to the local directory where the benefactor will store the chunks
+benefactor_path = /dev/shm/indiv
+
+# Aggregation type, this could be <DISK> or <MEMORY>
+# <DISK> is a typical setting for general workloads
+# <MEMORY> is under development
+aggregation_type = DISK
+
+# The donated disk space size in MB
+disk_space_size = 512
+
+# The donated memory space size in MB, this is effective if aggregation type= MEMORY
+memory_space_size = 512
+
+# The manager update period in seconds
+update_period = 5
+
+# (Optional) The local address the benefactor should use - specially in multihomed machines 
+#benefactor_address = 
+EOF
+
+cat > /tmp/manager_config.cfg << EOF
+# the recommended stripe width
+# this is the number of benefactors the client will strip the data among in the write operation
+stripe_width = $STR		
+
+# the size fo the chunk - not fully implemented yet
+# chunk_size = 1048576   
+
+# the maximum possible number of benefactors in the system
+max_num_ben = 4096
+EOF
+RANK=`/home/espinosa/bin/rank`
+cd /tmp
+#/home/espinosa/bin/manager 7005 > /home/espinosa/log/$RANK.mgr  2> /home/espinosa/log/$RANK-err.mgr &
+/home/espinosa/bin/manager 7005 2>&1 > /dev/null &
+
+sleep 30
+#/home/espinosa/bin/benefactor  -d >&2 2> /home/espinosa/log/$RANK.ben
+/home/espinosa/bin/benefactor 2>&1 > /dev/null


Property changes on: usertools/cio/tools/ifshead.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: usertools/cio/tools/ifsmount.sh
===================================================================
--- usertools/cio/tools/ifsmount.sh	                        (rev 0)
+++ usertools/cio/tools/ifsmount.sh	2009-03-28 15:56:36 UTC (rev 2752)
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+
+# Script      : ifsmount.sh
+# Description : Mounts the IFS associated with this Worker CN
+
+DATACN=$1
+RANK=`/home/espinosa/bin/rank`
+
+export LD_LIBRARY_PATH=/lib:/fuse/lib:/usr/lib
+cd /tmp
+
+cat > /tmp/flfs_config.cfg << EOF
+# the hostname or the IP address of the manager 
+manager_name = $DATACN
+
+
+# manager port number
+manager_port = 7005
+
+
+# execution mode - not fully implemented yet - DEBUG is the only option for now		 
+execution_mode = DEBUG
+
+
+# Naming scheme - to name chunk by sequence number <SEQNUM> or by hash <HASH>
+# <SEQNUM> the chunks will be named by sequence number, this is a typical setting for general workloads
+# <HASH> this option is for content addressablity feature
+chunk_naming = SEQNUM
+
+
+# Commit scheme - specifies whether to overwrite, non-overwrite or version the previous copy.
+# possible values include <NOOVERWRITE> , <OVERWRITE>, and <VERSIONING>
+# <NOOVERWRITE> : writing a new file with the same name as an existing file will fail.
+# <OVERWRITE>   : if a new file is stored in the system with the same file name as an existing file name,
+#		  the new file will overwrite the old file
+# <VERSIONING>  : if a new file is stored in the system with the same file name as an existing file name, 
+#		  the new file will be store as a new version of the file
+commit_scheme = NOOVERWRITE
+
+
+# Number of chunks to reserve in the repository
+num_reserve_chunks = 1024
+
+# Write Interface type - to select the write interface type, the following are the write interfaces
+# <SLIDINGWINDOWWRITE> :  Sliding window write interface, this is the typical setting.
+# <INCREMENTALWRITE>   :  Incremental write interface
+# <COMPLETELOCALWRITE> :  The Complete local write interface
+# <INCREMENTALWRITE> and <COMPLETELOCALWRITE> use the local disk in the write operation. these two are not extensively tested.
+write_interface_type = SLIDINGWINDOWWRITE
+
+
+#the memory space allocated for the buffers in the write operations, in MB, 
+# effects Sliding window interface only
+memory_size = 256
+
+
+# if <INCREMENTALWRITE> is the selected write interface <inc_write_file_size> spacifies 
+# the size of the temporary local files in number of chunks
+inc_write_file_size = 64
+
+
+# if <INCREMENTALWRITE> of <COMPLETELOCALWRITE> is the selected write interface <local_write_directory> spacifies 
+# the path to the directory where the temporary files will be saved
+local_write_directory = /tmp/FLIncW
+
+# Read Interface type - to select the read interface type, currently <FBR> is only implemented
+# <FBR> :  Fixed Buffer per Request read interface
+read_interface_type = FBR
+
+
+# if <FBR> is the selected read interface <fbr_request_buffer_size> specifies 
+# the number of chunks allocated for every request
+fbr_request_buffer_size = 4
+
+# Number of threads per write agent ( there is an agent per benefactor )
+num_threads_per_agent = 1
+# Cache update period in seconds
+cache_update_period = 5
+dbg_file_name = /dev/null
+
+
+EOF
+#/home/espinosa/bin/mosastore -o direct_io -o sync_read /dataifs
+#/home/espinosa/bin/mosastore -o sync_read /dataifs -d >&2 2> /home/espinosa/log/$RANK.mos &
+/home/espinosa/bin/mosastore -o sync_read /dataifs &
+


Property changes on: usertools/cio/tools/ifsmount.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: usertools/cio/tools/ifsstripe.sh
===================================================================
--- usertools/cio/tools/ifsstripe.sh	                        (rev 0)
+++ usertools/cio/tools/ifsstripe.sh	2009-03-28 15:56:36 UTC (rev 2752)
@@ -0,0 +1,48 @@
+#!/fuse/bin/bash
+
+# Script      : ifsslave.sh
+# Description : Allocates space in the compute node to contribute
+#               space to the head IFS.
+
+cd /tmp
+
+DATACN=$1
+
+export LD_LIBRARY_PATH=/lib:/fuse/lib:/usr/lib
+
+if [ -d /dev/shm/indiv ]; then
+  rm -rf /dev/shm/indiv 
+fi
+mkdir /dev/shm/indiv
+cat > /tmp/benefactor_config.cfg << EOF
+# the hostname or the IP address of the manager 
+manager_name = $DATACN
+
+# manager port number
+manager_port = 7005
+
+# The path to the local directory where the benefactor will store the chunks
+benefactor_path = /dev/shm/indiv
+
+# Aggregation type, this could be <DISK> or <MEMORY>
+# <DISK> is a typical setting for general workloads
+# <MEMORY> is under development
+aggregation_type = DISK
+
+# The donated disk space size in MB
+disk_space_size = 512
+
+# The donated memory space size in MB, this is effective if aggregation type= MEMORY
+memory_space_size = 512
+
+# The manager update period in seconds
+update_period = 5
+
+# (Optional) The local address the benefactor should use - specially in multihomed machines 
+#benefactor_address = 
+EOF
+cd /tmp
+sleep 30
+#RANK=`/home/espinosa/bin/rank`
+#/home/espinosa/bin/benefactor  -d >&2 2> /home/espinosa/log/$RANK.ben
+/home/espinosa/bin/benefactor  2>&1 > /dev/null


Property changes on: usertools/cio/tools/ifsstripe.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: usertools/cio/tools/src/getdata.c
===================================================================
--- usertools/cio/tools/src/getdata.c	                        (rev 0)
+++ usertools/cio/tools/src/getdata.c	2009-03-28 15:56:36 UTC (rev 2752)
@@ -0,0 +1,72 @@
+/*
+ getdata.c
+  Fetch Rank of assigned IFS service with this compute node
+ TODO:  Make this a more general script
+
+ gcc -mpowerpc -Wall -I/bgsys/drivers/ppcfloor/arch/include/  -o isdata isdata.c 
+
+ aespinosa at cs.uchicago.edu
+*/
+
+#include <stdio.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <common/bgp_personality_inlines.h>
+
+static _BGP_Personality_t pers;
+
+int main(int argc, char* argv[])
+{
+    int fd;
+    int rc;
+
+    fd = open("/proc/personality", O_RDONLY);
+    if( fd < 0 )
+    {
+	    fprintf(stderr,"Unable to open /proc/personality");
+	    exit(1);
+    }
+    rc = read(fd, (char*)&pers, sizeof(_BGP_Personality_t));
+    if( rc!=sizeof(_BGP_Personality_t) )
+    {
+	    fprintf(stderr,"Failed to read /proc/personality");
+	    exit(1);
+    }
+    close(fd);
+/*
+ * usage:
+ *  isdata [PART_SIZE] [DNUM] [STR]
+ *    [ PART_SIZE ] - total number of nodes/ size of job partition
+ *    [ DNUM ] - number of data CNs in the partition
+ *    [ STR ] - number of data CNs to stripe together
+ *
+ */
+    
+    int psize, dnum, str;
+    sscanf( argv[1], "%d", &psize );
+    sscanf( argv[2], "%d", &dnum );
+    sscanf( argv[3], "%d", &str );
+    int *target_rank = (int*) malloc( dnum * sizeof(int) );
+
+    int i;
+    for ( i = 0; i < dnum; i++ )
+    {
+        target_rank[i] = psize * ( 2*i + 1 ) / ( 2*dnum );
+    }
+
+    for ( i = 0; i < dnum; i++ )
+    {
+        int rank = pers.Network_Config.Rank;
+        if ( psize * i / dnum <= rank && rank < psize * (i+1) / dnum )
+        {
+            printf("%d", target_rank[i]);
+            break;
+        }
+    }
+    return 0;
+}

Added: usertools/cio/tools/src/ipcal.c
===================================================================
--- usertools/cio/tools/src/ipcal.c	                        (rev 0)
+++ usertools/cio/tools/src/ipcal.c	2009-03-28 15:56:36 UTC (rev 2752)
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char* argv[])
+{
+	unsigned long network;
+	unsigned long rank;
+	char dot;
+	unsigned long a, b, c, d;
+	network = 0;
+	sscanf(argv[1], "%d.%d.%d.%d", &a, &b, &c, &d);
+	network = network | (a << 24) | (b << 16) | (c << 8) | d;
+	sscanf( argv[2], "%d", &rank );
+	unsigned long ip = network | rank;
+	printf("%ld.%ld.%ld.%ld\n", (ip & 0xff000000)>>24, (ip & 0x00ff0000)>>16, (ip & 0x0000ff00)>>8, ip & 0x000000ff);
+	return 0;
+}
+

Added: usertools/cio/tools/src/isdata.c
===================================================================
--- usertools/cio/tools/src/isdata.c	                        (rev 0)
+++ usertools/cio/tools/src/isdata.c	2009-03-28 15:56:36 UTC (rev 2752)
@@ -0,0 +1,80 @@
+/*
+ isdata.c
+   Utility to get the role of the CN in the CIO ecosystem
+
+ gcc -mpowerpc -Wall -I/bgsys/drivers/ppcfloor/arch/include/  -o isdata isdata.c 
+
+ aespinosa at cs.uchicago.edu
+*/
+
+#include <stdio.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <common/bgp_personality_inlines.h>
+
+static _BGP_Personality_t pers;
+
+int main(int argc, char* argv[])
+{
+    int fd;
+    int rc;
+
+    fd = open("/proc/personality", O_RDONLY);
+    if( fd < 0 )
+    {
+	    fprintf(stderr,"Unable to open /proc/personality");
+	    exit(1);
+    }
+    rc = read(fd, (char*)&pers, sizeof(_BGP_Personality_t));
+    if( rc!=sizeof(_BGP_Personality_t) )
+    {
+	    fprintf(stderr,"Failed to read /proc/personality");
+	    exit(1);
+    }
+    close(fd);
+/*
+ * usage:
+ *  isdata [PART_SIZE] [DNUM] [STR]
+ *    [ PART_SIZE ] - total number of nodes/ size of job partition
+ *    [ DNUM ] - number of data CNs in the partition
+ *    [ STR ] - number of data CNs to stripe together
+ *
+ */
+    
+    int psize, dnum, str;
+    sscanf( argv[1], "%d", &psize );
+    sscanf( argv[2], "%d", &dnum );
+    sscanf( argv[3], "%d", &str );
+    int *target_rank = (int*) malloc( dnum * sizeof(int) );
+
+    int i;
+    int flag = 0;
+
+    for ( i = 0; i < dnum; i++ )
+    {
+        target_rank[i] = psize * ( 2*i + 1 ) / ( 2*dnum );
+        if ( pers.Network_Config.Rank == target_rank[i] )
+        {
+            printf("head");
+            flag = 1;
+            break;
+        }
+        else if ( target_rank[i] < pers.Network_Config.Rank 
+            && pers.Network_Config.Rank < target_rank[i] + str )
+        {
+            printf("slave");
+            flag = 1;
+            break;
+        }
+    }
+    if( !flag )
+    {
+        printf("app");
+    }
+    return 0;
+}

Added: usertools/cio/tools/src/rank.c
===================================================================
--- usertools/cio/tools/src/rank.c	                        (rev 0)
+++ usertools/cio/tools/src/rank.c	2009-03-28 15:56:36 UTC (rev 2752)
@@ -0,0 +1,43 @@
+/*
+ BGP personality sample code
+
+
+ gcc -mpowerpc -Wall -I/bgsys/drivers/ppcfloor/arch/include/  -o pers pers.c 
+
+ kazutomo at mcs.anl.gov
+*/
+
+#include <stdio.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <common/bgp_personality_inlines.h>
+
+static _BGP_Personality_t pers;
+
+int main()
+{
+    int fd;
+    int rc;
+
+    fd = open("/proc/personality", O_RDONLY);
+    if( fd < 0 ) {
+	fprintf(stderr,"Unable to open /proc/personality");
+	exit(1);
+    }
+    rc = read(fd, (char*)&pers, sizeof(_BGP_Personality_t));
+    if( rc!=sizeof(_BGP_Personality_t) ) {
+	fprintf(stderr,"Failed to read /proc/personality");
+	exit(1);
+    }
+    close(fd);
+
+    printf("%d\n",pers.Network_Config.Rank);
+
+    return 0;
+}
+




More information about the Swift-commit mailing list