Created
September 20, 2017 02:05
-
-
Save cjhgo/f061718889a600bd693b53a107184d1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
graph=" --graph="$1 | |
if [ "$2" = "sync" ] | |
then | |
engine=" --engine=sync" | |
else | |
engine=" --engine=async --engine_opts endgame=true" | |
fi | |
if [ -z "$3" ]; | |
then | |
ncpus=' ' | |
else | |
ncpus=' --ncpus='$3 | |
fi | |
if [ -z "$4" ]; | |
then | |
format=' --format=snap' | |
else | |
format=" --format=$4" | |
fi | |
sssp="/root/powerswitch/release/toolkits/graph_analytics/sssp --graph_opts ingress=oblivious \ | |
--max_degree_source=true --directed=true " | |
sssp_to_run=$sssp$graph$format$engine$ncpus | |
detail_file_path="/root/bin/"`hostname`"_sssp_scala_res" | |
number_file_path="/root/bin/num_"`hostname`"_sssp_scala_res" | |
rm $detail_file_path | |
rm $number_file_path | |
for i in $(seq 1 16);do | |
#echo `/root/bin/run_sssp roadNet-CA.txt async` | |
echo $i | |
to_run="mpiexec -n 2 -H 172.17.0.4,172.17.0.7 $sssp_to_run " | |
echo $to_run | |
${to_run} 2>& 1|cat >/tmp/run_res | |
cpu_nubmer=$(grep 'ncpus' /tmp/run_res) | |
instances=$(grep 'instances created' /tmp/run_res) | |
run_time=$(grep 'Finish' /tmp/run_res) | |
run_time_number=$(echo $run_time|grep -Eo '[0-9]{1,}.?[0-9]?') | |
network_sent=$(grep 'Network Sent' /tmp/run_res) | |
run_res="$i\n$cpu_nubmer\n$instances\n$run_time\n$network_sent\n" | |
echo -e $run_res | |
echo -e $run_res>>$detail_file_path | |
echo -e $i","$run_time_number>>$number_file_path | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment