Changeset 140

Show
Ignore:
Timestamp:
05/30/07 15:52:47
Author:
sbahra
Message:

Some portability fixes for Abdullah's scripts.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • guts.sh

    r136 r140  
    1010if [ $# -gt 3 -o $# -lt 2 ]; then 
    1111        echo "Usage: ./guts.sh [SUITE] [#of threads] [CLASS --> used only for running guts_npb]" 
    12         exit -
     12        exit
    1313fi 
    1414 
    1515# check the SUITE name and run the specific test bench accordingly 
    1616 
    17 if [ "$SUITE" == "IO" ] ; then 
     17if [ "$SUITE" = "IO" ] ; then 
    1818        #Run the UPC/IO test bench 
    1919        cd guts_io 
    2020        ./guts_io.sh $2 
    21 elif [ "$SUITE" == "MAIN" ]; then 
     21elif [ "$SUITE" = "MAIN" ]; then 
    2222         #Run the UPC Compiler Main test bench 
    2323        cd guts_main 
    2424        ./guts_main.sh $2 
    25 elif [ "$SUITE" == "COLLECTIVES" ]; then 
     25elif [ "$SUITE" = "COLLECTIVES" ]; then 
    2626         #Run the UPC/Collectives Main test bench 
    2727        cd guts_collectives 
    2828        ./guts_collectives.sh $2 
    29 elif [ "$SUITE" == "NPB" ]; then 
     29elif [ "$SUITE" = "NPB" ]; then 
    3030         #Run the UPC Compiler Stress test bench 
    3131        cd guts_npb 
     
    3434        echo "Usage: available SUITEs IO, MAIN, COLLECTIVES, NPB" 
    3535        echo "Usage: ./guts.sh [SUITE] [#of threads] [CLASS --> used only for running guts_npb]" 
    36         exit -
     36        exit
    3737fi 
  • guts_io/guts_io.sh

    r134 r140  
    1313 
    1414# Initial cleanup 
    15 if [ -e units.passed ]; then 
     15if test -f units.passed; then 
    1616        rm -f units.passed 
    1717fi 
    1818 
    19 if [ -e units.notpassed ]; then 
     19if test -f units.notpassed; then 
    2020        rm -f units.notpassed 
    2121fi 
    2222 
    23 echo -ne "\n\n" 
    24 echo -e "_______________      Script for compiling and running GUTS      _______________\n" 
     23printf "\n\n" 
     24printf "_______________      Script for compiling and running GUTS      _______________\n" 
    2525 
    2626umask 0002 
     
    2929UNITS_SHARED=units_shared 
    3030echo "Running the testing suite for ${NP} threads" 
    31 echo -ne "\n" 
     31printf "\n" 
    3232passed=0 
    3333failed=0 
     
    3737 
    3838for UNIT in `cat ${UNITS}`; do 
    39         echo -e "-------------->      Working on unit -- $UNIT\n" 
     39        printf "-------------->      Working on unit -- $UNIT\n" 
    4040         
    4141        BUILD=`upcio-config -build` 
    42         build_output=`$UPCC -D__restrict="" -I../include $BUILD $UNIT.upc -o $UNIT >>$UNIT.out 2>$UNIT.errout` 
    43  
    44         if [ $? -eq 0 ] ; then 
     42        build_output=`$UPCC -I../include $BUILD $UNIT.upc -o $UNIT >>$UNIT.out 2>$UNIT.errout` 
     43 
     44        if test $? -eq 0; then 
    4545                echo $build_output       
    4646                echo "Compilation was SUCCESSFUL for the unit [${UNIT}]" 
     
    4949                echo $RUN 
    5050                exe_output=`$RUN`  
    51                 if [ $? -eq 0 ] ; then 
    52                         echo -e "TEST \033[34m\033[1mPASSED\033[0m for the unit [$UNIT]" 
     51                if test $? -eq 0; then 
     52                        printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$UNIT]" 
    5353                        echo $exe_output 
    5454                        echo "$UNIT" >>units.passed 
    55                         passed=$((passed+1)) 
     55                        passed=`expr $passed + 1` 
    5656                else 
    57                         echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$UNIT]" 
     57                        printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$UNIT]" 
    5858                        echo $exe_output 
    5959                        echo "$UNIT" >>units.notpassed 
    60                         failed=$((failed+1)) 
     60                        failed=`expr $failed + 1` 
    6161                fi 
    6262                 
     
    6666                cat $UNIT.errout 
    6767                echo "$UNIT" >>units.notpassed 
    68                 failed=$((failed+1)) 
    69                 cmp_failed=$((cmp_failed+1)) 
     68                failed=`expr $failed + 1` 
     69                cmp_failed=`$cmp_failed + 1` 
    7070        fi       
    7171         
    7272        `rm -f *.o ${UNIT} ${UNIT}.*out` 
    7373         
    74         echo -ne "\n" 
    75         echo -e "===============================================================================\n" 
     74        printf "\n" 
     75        printf "===============================================================================\n" 
    7676done  
    7777 
     
    9090 
    9191for SUNIT in `cat ${UNITS_SHARED}`; do 
    92         echo -e "-------------->      Working on unit -- $SUNIT\n" 
     92        printf "-------------->      Working on unit -- $SUNIT\n" 
    9393 
    9494        SBUILD=`upcio-config -build` 
     
    102102        `$UPCC -D__restrict="" -DMEMVEC_SIZE=1 -DTYPE=char -DBLOCKSIZE=4 -I../include \ 
    103103                                $SBUILD $SUNIT.upc -o $SUNIT.char4 >>$SUNIT.char4.out 2>>$SUNIT.errout` 
    104         if (( $e_memvec == 0)); then 
     104        if test $e_memvec -eq 0; then 
    105105 
    106106                `$UPCC -D__restrict="" -DMEMVEC_SIZE=1 -DTYPE=int -DBLOCKSIZE=0 -I../include \ 
     
    114114        fi 
    115115 
    116         if [ $? -eq 0 ] ; then 
     116        if test $? -eq 0; then 
    117117                echo "Compilation was SUCCESSFUL for the unit [${SUNIT}]" 
    118118                 
     
    122122                exe_output=`${RUN_char0}` 
    123123                if [ $? -eq 0 ] ; then 
    124                         echo -e "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.char0]" 
     124                        printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.char0]" 
    125125                        echo $exe_output 
    126126                        echo "${SUNIT}.char0" >>units.passed 
    127127                        passed=$((passed+1)) 
    128128                else 
    129                         echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.char0]" 
     129                        printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.char0]" 
    130130                        echo $exe_output 
    131131                        echo "${SUNIT}.char0" >>units.notpassed 
     
    136136                echo ${RUN_char1} 
    137137                exe_output=`${RUN_char1}` 
    138                 if [ $? -eq 0 ] ; then 
    139                         echo -e "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.char1]" 
     138                if test $? -eq 0; then 
     139                        printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.char1]" 
    140140                        echo $exe_output 
    141141                        echo "${SUNIT}.char1" >>units.passed 
    142142                        passed=$((passed+1)) 
    143143                else 
    144                         echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.char1]" 
     144                        printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.char1]" 
    145145                        echo $exe_output 
    146146                        echo "${SUNIT}.char1" >>units.notpassed 
     
    151151                echo ${RUN_char4} 
    152152                exe_output=`${RUN_char4}` 
    153                 if [ $? -eq 0 ] ; then 
    154                         echo -e "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.char4]" 
     153                if test $? -eq 0; then 
     154                        printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.char4]" 
    155155                        echo $exe_output 
    156156                        echo "${SUNIT}.char4" >>units.passed 
    157157                        passed=$((passed+1)) 
    158158                else 
    159                         echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.char4]" 
     159                        printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.char4]" 
    160160                        echo $exe_output 
    161161                        echo "${SUNIT}.char4" >>units.notpassed 
     
    167167                        echo ${RUN_int0} 
    168168                        exe_output=`${RUN_int0}` 
    169                         if [ $? -eq 0 ] ; then 
    170                                 echo -e "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.int0]" 
     169                        if test $? -eq 0; then 
     170                                printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.int0]" 
    171171                                echo $exe_output 
    172172                                echo "${SUNIT}.int0" >>units.passed 
    173173                                passed=$((passed+1)) 
    174174                        else 
    175                                 echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.int0]" 
     175                                printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.int0]" 
    176176                                echo $exe_output 
    177177                                echo "${SUNIT}.int0" >>units.notpassed 
     
    182182                        echo ${RUN_int1} 
    183183                        exe_output=`${RUN_int1}` 
    184                         if [ $? -eq 0 ] ; then 
    185                                 echo -e "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.int1]" 
     184                        if test $? -eq 0; then 
     185                                printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.int1]" 
    186186                                echo $exe_output 
    187187                                echo "${SUNIT}.int1" >>units.passed 
    188188                                passed=$((passed+1)) 
    189189                        else 
    190                                 echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.int1]" 
     190                                printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.int1]" 
    191191                                echo $exe_output 
    192192                                echo "${SUNIT}.int1" >>units.notpassed 
     
    197197                        echo ${RUN_int4} 
    198198                        exe_output=`${RUN_int4}` 
    199                         if [ $? -eq 0 ] ; then 
    200                                 echo -e "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.int4]" 
     199                        if test $? -eq 0; then 
     200                                printf "TEST \033[34m\033[1mPASSED\033[0m for the unit [$SUNIT.int4]" 
    201201                                echo $exe_output 
    202202                                echo "${SUNIT}.int4" >>units.passed 
    203203                                passed=$((passed+1)) 
    204204                        else 
    205                                 echo -e "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.int4]" 
     205                                printf "TEST \033[31m\033[1mFAILED\033[0m for the unit [$SUNIT.int4]" 
    206206                                echo $exe_output 
    207207                                echo "${SUNIT}.int4" >>units.notpassed 
     
    221221        rm -f *.o ${SUNIT}.char[0,1,4] ${SUNIT}.int[0,1,4] ${SUNIT}.*out 
    222222         
    223         echo -ne "\n" 
    224         echo -e "===============================================================================\n" 
     223        printf "\n" 
     224        printf "===============================================================================\n" 
    225225         
    226226done 
     
    230230# STATISTICAL OUTPUT 
    231231 
    232 echo -e "________________       GWU-HPCL UPC/IO Testing Summary         ________________\n" 
     232printf "________________       GWU-HPCL UPC/IO Testing Summary         ________________\n" 
    233233echo "SUCCESSFUL UNITS --> (units.passed)" 
    234 echo -ne "\033[34m\033[1m" 
    235 if [ -e units.passed ]; then 
     234printf "\033[34m\033[1m" 
     235if test -f units.passed; then 
    236236        cat units.passed|sort|uniq 
    237237fi 
    238 echo -e "\033[0m" 
     238printf "\033[0m" 
    239239 
    240240echo "    FAILED UNITS --> (units.notpassed)" 
    241 echo -ne "\033[31m\033[1m" 
    242 if [ -e units.notpassed ]; then 
     241printf "\033[31m\033[1m" 
     242if test -f units.notpassed; then 
    243243        cat units.notpassed|sort|uniq 
    244244fi 
    245 echo -e "\033[0m" 
    246  
    247 echo -e "\033[5m\033[1m\033[35m" 
     245printf "\033[0m" 
     246 
     247printf "\033[5m\033[1m\033[35m" 
    248248echo "                 -->      Number of units PASSED : $passed" 
    249249echo "                 -->      Number of units FAILED : $failed" 
     
    251251percentage=$(((passed*100) / total)) 
    252252 
    253 echo -e "              -->    $percentage % of the units have PASSED\n" 
    254 echo -ne "\033[0m" 
    255 echo -e "===========================     TEST END    ====================================\n" 
     253printf "               -->    $percentage % of the units have PASSED\n" 
     254printf "\033[0m" 
     255printf "===========================     TEST END    ====================================\n"