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

CVS | Administration


File:  [GForge:cvsroot/nutss] / libnutss / examples / swp_vl_test
Revision 1.16: download - view: text, annotated - select for diffs
Wed Oct 10 19:20:58 2007 UTC (9 years, 5 months ago) by ths
Branches: MAIN
CVS tags: HEAD
minimal change to test rig

#!/bin/bash

trap "killall lt-nutssd lt-slinksvariableload" SIGINT SIGTERM

if [ "$#" == "0" ]; then
    echo -e "Usage:\n  swp_vl_test num_nodes num_msgs percent_load max_flow_duration max_flow_weight max_capacity experiment_duration"
    exit 0
fi

if [ ! -x "./slinksvariableload" -o ! -x "./nutssd" ]; then
    echo "Cannot file slinkapp and nutssd."
    echo "The test must be run from the libnutss/examples directory"
    exit 0
fi

mkdir -p output
rm output/*

echo nodes: $1 > output/param1.txt
echo requests per node: $2 > output/param2.txt
echo max percent load: $3 > output/param3.txt
echo max flow duration: $4 > output/param4.txt
echo max flow weight: $5 > output/param5.txt
echo max capacity: $6 > output/param6.txt
echo experiment duration: $7 > output/param7.txt

cat output/param* > output/args.txt
rm output/param*

rm log.txt
killall lt-slinksvariableload
killall lt-nutssd
./nutssd -stwn -r sip.nutss.net:5060 -p ths1 ths1@nutss.net >output/debug_registrar.txt &

for i in $(seq $1); do
        if [ $i -ne 99 ]; then
		# with some small probability, generate a super node with capacity many times greater than normal
		# if [ `expr $RANDOM % $6` -gt `expr $6 - $6 / 50` ]; then
		if [ $i -eq 1 ]; then 
			./slinksvariableload $i $2 $3 `expr $RANDOM % $4 + 60` `expr $RANDOM % $5 + 200` `expr $RANDOM % $6 + 50000` &
		else
			./slinksvariableload $i $2 $3 `expr $RANDOM % $4 + 60` `expr $RANDOM % $5 + 200` `expr $RANDOM % $6 + 1200` &
        	fi
	fi
done

./slinksvariableload 99 $1 12 $7 &

for i in $(seq `expr $1 + 1` `expr 50 + $1`); do
	sleep 45
	if [ $i -ne 99 ]; then
		./slinksvariableload $i $2 $3 `expr $RANDOM % $4 + 60` `expr $RANDOM % $5 + 200` `expr $RANDOM % $6 + 1200` &
	fi
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