diff --git a/master-slave/logs/scripts/bubble-sort-speedup-efficiency.gp b/master-slave/logs/scripts/bubble-sort-speedup-efficiency.gp new file mode 100644 index 0000000000000000000000000000000000000000..c8799567c4c09ae4353665bda42d13b3f9741bf6 --- /dev/null +++ b/master-slave/logs/scripts/bubble-sort-speedup-efficiency.gp @@ -0,0 +1,21 @@ +reset + +set terminal pdf enhanced +set output "bubble-sort-speedup-efficiency.pdf" + +set title "Bubble Sort: Speedup x Efficiency" offset 0,-.5 +set xlabel "Number Workers" +set ylabel "Speedup" +set y2label "Efficiency" + +set key box +set key autotitle columnheader +set key samplen 3 spacing 1 font ",9" + +set grid + +set y2tics +set auto x + +plot "bubble-sort.dat" every ::1 using 0:6:xticlabels(1) title col with linespoints linewidth 1 linecolor "#00c000" pointtype 3 pointsize .5, \ + "bubble-sort.dat" every ::1 using 0:7:xticlabels(1) title col with linespoints axes x1y2 linewidth 1 linecolor "#e69f00" pointtype 5 pointsize .3 diff --git a/master-slave/logs/scripts/bubble-sort-speedup-efficiency.pdf b/master-slave/logs/scripts/bubble-sort-speedup-efficiency.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d40cbb0e9ae0d53f92558c98b1e114ad6139becc Binary files /dev/null and b/master-slave/logs/scripts/bubble-sort-speedup-efficiency.pdf differ diff --git a/master-slave/logs/scripts/bubble-sort-time.gp b/master-slave/logs/scripts/bubble-sort-time.gp new file mode 100644 index 0000000000000000000000000000000000000000..089c63bcb3d233a81e4af4af924e9f16a026dc65 --- /dev/null +++ b/master-slave/logs/scripts/bubble-sort-time.gp @@ -0,0 +1,25 @@ +reset + +set terminal pdf enhanced +set output "bubble-sort-time.pdf" + +set title "Bubble Sort: Execution Time x Efficiency" offset 0,-.5 +set xlabel "Number Workers" +set ylabel "Execution Time (s)" +set y2label "Efficiency" + +set key box +set key outside top center vertical maxrows 2 maxcols 6 +set key autotitle columnheader +set key samplen 3 spacing 1 font ",9" + +set grid +set style data histogram +set style histogram cluster gap 2 errorbars linewidth 1 + +set y2tics +set auto x + +plot "bubble-sort.dat" using 2:3:xticlabels(1) title col linewidth 2 linecolor "#ff0000" fillstyle pattern 1, \ + "bubble-sort.dat" using 4:5:xticlabels(1) title col linewidth 2 linecolor "#8b0000" fillstyle pattern 6, \ + "bubble-sort.dat" using 0:7 title col with linespoints axes x1y2 linewidth 1 linecolor "#e69f00" pointtype 5 pointsize .3 diff --git a/master-slave/logs/scripts/bubble-sort-time.pdf b/master-slave/logs/scripts/bubble-sort-time.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8a69937b796feaf660455d99d11e53f59c1627e0 Binary files /dev/null and b/master-slave/logs/scripts/bubble-sort-time.pdf differ diff --git a/master-slave/logs/scripts/bubble-sort.dat b/master-slave/logs/scripts/bubble-sort.dat new file mode 100644 index 0000000000000000000000000000000000000000..0d8978954d83c71828ced67e21d5f30a9870044d --- /dev/null +++ b/master-slave/logs/scripts/bubble-sort.dat @@ -0,0 +1,15 @@ +np Sequential Sequential_std MPI MPI_std Speedup Efficiency +seq. 352.503 0.1455632737563532 0 0 1 1 +2 0 0 352.548 0.09614918963084468 .99987235 .49993617 +4 0 0 117.73133333333334 0.04404795366667894 2.99413070 .74853267 +6 0 0 70.65650000000001 0.04099691045269844 4.98896775 .83149462 +8 0 0 50.43833333333333 0.005230891149910803 6.98879159 .87359894 +10 0 0 39.47280000000001 0.010266774891205208 8.93027603 .89302760 +12 0 0 32.1264 0.009140386570964986 10.97237785 .91436482 +14 0 0 30.57636666666667 0.12475154864324783 11.52860978 .82347212 +16 0 0 28.713700000000003 0.43468407684969024 12.27647429 .76727964 +18 0 0 26.900599999999997 0.5072294221224417 13.10390846 .72799491 +20 0 0 25.78746666666667 0.27428537855468876 13.66954748 .68347737 +22 0 0 24.5519 0.29837165861835235 14.35746316 .65261196 +24 0 0 23.341799999999996 0.01289056502511259 15.10179163 .62924131 +48 0 0 23.454200000000004 0.1954809624149283 15.02941903 .31311289 diff --git a/master-slave/logs/scripts/create-dataset.sh b/master-slave/logs/scripts/create-dataset.sh index ddbcd78ee293167255146ade057b2aa2729e3eba..ed1c9e2aaa5640831d4462b5ea415f0352960d8f 100755 --- a/master-slave/logs/scripts/create-dataset.sh +++ b/master-slave/logs/scripts/create-dataset.sh @@ -5,24 +5,23 @@ get_mean_std() { } script_dir=$(dirname "$0") -n=3 + +## LINEAR REGRESSION ## linear_regression_dat_path=$script_dir/linear-regression.dat rm $linear_regression_dat_path -echo "np Sequential Sequential_std Grain-10000 10000_std Grain-100000 100000_std Grain-500000 500000_std Grain-1000000 1000000_std mean_time Speedup Efficiency" >> $linear_regression_dat_path - +echo "np Sequential Sequential_std Grain-10000 10000_std Grain-100000 100000_std Grain-500000 500000_std Grain-1000000 1000000_std mean_time_grains Speedup Efficiency" >> $linear_regression_dat_path file=$script_dir/../linear-regression/sequential-*.txt total_time=$(cat $file | grep -P "Time\slinear\sregression\s\(s\):" | grep -Po "[0-9]+[.][0-9]+" | get_mean_std) +sequential_time=$(echo $total_time | awk '{ print $1 }') row="seq. " for element in $total_time; do row="$row$element " done -row="$row 0 0 0 0 0 0 0 0 0 0 0" +row="$row 0 0 0 0 0 0 0 0 $sequential_time 1 1" echo $row >> $linear_regression_dat_path -sequential_time=$(echo $total_time | awk '{ print $1 }') - processes=($(seq 2 2 24) 48) for np in "${processes[@]}"; do time_grain=0 @@ -39,6 +38,39 @@ for np in "${processes[@]}"; do time_grain=$(echo "scale=8; $time_grain / 4" | bc -l) speedup=$(echo "scale=8; $sequential_time / $time_grain" | bc -l) efficiency=$(echo "scale=8; $speedup / $np" | bc -l) - row="$row$time_grain $speedup $efficiency " + row="$row$time_grain $speedup $efficiency" echo $row >> $linear_regression_dat_path done +## LINEAR REGRESSION ## + +## BUBBLE SORT ## +bubble_sort_dat_path=$script_dir/bubble-sort.dat +rm $bubble_sort_dat_path + +echo "np Sequential Sequential_std MPI MPI_std Speedup Efficiency" >> $bubble_sort_dat_path + +file=$script_dir/../bubble-sort/sequential-*.txt +total_time=$(cat $file | grep -P "Time\ssort\s\(s\):" | grep -Po "[0-9]+[.][0-9]+" | get_mean_std) +sequential_time=$(echo $total_time | awk '{ print $1 }') +row="seq. " +for element in $total_time; do + row="$row$element " +done +row="$row 0 0 1 1" +echo $row >> $bubble_sort_dat_path + +processes=($(seq 2 2 24) 48) +for np in "${processes[@]}"; do + row="$np 0 0 " + file=$script_dir/../bubble-sort/mpi-$np-*.txt + total_time=$(cat $file | grep -P "Time\ssort\s\(s\):" | grep -Po "[0-9]+[.][0-9]+" | get_mean_std) + for element in $total_time; do + row="$row$element " + done + t=$(echo $total_time | awk '{ print $1 }') + speedup=$(echo "scale=8; $sequential_time / $t" | bc -l) + efficiency=$(echo "scale=8; $speedup / $np" | bc -l) + row="$row$speedup $efficiency" + echo $row >> $bubble_sort_dat_path +done +## BUBBLE SORT ## diff --git a/master-slave/logs/scripts/linear-regression-speedup-efficiency.gp b/master-slave/logs/scripts/linear-regression-speedup-efficiency.gp index 81bc3d54c82e5259d337bf53764c2a0ad7f8f01d..9f65e93f36291fd897280df7a72aab0441e00d99 100644 --- a/master-slave/logs/scripts/linear-regression-speedup-efficiency.gp +++ b/master-slave/logs/scripts/linear-regression-speedup-efficiency.gp @@ -3,19 +3,19 @@ reset set terminal pdf enhanced set output "linear-regression-speedup-efficiency.pdf" -set title "Linear Regression Speedup and Efficiency" offset 0,-.5 +set title "Linear Regression: Speedup x Efficiency" offset 0,-.5 set xlabel "Number Workers" set ylabel "Speedup" set y2label "Efficiency" set key box -set key outside top center vertical maxrows 2 maxcols 6 set key autotitle columnheader set key samplen 3 spacing 1 font ",9" -set y2tics +set grid +set y2tics set auto x -plot "linear-regression.dat" using 0:13 title col linewidth 1 linecolor "yellow" with lines, \ - "linear-regression.dat" using 0:14 title col linewidth 1 linecolor "red" with lines axes x1y2 +plot "linear-regression.dat" every ::1 using 0:13:xticlabels(1) title col with linespoints linewidth 1 linecolor "#00c000" pointtype 3 pointsize .5, \ + "linear-regression.dat" every ::1 using 0:14:xticlabels(1) title col with linespoints axes x1y2 linewidth 1 linecolor "#e69f00" pointtype 5 pointsize .3 diff --git a/master-slave/logs/scripts/linear-regression-speedup-efficiency.pdf b/master-slave/logs/scripts/linear-regression-speedup-efficiency.pdf index 0909a74e177d74c08c62a135a664541764a0dcda..70ed11f2e4ef081fcd7bc4155de2dca7b188ceec 100644 Binary files a/master-slave/logs/scripts/linear-regression-speedup-efficiency.pdf and b/master-slave/logs/scripts/linear-regression-speedup-efficiency.pdf differ diff --git a/master-slave/logs/scripts/linear-regression-time.gp b/master-slave/logs/scripts/linear-regression-time.gp index 7b9f10a45af6698e63fc872ed79494bb0f22f8f3..12cb6449bcf44c6fbfdf453038c79afc49a93b90 100644 --- a/master-slave/logs/scripts/linear-regression-time.gp +++ b/master-slave/logs/scripts/linear-regression-time.gp @@ -3,9 +3,9 @@ reset set terminal pdf enhanced set output "linear-regression-time.pdf" -set title "Linear Regression Execution Time" offset 0,-.5 +set title "Linear Regression: Execution Time x Efficiency" offset 0,-.5 set xlabel "Number Workers" -set ylabel "Time (s)" +set ylabel "Execution Time (s)" set y2label "Efficiency" set key box @@ -13,11 +13,11 @@ set key outside top center vertical maxrows 2 maxcols 6 set key autotitle columnheader set key samplen 3 spacing 1 font ",9" +set grid set style data histogram set style histogram cluster gap 2 errorbars linewidth 1 set y2tics - set auto x plot "linear-regression.dat" using 2:3:xticlabels(1) title col linewidth 2 linecolor "#ff0000" fillstyle pattern 1, \ @@ -25,4 +25,4 @@ plot "linear-regression.dat" using 2:3:xticlabels(1) title col linewidth 2 linec "linear-regression.dat" using 6:7:xticlabels(1) title col linewidth 2 linecolor "#4169e1" fillstyle pattern 4, \ "linear-regression.dat" using 8:9:xticlabels(1) title col linewidth 2 linecolor "#8b0000" fillstyle pattern 2, \ "linear-regression.dat" using 10:11:xticlabels(1) title col linewidth 2 linecolor "#556b2f" fillstyle pattern 5, \ - "linear-regression.dat" using 0:14 title col linewidth 1 linecolor "red" with lines axes x1y2, \ + "linear-regression.dat" using 0:14 title col with linespoints axes x1y2 linewidth 1 linecolor "#e69f00" pointtype 5 pointsize .3 diff --git a/master-slave/logs/scripts/linear-regression-time.pdf b/master-slave/logs/scripts/linear-regression-time.pdf index 4688f3a82df9d7128c7f32d5fdc44c499c403d0b..25319fa2ffff609c05c7fdf09906ab08bd91efc7 100644 Binary files a/master-slave/logs/scripts/linear-regression-time.pdf and b/master-slave/logs/scripts/linear-regression-time.pdf differ diff --git a/master-slave/logs/scripts/linear-regression.dat b/master-slave/logs/scripts/linear-regression.dat index b86fc2446ebd966e5e7a8356db7fbc7a3ea3f60c..1cde8aef66c3ab61c2d24a7c13469580946ac701 100644 --- a/master-slave/logs/scripts/linear-regression.dat +++ b/master-slave/logs/scripts/linear-regression.dat @@ -1,5 +1,5 @@ -np Sequential Sequential_std Grain-10000 10000_std Grain-100000 100000_std Grain-500000 500000_std Grain-1000000 1000000_std mean_time Speedup Efficiency -seq. 4.486043333333334 0.000365543735033514 0 0 0 0 0 0 0 0 0 0 0 +np Sequential Sequential_std Grain-10000 10000_std Grain-100000 100000_std Grain-500000 500000_std Grain-1000000 1000000_std mean_time_grains Speedup Efficiency +seq. 4.486043333333334 0.000365543735033514 0 0 0 0 0 0 0 0 4.486043333333334 1 1 2 0 0 5.40055 0.007160991551454294 5.785603333333333 0.009556032417041985 6.033983333333334 0.0077680728340789 6.187483333333333 0.01585316442298574 5.85190500 .76659537 .38329768 4 0 0 1.8256666666666668 0.004694183161696559 1.9494366666666665 0.0019472088286113564 2.0673333333333335 0.001036800634430532 2.14784 0.01089272540123288 1.99756916 2.24575119 .56143779 6 0 0 1.0913633333333335 0.0012328918128620206 1.1756166666666668 0.00220267009684971 1.27081 0.0018925291719459586 1.3137566666666667 0.0029505291427508857 1.21288666 3.69865007 .61644167