exec_scr_multiple_DSE.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/bash
  2. index_start=$1
  3. num_of_rounds=$2
  4. num_of_apps=$3
  5. exec_name=$4
  6. scen_dir=$5
  7. scen_name=$6
  8. res_dir=$7
  9. idag_conf=$8
  10. suffix=$9
  11. app_input_file=${10}
  12. app_type=${11}
  13. Selfopt_Radius=${12}
  14. Selfopt_Rounds=${13}
  15. suffix=$suffix'_'$Selfopt_Radius'_'$Selfopt_Rounds
  16. fname_output=$scen_dir/$scen_name/$res_dir/$idag_conf'_'$suffix'_'output.txt
  17. echo $fname_output
  18. for (( i=$index_start; i<=$num_of_rounds; i++ ))
  19. do
  20. date
  21. ./clear_app_logs.sh 128 $scen_dir/$scen_name/app_logs > /dev/null
  22. fname_power=power_$num_of_apps'_'$res_dir/power'_'$idag_conf'_'$suffix'_'$i.txt
  23. echo $fname_power
  24. #fname_power_output=power_output_$num_of_apps'_'$i.txt
  25. #echo $fname_power_output
  26. sccBmc -c status
  27. time_init=$(date +%H-%M-%S-%N)
  28. echo "Init time" $time_init
  29. ./power_tst.sh $fname_power & #power_64_3.txt &
  30. power_pid=$!
  31. ./brccerun -nue 48 -f rc.hosts_48 $exec_name -d $scen_dir/ -n $scen_name/ -i $idag_conf -a $app_input_file -p paxos_0.conf -x 1 -y 1 -t $app_type -r $Selfopt_Radius -u $Selfopt_Rounds &
  32. rcce_pid=$!
  33. ./watchdog.sh $exec_name & #my_rtrm_power & #$rcce_pid &
  34. watchdog_pid=$!
  35. echo "watchdog_pid " $watchdog_pid
  36. wait $rcce_pid
  37. kill -9 $power_pid
  38. time_fin=$(date +%H-%M-%S-%N)
  39. echo "SCC exec completed successfully!"
  40. sleep 10s
  41. if [ -e /proc/$watchdog_pid ]
  42. then
  43. kill -9 $watchdog_pid
  44. echo "Init time" $time_init
  45. echo $fname_power > $scen_dir/$scen_name/tmp_power_out
  46. date >> $scen_dir/$scen_name/tmp_power_out
  47. echo "Init time" $time_init >> $scen_dir/$scen_name/tmp_power_out
  48. echo "Finish time" $time_fin
  49. echo "Finish time" $time_fin >> $scen_dir/$scen_name/tmp_power_out
  50. ./get_power_stats.py $fname_power >> $scen_dir/$scen_name/tmp_power_out
  51. #cp_scr.sh has to be in the appropriate directory to find the files to copy. FIXME probably
  52. #mul_scenaria/8x6_power/cp_scr.sh $num_of_apps $i $res_dir
  53. cd $scen_dir/$scen_name/
  54. mkdir $res_dir/$idag_conf'_'$suffix
  55. ./cp_scr.sh $num_of_apps $i $res_dir/$idag_conf'_'$suffix
  56. cd ../../../
  57. ##sleep 30s
  58. ##cat current_exec_out.txt >> $fname_output
  59. ##sleep 30s
  60. fi
  61. sleep 10
  62. done