Changeset 11552


Ignore:
Timestamp:
02/27/12 13:33:21 (13 years ago)
Author:
Eric.Larour
Message:

New nightly run script compatible with Windows

Location:
issm/trunk-jpl/cron
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/cron/nightlyrun.sh

    r11178 r11552  
    2929{
    3030        #return host name depending on the OS
    31         if [ "$1" = "wineric" ]
     31        if [ "$1" = "win7" ]
    3232        then
    33                 HOST_NAME=`hostname`;
     33                HOST_NAME=`hostname | sed 's/-//g'`;
    3434        else
    35                 HOST_NAME=`hostname -s`;
     35                HOST_NAME=`hostname -s | sed 's/-//g'`;
    3636        fi
    3737        echo $HOST_NAME;
    3838} #}}}
    39 
     39function pause() #{{{1
     40{
     41pid=`ps aux -W | grep $1 | awk '{printf("%s\n",$1);}'`
     42
     43while [ -n "$pid" ]
     44do
     45        pid=`ps aux -W | grep $1 | awk '{printf("%s\n",$1);}'`
     46done
     47}
     48#}}}
    4049#Get configuration
    4150#Source config file{{{1
     
    7483        #Erase previous code and Fetch the new one
    7584        rm -rf $ISSM_RELEASE
    76         svn checkout $REPOSITORY
     85        svn checkout "$REPOSITORY"
    7786
    7887elif [ "$ISSM_INSTALLATION" == "update" ]
     
    100109#create simpler  cluster.rc file, with only the cluster we are interested in.
    101110cd $ISSM_TIER/test/NightlyRun/
     111if [ "$MACHINE" = "win7" ]; then
     112cat << END > $HOST_NAME"_settings.m"
     113cluster.login='$USER';
     114cluster.codepath='`cygpath -m $ISSM_TIER/bin`';
     115cluster.executionpath='`cygpath -m $EXECUTION_PATH`';
     116END
     117else
    102118cat << END > $HOST_NAME"_settings.m"
    103119cluster.login='$USER';
     
    105121cluster.executionpath='$EXECUTION_PATH';
    106122END
     123fi
    107124#}}}
    108125#Source environment variables with new matlab path {{{1
     
    113130if [ "$ISSM_EXTERNALPACKAGES" == "install" ]
    114131then
     132       
    115133        cd $ISSM_TIER/externalpackages
    116         for ep in $EXTERNALPACKAGES
    117         do
    118                 cd $ep
    119                 case $ep in
    120                         "mpich2" )   ./install-1.0.2-linux64.sh ;;
    121                         "petsc" )    ./install-3.2-linux64.sh   ;;
    122                         "metis" )    ./install-4.0-linux64.sh ;;
    123                         "triangle" ) ./install-linux64.sh ;;
    124                         "dakota" )   ./install-linux64-astrid.sh ;;
    125                         *)           ./install.sh $NUMCPUS_INSTALL
    126                 esac
     134        #number of packages:
     135        numpackages=`echo $EXTERNALPACKAGES | wc -w`
     136
     137        for (( i=1; i<=$numpackages; i++ ))
     138        do
     139                package=`echo $EXTERNALPACKAGES | cut -d " " -f $i-$i`
     140                package_config=`echo $EXTERNALPACKAGES_CONFIGS | cut -d " " -f $i-$i`
     141                package_numcpus=`echo $EXTERNALPACKAGES_NUMCPUS | cut -d " " -f $i-$i`
     142
     143                cd $package
     144                $package_config $package_numcpus
    127145                cd ..
    128146        done
     147
    129148
    130149elif [ "$ISSM_EXTERNALPACKAGES" == "copy" ]
     
    158177        make distclean
    159178        ./scripts/automakererun.sh
    160         ./configs/config-linux64-astrid.sh
    161 
    162         #4: compile and install ISSM
    163         if [ "$MACHINE" = "wineric" ]
    164         then
    165                 cd $ISSM_TIER/src/c
    166                 ./intel-compile.sh
    167                 cd $ISSM_TIER/src/mex
    168                 make install
    169                 cd $ISSM_TIER
    170         else
    171                 make -j $NUMCPUS_INSTALL
    172                 make -j $NUMCPUS_INSTALL install
    173         fi
     179        source ./configs/$COMPILE_CONFIG_FILE
     180
     181        make -j $NUMCPUS_INSTALL
     182        make -j $NUMCPUS_INSTALL install
    174183
    175184elif [ "$ISSM_COMPILATION" == "no" ]
     
    185194#create softlink to startup {{{1
    186195cd $ISSM_TIER/test/NightlyRun/
    187 ln -s $ISSM_TIER/startup.m .
     196if [ "$MACHINE" = "win7" ]; then
     197        cp $ISSM_TIER/startup.m .
     198else
     199        ln -s $ISSM_TIER/startup.m .
     200fi
    188201#}}}
    189202#Create nightlylog directory and info.log {{{1
     
    212225
    213226#Run tests
     227#on Matlab and windows machines, we'll need a windows style path:  {{{
     228if [ "$MACHINE" = "win7" ]; then
     229        MATLAB_TIER=`cygpath -m $ISSM_TIER`
     230else
     231        MATLAB_TIER=$ISSM_TIER
     232fi
     233
     234#}}}
    214235#Launch all tests on different cpus {{{1
    215236for (( i=1;i<=$NUMCPUS_RUN;i++ ))
     
    219240        warning off %necessary to avoid a info.log of several Go for parallel runs
    220241        try,
    221         cd $ISSM_TIER/test/NightlyRun
     242        cd $MATLAB_TIER/test/NightlyRun
    222243        startup;
    223244        $(if [ "$NROPTIONS" = ""  ]
     
    225246                echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
    226247        else
     248                #echo "runme('id',[101 102]);"
    227249                echo "runme($NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
    228250        fi
     
    245267
    246268        #Start test
    247         MATLAB_VERSION="7.6" #7.2,7.4,7.6 and 7.8
    248         /usr/local/pkgs/matlab-$MATLAB_VERSION/bin/matlab  -nojvm -nosplash  -r matlab_run$i -logfile matlab_log$i.log &
     269        $MATLABBIN  -nojvm -nosplash  -r matlab_run$i -logfile matlab_log$i.log &
     270
    249271done
    250272
    251273#wait until matlab closes
    252 wait
     274if [ "$MACHINE" = "win7" ]; then
     275        pause MATLAB
     276else
     277        wait
     278fi
     279
    253280#}}}
    254281#concatenate all reports {{{1
     
    290317        for i in `echo $MAILINGLIST`; do
    291318
    292                 if [ "$MACHINE" = "wineric" ]
     319                if [ "$MACHINE" = "win7" ]
    293320                then
    294                         email -html -f "ISSM Nightly run $EMAIL_ADRESS" -s "Nightly runs of $ISSM_RELEASE , configuration: $MACHINE, host: $HOST_NAME, user: $USER. " $i < $ISSM_TIER/test/Verification/NightlyRun/report.html
     321                        echo $i
     322                        email -html -s "Nightly runs of $ISSM_RELEASE , configuration: $MACHINE, host: $HOST_NAME, user: $USER. " $i < $ISSM_TIER/nightlylog/report.html
    295323                else
    296324                        if [ "$MACHINE" = "astrid" ]
Note: See TracChangeset for help on using the changeset viewer.