X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/30d4658a4fe5933ee06cdc60f6910a9e3f01e831..e89f9f044e0a5071de93ec27bfca5993b9c86d1f:/examples/msg/chord/run_chord diff --git a/examples/msg/chord/run_chord b/examples/msg/chord/run_chord index e6f3b9ce0a..8c3049b2e6 100755 --- a/examples/msg/chord/run_chord +++ b/examples/msg/chord/run_chord @@ -1,8 +1,48 @@ #!/bin/bash -nb_lines=$[$1 + 3] -head -n $nb_lines chord100000.xml > tmp_depl.xml +# This script runs Chord with the specified number of nodes. +# Usage: ./run_chord nb_nodes +# The platform file is chosen as the smallest platform of the files +# examples/platforms/cluster_with_*_hosts.xml that contains enough nodes. + +# check arguments number +if [ $# != 1 ]; then + echo "Usage: ./run_chord nb_nodes" + exit 1 +fi + +# pick an appropriate platform file +if [ $1 -le 100 ]; then + platform=100 +else + if [ $1 -le 1000 ]; then + platform=1000 + else + if [ $1 -le 10000 ]; then + platform=10000 + else + if [ $1 -le 100000 ]; then + platform=100000 + else + if [ $1 -le 300000 ]; then + platform=300000 + else + echo "Cannot find a platform file large enough." + exit 2 + fi + fi + fi + fi +fi + +# set up the deployment file +nb_lines=$[ $1 + 3] +head -n $nb_lines chord300000.xml > tmp_depl.xml echo "" >> tmp_depl.xml -./chord -nb_bits=24 -timeout=200 ../../platforms/cluster_with_300000_hosts.xml tmp_depl.xml -#rm tmp_depl.xml + +# run Chord +./chord -nb_bits=24 -timeout=50 "../../platforms/cluster_with_${platform}_hosts.xml" tmp_depl.xml + +# cleanup +# rm tmp_depl.xml