- Timestamp:
- 08/30/10 14:14:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/berrada/MFLBC_RD_perfomanceMeasurement/scriptPerformance.sh
r408 r411 38 38 39 39 40 ##### Speedups 41 # Measure of the percentage of parallel code for the Amdahl law 42 cp -f 2Y2_mflbc_rd_amdahl.h Yworkdir/Y2mflbc_rd.h 43 YaoI +O3 mflbc_rd 44 ./mflbc_rd > resultAmdahlLaw.txt 45 echo "Percentage of parallel code: " 46 # cambiare il 4 per il 250--cambiato 47 # PAR is the parallel code 48 # PAR_percentage is the parallel code dived by 100 49 PAR=`awk '/counter 250 percentage of parallel code/ {print $7}' resultAmdahlLaw.txt` 50 echo $PAR 51 PAR_percentage=`echo "scale=6; $PAR/100" | bc` 52 echo $PAR_percentage 53 54 # not_PAR_percentage is 1-PAR_percentage 55 not_PAR_percentage=`echo "1-$PAR_percentage" | bc` 56 echo $not_PAR_percentage 57 58 # P is the number of cores 59 P2=2 60 P4=4 61 P8=8 62 63 64 # S is the Amdahl speedup. S1 is the speedup for one thread. S2 is for 2 threads. S is for the serial version (always equals to 1). 65 S=1 66 S1=1 67 S2=`echo "scale=6; 1/(($PAR_percentage/$P2)+ $not_PAR_percentage)" | bc` 68 S4=`echo "scale=6; 1/(($PAR_percentage/$P4)+ $not_PAR_percentage)" | bc` 69 S8=`echo "scale=6; 1/(($PAR_percentage/$P8)+ $not_PAR_percentage)" | bc` 70 echo Amdahl speedup serial version 71 echo $S 72 echo Amdahl speedup 1 thread 73 echo $S1 74 echo Amdahl speedup 2 threads 75 echo $S2 76 echo Amdahl speedup 4 threads 77 echo $S4 78 echo Amdahl speedup 8 threads 79 echo $S8 80 echo 81 82 # E elapsed time of the serial version. E1 for the 1 thread version. E2 for the 2 threads version. 83 E=`awk '/counter 250/ {print $4}' resultNotParallelFile.txt` 84 E1=`awk '/counter 250/ {print $4}' resultParallelFile_1thread.txt` 85 E2=`awk '/counter 250/ {print $4}' resultParallelFile_2thread.txt` 86 E4=`awk '/counter 250/ {print $4}' resultParallelFile_4thread.txt` 87 E8=`awk '/counter 250/ {print $4}' resultParallelFile_8thread.txt` 88 echo Elapsed time serial version 89 echo $E 90 echo Elapsed time 1 thread 91 echo $E1 92 echo Elapsed time 2 threads 93 echo $E2 94 echo Elapsed time 4 threads 95 echo $E4 96 echo Elapsed time 8 threads 97 echo $E8 98 echo 99 100 101 102 103 40 104 # Generate the matlab files 41 105 echo "A=[1; 2; 4; 8];" >> mflbc_rd_matlabFile.m … … 43 107 44 108 echo "B=[" >> mflbc_rd_matlabFile.m 45 awk '/counter 250/ {print $4}' resultNotParallelFile.txt >> mflbc_rd_matlabFile.m 109 #awk '/counter 250/ {print $4}' resultNotParallelFile.txt >> mflbc_rd_matlabFile.m 110 echo $E >> mflbc_rd_matlabFile.m 46 111 echo "; " >> mflbc_rd_matlabFile.m 47 awk '/counter 250/ {print $4}' resultParallelFile_2thread.txt >> mflbc_rd_matlabFile.m 112 #awk '/counter 250/ {print $4}' resultParallelFile_2thread.txt >> mflbc_rd_matlabFile.m 113 echo $E2 >> mflbc_rd_matlabFile.m 48 114 echo "; " >> mflbc_rd_matlabFile.m 49 awk '/counter 250/ {print $4}' resultParallelFile_4thread.txt >> mflbc_rd_matlabFile.m 115 #awk '/counter 250/ {print $4}' resultParallelFile_4thread.txt >> mflbc_rd_matlabFile.m 116 echo $E4 >> mflbc_rd_matlabFile.m 50 117 echo "; " >> mflbc_rd_matlabFile.m 51 awk '/counter 250/ {print $4}' resultParallelFile_8thread.txt >> mflbc_rd_matlabFile.m 118 #awk '/counter 250/ {print $4}' resultParallelFile_8thread.txt >> mflbc_rd_matlabFile.m 119 echo $E8 >> mflbc_rd_matlabFile.m 52 120 echo "]; " >> mflbc_rd_matlabFile.m 53 121 … … 78 146 79 147 148 echo "Elapsed time of the parallel 1 thread execution: " 80 149 awk '/counter 250/ {print $4}' resultParallelFile_1thread.txt 81 150 … … 86 155 87 156 157
Note: See TracChangeset
for help on using the changeset viewer.