Log In
New Account
  
 
Home My Page Project Tree Code Snippets Project Openings NUTSS
 
 
Summary Tracker Lists CVS Files
 

CVS | Administration

Annotation of libnutss/examples/swp_vl_test, revision 1.12

1.1       ths         1: #!/bin/bash
                      2:
                      3: trap "killall lt-nutssd lt-slinksvariableload" SIGINT SIGTERM
                      4:
                      5: if [ "$#" == "0" ]; then
1.12    ! ths         6:     echo -e "Usage:\n  swp_vl_test num_nodes num_msgs percent_load max_flow_duration max_flow_weight max_capacity experiment_duration"
1.1       ths         7:     exit 0
                      8: fi
                      9:
                     10: if [ ! -x "./slinksvariableload" -o ! -x "./nutssd" ]; then
                     11:     echo "Cannot file slinkapp and nutssd."
                     12:     echo "The test must be run from the libnutss/examples directory"
                     13:     exit 0
                     14: fi
                     15:
                     16: mkdir -p output
                     17: rm output/*
                     18:
1.9       ths        19: echo nodes: $1 > output/param1.txt
1.12    ! ths        20: echo requests per node: $2 > output/param2.txt
        !            21: echo max percent load: $3 > output/param3.txt
        !            22: echo max flow duration: $4 > output/param4.txt
        !            23: echo max flow weight: $5 > output/param5.txt
        !            24: echo max capacity: $6 > output/param6.txt
1.11      ths        25: echo experiment duration: $7 > output/param7.txt
1.5       ths        26:
                     27: cat output/param* > output/args.txt
                     28: rm output/param*
                     29:
1.9       ths        30: killall lt-slinksvariableload
1.1       ths        31: killall lt-nutssd
1.2       ths        32: ./nutssd -stwn -r sip.nutss.net:5060 -p ths1 ths1@nutss.net >output/debug_registrar.txt &
1.1       ths        33:
1.2       ths        34: for i in $(seq $1); do
1.12    ! ths        35:         if [ $i -ne 99 ]; then
        !            36:      # with some small probability, generate a super node with capacity many times greater than normal
        !            37:      if [ `expr $RANDOM % $6` -gt `expr $6 - $6 / 25` ]; then
        !            38:     ./slinksvariableload $i $2 $3 `expr $RANDOM % $4 + 60` `expr $RANDOM % $5 + 200` `expr $RANDOM % $6 + 100000` &
        !            39:     echo node $i is a super node
        !            40:      else
        !            41:     ./slinksvariableload $i $2 $3 `expr $RANDOM % $4 + 60` `expr $RANDOM % $5 + 200` `expr $RANDOM % $6 + 1200` &
        !            42:       fi
        !            43:       fi
1.1       ths        44: done
                     45:
1.12    ! ths        46: ./slinksvariableload 99 $1 `expr $1 / 6` $7 &
        !            47:
        !            48: #for i in $(seq $1 `expr $1 \* 3`); do
        !            49:      sleep 10
        !            50:      if [ `expr $RANDOM % 100` -lt 50 ] && [ $i -ne 99 ]; then
        !            51:     if [ `expr $RANDOM % $6` -gt `expr $6 - $6 / 8` ]; then
        !            52:    ./slinksvariableload $i $2 $3 `expr $RANDOM % $4 + 60` `expr $RANDOM % $5 + 200` `expr $RANDOM % $6 + 20000` &
        !            53:     else
        !            54:    ./slinksvariableload $i $2 $3 `expr $RANDOM % $4 + 60` `expr $RANDOM % $5 + 200` `expr $RANDOM % $6 + 1200` &
        !            55:      fi
        !            56:      fi
        !            57: #done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
 

GForge.cis.cornell.edu is brought to you by

Cornell Computing and Information Science


Powered By GForge Collaborative Development Environment