Changeset 145
- Timestamp:
- 05/31/07 21:45:58
- Files:
-
- guts_main/guts_main.sh (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
guts_main/guts_main.sh
r130 r145 14 14 15 15 # Initial cleanup 16 if [ -e units.passed ]; then16 if test -f units.passed ; then 17 17 rm -f units.passed 18 18 fi 19 19 20 if [ -e units.notpassed ]; then20 if test -f units.notpassed ; then 21 21 rm -f units.notpassed 22 22 fi 23 23 24 echo -ne"\n\n"25 echo -e"_______________ Script for compiling and running GUTS-UPC _______________\n"24 printf "\n\n" 25 printf "_______________ Script for compiling and running GUTS-UPC _______________\n" 26 26 27 27 umask 0002 … … 32 32 33 33 echo "Running the testing suite for ${NP} threads" 34 echo -ne"\n"34 printf "\n" 35 35 passed=0 36 36 failed=0 37 37 cmp_failed=0 38 38 39 # flags for Berkeley UPC Compiler 40 # NOTE: interface to automatically set these variables for various UPC Compilers 41 # will be added as we get access and test those UPC Compilers 39 42 UPCC=upcc 43 UPC_FLAGS="-T=${NP}" 44 45 # for gcc-upc use the following flags instead 46 # UPCC=upc 47 # UPC_FLAGS="-fupc-threads-${NP}" 40 48 41 49 for UNIT in `cat ${UNITS}`; do 42 echo -e "--------------> Working on unit -- $UNIT\n"50 printf ">--------------> Working on unit -- $UNIT\n" 43 51 44 build_output=`$UPCC -T=${NP}-I../include $UNIT.upc -o $UNIT >>$UNIT.out 2>$UNIT.errout`52 build_output=`$UPCC $UPC_FLAGS -I../include $UNIT.upc -o $UNIT >>$UNIT.out 2>$UNIT.errout` 45 53 46 if [ $? -eq 0 ]; then54 if test $? -eq 0 ; then 47 55 echo $build_output 48 56 echo "Compilation was SUCCESSFUL for the unit [${UNIT}]" 49 57 echo "Now the unit [${UNIT}] will be run for ${NP} threads ..." 58 #runtime settings for berkeley UPC 50 59 RUN=`eval echo "upcrun -qn ${NP} ${UNIT}"` 60 #use the following runtime settings for gcc-upc 61 #RUN=`eval echo "./${UNIT}"` 51 62 echo $RUN 52 63 exe_output=`$RUN` 53 if [ $? -eq 0 ]; then54 echo -e"TEST \033[34m\033[1mPASSED\033[0m for the unit [$UNIT]"64 if test $? -eq 0 ; then 65 printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$UNIT]" 55 66 echo $exe_output 56 67 echo "$UNIT" >>units.passed 57 passed= $((passed+1))68 passed=`expr $passed + 1` 58 69 else 59 echo -e"TEST \033[31m\033[1mFAILED\033[0m for the unit [$UNIT]"70 printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$UNIT]" 60 71 echo $exe_output 61 72 echo "$UNIT" >>units.notpassed 62 failed= $((failed+1))73 failed=`expr $failed + 1` 63 74 fi 64 75 … … 74 85 `rm -f *.o ${UNIT} ${UNIT}.*out` 75 86 76 echo -ne"\n"77 echo -e "===============================================================================\n"87 printf "\n" 88 printf "===============================================================================\n\n" 78 89 done 79 90 … … 82 93 83 94 for NUNIT in `cat ${UNITS_NEG}`; do 84 echo -e"--------------> Working on unit -- $NUNIT\n"95 printf "--------------> Working on unit -- $NUNIT\n" 85 96 86 build_output=`$UPCC -T=${NP}-I../include $NUNIT.upc -o $NUNIT`97 build_output=`$UPCC $UPC_FLAGS -I../include $NUNIT.upc -o $NUNIT` 87 98 88 if [ $? -eq 0 ]; then99 if test $? -eq 0 ; then 89 100 echo $build_output 90 101 echo "ERROR: The NEGATIVE unit [$NUNIT] pass the compilation phase" … … 92 103 echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$NUNIT]" 93 104 echo "$NUNIT" >>units.notpassed 94 failed= $((failed+1))95 cmp_failed= $((cmp_failed+1))105 failed=`expr $failed + 1` 106 cmp_failed=`expr $cmp_failed + 1` 96 107 97 108 else … … 99 110 echo "Note that this is the EXPECTED result since the unit is negative" 100 111 echo "The unit will not be run!!!" 101 echo -e"TEST \033[34m\033[1mPASSED\033[0m for the unit [$NUNIT]"112 printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$NUNIT]" 102 113 echo "$NUNIT" >>units.passed 103 passed= $((passed+1))114 passed=`expr $passed + 1` 104 115 105 116 … … 109 120 110 121 111 echo -ne"\n"112 echo -e"===============================================================================\n"122 printf "\n" 123 printf "===============================================================================\n" 113 124 114 125 done … … 117 128 118 129 for RNUNIT in `cat ${RNUNITS}`; do 119 echo -e"--------------> Working on unit -- $RNUNIT\n"130 printf "--------------> Working on unit -- $RNUNIT\n" 120 131 121 build_output=`$UPCC -T=${NP}-I../include $RNUNIT.upc -o $RNUNIT >>$RNUNIT.out 2>$RNUNIT.errout`132 build_output=`$UPCC $UPC_FLAGS -I../include $RNUNIT.upc -o $RNUNIT >>$RNUNIT.out 2>$RNUNIT.errout` 122 133 123 if [ $? -eq 0 ]; then134 if test $? -eq 0 ; then 124 135 echo $build_output 125 136 echo "Compilation was SUCCESSFUL for the unit [${RNUNIT}]" 126 137 echo "Now the unit [${RNUNIT}] will be run for ${NP} threads ..." 127 138 echo "Note that this is a negative unit which MUST raise a RUNTIME ERROR" 139 #runtime settings for berkeley UPC 128 140 RUN=`eval echo "upcrun -qn ${NP} ${RNUNIT}"` 141 #use the following runtime settings for gcc-upc 142 #RUN=`eval echo "./${UNIT}"` 129 143 echo $RUN 130 144 exe_output=`$RUN` 131 if [ $? -eq 0 ]; then132 echo -e"TEST \033[31m\033[1mFAILED\033[0m for the unit [$UNIT]"145 if test $? -eq 0 ; then 146 printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$UNIT]" 133 147 echo "$UNIT" >>units.notpassed 134 failed= $((failed+1))148 failed=`expr $failed + 1` 135 149 else 136 echo -e"TEST \033[34m\033[1mPASSED\033[0m for the unit [$UNIT]"150 printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$UNIT]" 137 151 echo "$UNIT" >>units.passed 138 passed= $((passed+1))152 passed=`expr $passed + 1` 139 153 fi 140 154 … … 144 158 cat $RNUNIT.errout 145 159 echo "$RNUNIT" >>units.notpassed 146 failed= $((failed+1))147 cmp_failed= $((cmp_failed+1))160 failed=`expr $failed + 1` 161 cmp_failed=`expr $cmp_failed + 1` 148 162 fi 149 163 150 164 `rm -f *.o ${RNUNIT} ${RNUNIT}.*out` 151 165 152 echo -ne"\n"153 echo -e"===============================================================================\n"166 printf "\n" 167 printf "===============================================================================\n" 154 168 done 155 169 … … 157 171 # STATISTICAL OUTPUT 158 172 159 echo -e"________________ GWU-HPCL UPC Compiler Testing Summary ________________\n"173 printf "________________ GWU-HPCL UPC Compiler Testing Summary ________________\n" 160 174 echo "SUCCESSFUL UNITS --> (units.passed)" 161 echo -ne"\033[34m\033[1m"162 if [ -e units.passed ]; then175 printf "\033[34m\033[1m" 176 if test -f units.passed ; then 163 177 cat units.passed|sort|uniq 164 178 fi 165 echo -e"\033[0m"179 printf "\033[0m" 166 180 167 181 echo " FAILED UNITS --> (units.notpassed)" 168 echo -ne"\033[31m\033[1m"169 if [ -e units.notpassed ]; then182 printf "\033[31m\033[1m" 183 if test -f units.notpassed ; then 170 184 cat units.notpassed|sort|uniq 171 185 fi 172 echo -e"\033[0m"186 printf "\033[0m" 173 187 174 echo -e"\033[5m\033[1m\033[35m"188 printf "\033[5m\033[1m\033[35m" 175 189 echo " --> Number of units PASSED : $passed" 176 190 echo " --> Number of units FAILED : $failed" 177 total= $((passed+failed))191 total=`expr $passed + $failed` 178 192 percentage=$(((passed*100) / total)) 179 193 180 echo -e" --> $percentage % of the units have PASSED\n"181 echo -ne"\033[0m"182 echo -e"=========================== TEST END ====================================\n"194 printf " --> $percentage % of the units have PASSED\n" 195 printf "\033[0m" 196 printf "=========================== TEST END ====================================\n"
