Ignore:
Timestamp:
04/16/12 14:57:18 (13 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 11994M

Location:
issm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/cron

    • Property svn:ignore set to
      trunk-jpl
  • issm/trunk/cron/nightlyrun.sh

    r11237 r11995  
    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} #}}}
     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#}}}
    3949
    4050#Get configuration
     
    7484        #Erase previous code and Fetch the new one
    7585        rm -rf $ISSM_RELEASE
    76         svn checkout $REPOSITORY
     86        svn checkout "$REPOSITORY"
    7787
    7888elif [ "$ISSM_INSTALLATION" == "update" ]
     
    100110#create simpler  cluster.rc file, with only the cluster we are interested in.
    101111cd $ISSM_TIER/test/NightlyRun/
    102 cat << END > $HOST_NAME"_settings.m"
     112if [ "$MACHINE" = "win7" ]; then
     113        cat << END > $HOST_NAME"_settings.m"
     114cluster.login='$USER';
     115cluster.codepath='`cygpath -m $ISSM_TIER/bin`';
     116cluster.executionpath='`cygpath -m $EXECUTION_PATH`';
     117END
     118else
     119        cat << END > $HOST_NAME"_settings.m"
    103120cluster.login='$USER';
    104121cluster.codepath='$ISSM_TIER/bin';
    105122cluster.executionpath='$EXECUTION_PATH';
    106123END
     124   cat << END > $ISSM_TIER/externalpackages/matlab/install.sh
     125#!/bin/bash
     126rm -rf install
     127ln -s $MATLAB_PATH install
     128END
     129
     130fi
    107131#}}}
    108132#Source environment variables with new matlab path {{{1
     
    113137if [ "$ISSM_EXTERNALPACKAGES" == "install" ]
    114138then
     139       
    115140        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
     141        #number of packages:
     142        numpackages=`echo $EXTERNALPACKAGES | wc -w`
     143
     144        for (( i=1; i<=$numpackages; i++ ))
     145        do
     146                package=`echo $EXTERNALPACKAGES | cut -d " " -f $i-$i`
     147                package_config=`echo $EXTERNALPACKAGES_CONFIGS | cut -d " " -f $i-$i`
     148
     149                cd $package
     150                $package_config
    127151                cd ..
    128152        done
     
    136160        cp -Rf $EXTERNALPACKAGESDIR ./
    137161
     162elif [ "$ISSM_EXTERNALPACKAGES" == "link" ]
     163then
     164
     165        #erase externapackages, and link with externalpackages_dir
     166        cd $ISSM_TIER
     167        rm -rf externalpackages
     168        ln -s  $EXTERNALPACKAGESDIR  .
     169
    138170elif [ "$ISSM_EXTERNALPACKAGES" == "none" ]
    139171then
     
    158190        make distclean
    159191        ./scripts/automakererun.sh
    160         ./configs/config-linux64-astrid.sh
     192        source ./configs/$COMPILE_CONFIG_FILE
    161193
    162194        #4: compile and install ISSM
    163         if [ "$MACHINE" = "wineric" ]
     195        if [ $NUMCPUS_INSTALL -gt 1 ]
    164196        then
    165                 cd $ISSM_TIER/src/c
    166                 ./intel-compile.sh
    167                 cd $ISSM_TIER/src/mex
     197                echo "Making with " $NUMCPUS_INSTALL "cpus"
     198                make -j $NUMCPUS_INSTALL install
     199        else
    168200                make install
    169                 cd $ISSM_TIER
    170         else
    171                 make -j $NUMCPUS_INSTALL
    172                 make -j $NUMCPUS_INSTALL install
    173201        fi
     202
     203        make install
    174204
    175205elif [ "$ISSM_COMPILATION" == "no" ]
     
    185215#create softlink to startup {{{1
    186216cd $ISSM_TIER/test/NightlyRun/
    187 ln -s $ISSM_TIER/startup.m .
     217rm startup.m #in case it alreade exists
     218cp $ISSM_TIER/startup.m .
    188219#}}}
    189220#Create nightlylog directory and info.log {{{1
     
    212243
    213244#Run tests
     245#on Matlab and windows machines, we'll need a windows style path:  {{{
     246if [ "$MACHINE" = "win7" ]; then
     247        MATLAB_TIER=`cygpath -m $ISSM_TIER`
     248else
     249        MATLAB_TIER=$ISSM_TIER
     250fi
     251#}}}
    214252#Launch all tests on different cpus {{{1
    215253for (( i=1;i<=$NUMCPUS_RUN;i++ ))
     
    219257        warning off %necessary to avoid a info.log of several Go for parallel runs
    220258        try,
    221         cd $ISSM_TIER/test/NightlyRun
     259        cd $MATLAB_TIER/test/NightlyRun
    222260        startup;
    223261        $(if [ "$NROPTIONS" = ""  ]
     
    225263                echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
    226264        else
     265                #echo "runme('id',[101 102]);"
    227266                echo "runme($NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
    228267        fi
     
    244283        cd $ISSM_TIER/nightlylog/
    245284
     285        MATLABBIN=$MATLAB_PATH/bin/matlab
    246286        #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 &
     287        $MATLABBIN  -nojvm -nosplash  -r matlab_run$i -logfile matlab_log$i.log &
     288
    249289done
    250290
    251291#wait until matlab closes
    252 wait
     292if [ "$MACHINE" = "win7" ]; then
     293        pause MATLAB
     294else
     295        wait
     296fi
     297
    253298#}}}
    254299#concatenate all reports {{{1
    255300cd $ISSM_TIER/nightlylog/
    256 mv matlab_log1.log  matlab_log.log
     301cp matlab_log1.log  matlab_log.log
    257302for (( i=2;i<=$NUMCPUS_RUN;i++ ))
    258303do
     
    290335        for i in `echo $MAILINGLIST`; do
    291336
    292                 if [ "$MACHINE" = "wineric" ]
     337                if [ "$MACHINE" = "win7" ]
    293338                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
     339                        email -html -s "Nightly runs on $HOST_NAME (version: $ISSM_RELEASE)" -n "ISSM Nightly run" -f echo $EMAIL_ADRESS $i < $ISSM_TIER/nightlylog/report.html
    295340                else
    296341                        if [ "$MACHINE" = "astrid" ]
     
    299344From: "ISSM Nightly run" <$EMAIL_ADRESS>
    300345To: $i
    301 Subject: Nightly runs of $ISSM_RELEASE, configuration: $MACHINE, host: $HOST_NAME, user: $USER.
     346Subject: Nightly runs on $HOST_NAME (version: $ISSM_RELEASE)
    302347Mime-Version: 1.0
    303348Content-Type: text/html
     
    307352From: "ISSM Nightly run" <$EMAIL_ADRESS>
    308353To: $i
    309 Subject: Nightly runs of $ISSM_RELEASE, configuration: $MACHINE, host: $HOST_NAME, user: $USER.
     354Subject: Nightly runs on $HOST_NAME (version: $ISSM_RELEASE)
    310355Mime-Version: 1.0
    311356Content-Type: text/html
Note: See TracChangeset for help on using the changeset viewer.