Changeset 145

Show
Ignore:
Timestamp:
05/31/07 21:45:58
Author:
apokayi
Message:

added the gcc-upc flags temporarily, interface will be provided later

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • guts_main/guts_main.sh

    r130 r145  
    1414 
    1515# Initial cleanup 
    16 if [ -e units.passed ]; then 
     16if test -f units.passed ; then 
    1717        rm -f units.passed 
    1818fi 
    1919 
    20 if [ -e units.notpassed ]; then 
     20if test -f units.notpassed ; then 
    2121        rm -f units.notpassed 
    2222fi 
    2323 
    24 echo -ne "\n\n" 
    25 echo -e "_______________      Script for compiling and running GUTS-UPC      _______________\n" 
     24printf "\n\n" 
     25printf "_______________      Script for compiling and running GUTS-UPC      _______________\n" 
    2626 
    2727umask 0002 
     
    3232 
    3333echo "Running the testing suite for ${NP} threads" 
    34 echo -ne "\n" 
     34printf "\n" 
    3535passed=0 
    3636failed=0 
    3737cmp_failed=0 
    3838 
     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 
    3942UPCC=upcc 
     43UPC_FLAGS="-T=${NP}" 
     44 
     45# for gcc-upc use the following flags instead 
     46# UPCC=upc 
     47# UPC_FLAGS="-fupc-threads-${NP}" 
    4048 
    4149for UNIT in `cat ${UNITS}`; do 
    42         echo -e "-------------->      Working on unit -- $UNIT\n" 
     50        printf ">-------------->      Working on unit -- $UNIT\n" 
    4351         
    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` 
    4553 
    46         if [ $? -eq 0 ] ; then 
     54        if test $? -eq 0 ; then 
    4755                echo $build_output       
    4856                echo "Compilation was SUCCESSFUL for the unit [${UNIT}]" 
    4957                echo "Now the unit [${UNIT}] will be run for ${NP} threads ..." 
     58                #runtime settings for berkeley UPC  
    5059                RUN=`eval echo "upcrun -qn ${NP} ${UNIT}"` 
     60                #use the following runtime settings for gcc-upc 
     61                #RUN=`eval echo "./${UNIT}"` 
    5162                echo $RUN 
    5263                exe_output=`$RUN`  
    53                 if [ $? -eq 0 ] ; then 
    54                         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]" 
    5566                        echo $exe_output 
    5667                        echo "$UNIT" >>units.passed 
    57                         passed=$((passed+1)) 
     68                        passed=`expr $passed + 1` 
    5869                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]" 
    6071                        echo $exe_output 
    6172                        echo "$UNIT" >>units.notpassed 
    62                         failed=$((failed+1)) 
     73                        failed=`expr $failed + 1` 
    6374                fi 
    6475                 
     
    7485        `rm -f *.o ${UNIT} ${UNIT}.*out` 
    7586         
    76         echo -ne "\n" 
    77         echo -e "===============================================================================\n" 
     87        printf "\n" 
     88        printf "===============================================================================\n\n" 
    7889done  
    7990 
     
    8293 
    8394for NUNIT in `cat ${UNITS_NEG}`; do 
    84         echo -e "-------------->      Working on unit -- $NUNIT\n" 
     95        printf "-------------->      Working on unit -- $NUNIT\n" 
    8596 
    86         build_output=`$UPCC -T=${NP} -I../include $NUNIT.upc -o $NUNIT` 
     97        build_output=`$UPCC $UPC_FLAGS -I../include $NUNIT.upc -o $NUNIT` 
    8798 
    88          if [ $? -eq 0 ] ; then 
     99         if test $? -eq 0 ; then 
    89100                echo $build_output  
    90101                echo "ERROR: The NEGATIVE unit [$NUNIT] pass the compilation phase" 
     
    92103                echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$NUNIT]" 
    93104                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` 
    96107      
    97108        else 
     
    99110                echo "Note that this is the EXPECTED result since the unit is negative" 
    100111                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]" 
    102113                echo "$NUNIT" >>units.passed      
    103                 passed=$((passed+1)) 
     114                passed=`expr $passed + 1` 
    104115 
    105116 
     
    109120 
    110121         
    111         echo -ne "\n" 
    112         echo -e "===============================================================================\n" 
     122        printf "\n" 
     123        printf "===============================================================================\n" 
    113124         
    114125done 
     
    117128 
    118129for RNUNIT in `cat ${RNUNITS}`; do 
    119         echo -e "-------------->      Working on unit -- $RNUNIT\n" 
     130        printf "-------------->      Working on unit -- $RNUNIT\n" 
    120131 
    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` 
    122133 
    123         if [ $? -eq 0 ] ; then 
     134        if test $? -eq 0 ; then 
    124135                echo $build_output 
    125136                echo "Compilation was SUCCESSFUL for the unit [${RNUNIT}]" 
    126137                echo "Now the unit [${RNUNIT}] will be run for ${NP} threads ..." 
    127138                echo "Note that this is a negative unit which MUST raise a RUNTIME ERROR" 
     139                #runtime settings for berkeley UPC  
    128140                RUN=`eval echo "upcrun -qn ${NP} ${RNUNIT}"` 
     141                #use the following runtime settings for gcc-upc 
     142                #RUN=`eval echo "./${UNIT}"` 
    129143                echo $RUN 
    130144                exe_output=`$RUN` 
    131                 if [ $? -eq 0 ] ; then 
    132                         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]" 
    133147                        echo "$UNIT" >>units.notpassed 
    134                         failed=$((failed+1)) 
     148                        failed=`expr $failed + 1` 
    135149                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]" 
    137151                        echo "$UNIT" >>units.passed 
    138                         passed=$((passed+1)) 
     152                        passed=`expr $passed + 1` 
    139153                fi 
    140154 
     
    144158                cat $RNUNIT.errout 
    145159                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` 
    148162        fi 
    149163 
    150164        `rm -f *.o ${RNUNIT} ${RNUNIT}.*out` 
    151165 
    152         echo -ne "\n" 
    153         echo -e "===============================================================================\n" 
     166        printf "\n" 
     167        printf "===============================================================================\n" 
    154168done 
    155169 
     
    157171# STATISTICAL OUTPUT 
    158172 
    159 echo -e "________________       GWU-HPCL UPC Compiler Testing Summary         ________________\n" 
     173printf "________________       GWU-HPCL UPC Compiler Testing Summary         ________________\n" 
    160174echo "SUCCESSFUL UNITS --> (units.passed)" 
    161 echo -ne "\033[34m\033[1m" 
    162 if [ -e units.passed ]; then 
     175printf "\033[34m\033[1m" 
     176if test -f units.passed ; then 
    163177        cat units.passed|sort|uniq 
    164178fi 
    165 echo -e "\033[0m" 
     179printf "\033[0m" 
    166180 
    167181echo "    FAILED UNITS --> (units.notpassed)" 
    168 echo -ne "\033[31m\033[1m" 
    169 if [ -e units.notpassed ]; then 
     182printf "\033[31m\033[1m" 
     183if test -f units.notpassed ; then 
    170184        cat units.notpassed|sort|uniq 
    171185fi 
    172 echo -e "\033[0m" 
     186printf "\033[0m" 
    173187 
    174 echo -e "\033[5m\033[1m\033[35m" 
     188printf "\033[5m\033[1m\033[35m" 
    175189echo "                 -->      Number of units PASSED : $passed" 
    176190echo "                 -->      Number of units FAILED : $failed" 
    177 total=$((passed+failed)) 
     191total=`expr $passed + $failed` 
    178192percentage=$(((passed*100) / total)) 
    179193 
    180 echo -e "              -->    $percentage % of the units have PASSED\n" 
    181 echo -ne "\033[0m" 
    182 echo -e "===========================     TEST END    ====================================\n" 
     194printf "               -->    $percentage % of the units have PASSED\n" 
     195printf "\033[0m" 
     196printf "===========================     TEST END    ====================================\n"