Changeset 5082


Ignore:
Timestamp:
08/09/10 12:25:40 (15 years ago)
Author:
Mathieu Morlighem
Message:

better dailyrun

Location:
issm/trunk/scripts
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/scripts/dailyrun.sh

    r5077 r5082  
    22#This bash script calls the dailyrun.m matlab file to run our daily test decks.
    33#It then processes the results and sends an email to the Ice developpers.
     4
     5#Hard coded options
     6NUMCPUS_RUN=7
     7NROPTIONS=""
    48
    59#some functions
     
    5862fi
    5963#}}}
    60 #Create dailylog directory and daily.log {{{1
    61 #put installation elapsed time in daily.log
     64#create softlink to startup {{{1
     65cd $ISSM_DIR/test/NightlyRun/
     66ln -s $ISSM_DIR/startup.m .
     67#}}}
     68#Create dailylog directory and info.log {{{1
     69#put installation elapsed time in info.log
    6270INSTALL_TIME=$(timer)
    6371ELAPSED_INSTALL=$(timer $START_TIME)
    6472rm -rf $ISSM_DIR/dailylog
    6573mkdir  $ISSM_DIR/dailylog
    66 cat << END > $ISSM_DIR/dailylog/daily.log
     74cat << END > $ISSM_DIR/dailylog/info.log
    6775today:     $(echo $TODAY)
    6876user:      $(echo $USER)
     
    7482END
    7583#}}}
     84#check NUMCPUS_RUN options {{{1
     85if [ "$NUMCPUS_RUN" = "" ]
     86then
     87        echo "NUMCPUS_RUN option not found, defaulting to NUMCPUS_RUN = 1"
     88        NUMCPUS_RUN=1
     89fi
     90#}}}
    7691
    7792#Run tests
    78 #Call run.sh script{{{1
    79 cd $ISSM_DIR/scripts
    80 ./run.sh
     93#Launch all tests on different cpus {{{1
     94for (( i=1;i<=$NUMCPUS_RUN;i++ ))
     95do
     96        #Launch matlab and the daily run script
     97        cat > $ISSM_DIR/dailylog/matlab_run$i.m << EOF
     98        warning off %necessary to avoid a info.log of several Go for parallel runs
     99        try,
     100        cd $ISSM_DIR/test/NightlyRun
     101        startup;
     102        $(if [ "$NROPTIONS" = ""  ]
     103        then
     104                echo "runme('output','daily','rank',$i,'numprocs',$NUMCPUS_RUN);"
     105        else
     106                echo "runme($NROPTIONS,'output','daily','rank',$i,'numprocs',$NUMCPUS_RUN);"
     107        fi
     108        )
     109        catch me,
     110                %An error occured, get report and exit
     111                directory=strsplit(pwd,'/');
     112                message=getReport(me)
     113                fid=fopen([ISSM_DIR '/dailylog/matlaberror.log'], 'at');
     114                fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
     115                fprintf(fid,'%s',message);
     116                fclose(fid);
     117        end
     118        exit
     119EOF
     120
     121        #Start run from dailylog directory
     122        cd $ISSM_DIR/dailylog/
     123
     124        #Start test
     125        MATLAB_VERSION="7.6" #7.2,7.4,7.6 and 7.8
     126        /usr/local/pkgs/matlab-$MATLAB_VERSION/bin/matlab  -nojvm -nosplash  -r matlab_run$i -logfile matlab_log$i.log &
     127done
     128
     129#wait until matlab closes
     130wait
    81131#}}}
    82 #Complete daily.log {{{1
     132#concatenate all reports {{{1
     133cd $ISSM_DIR/dailylog/
     134mv matlab_log1.log  matlab_log.log
     135for (( i=2;i<=$NUMCPUS_RUN;i++ ))
     136do
     137        cat matlab_log.log matlab_log$i.log > matlab_log.log.bak
     138        mv matlab_log.log.bak matlab_log.log
     139        rm matlab_log$i.log
     140
     141done
     142#}}}
     143#Complete info.log {{{1
    83144ELAPSED_RUN=$(timer $INSTALL_TIME)
    84145ELAPSED_TOTAL=$(timer $START_TIME)
    85 cat << END >>  $ISSM_DIR/dailylog/daily.log
     146cat << END >>  $ISSM_DIR/dailylog/info.log
    86147elapsed_run:   $(echo $ELAPSED_RUN)
    87148elapsed_total: $(echo $ELAPSED_TOTAL)
     
    92153#Build html report {{{1
    93154cd $ISSM_DIR/dailylog/
    94 sh ../cron/report.sh
     155sh ../scripts/report.sh
    95156ln -s $ISSM_DIR/dailylog/report.html $INIT_PATH
    96 echo "html report located in $ISSM_DIR/dailylog/report.html and $INIT_PATH"
     157echo "html report located in $ISSM_DIR/dailylog/report.html and $INIT_PATH/report.html"
    97158#}}}
Note: See TracChangeset for help on using the changeset viewer.