#!/usr/local/bin/tcsh
# 
# generates a Topology (strips nodes from tiers) and a random 
# comunication matrix

if (($1 == "") || ($2 == "") || ($3 == "")) then
  echo "Usage: $0 <name> <# centers> <# nodes per center>"
  exit
endif

echo "Tiers is generating the network"
tiers 1 $2 $3 1 1 1 > $1.tmp   
echo "Stripping GNU 3.5 infos"
awk -f firstpass.awk $1.tmp > $1.tmp.gnu3.5
awk -f secondpass.awk $1.tmp > $1.tmp.data3.5
echo "Stripping the nodes"
stripNodes $1.tmp.data3.5 > $1.def
echo "Nodes stripped, generating the communication matrix"
genMatrix $1.def >> $1.def

rm $1.tmp*

echo "done"
