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

run.sh is now in nightly.sh

File:
1 edited

Legend:

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

    r5076 r5081  
    213213fi
    214214#}}}
     215#create softlink to startup {{{1
     216cd $ISSM_DIR/test/NightlyRun/
     217ln -s $ISSM_DIR/startup.m .
     218#}}}
    215219#Create nightlylog directory and nightly.log {{{1
    216220#put installation elapsed time in nightly.log
     
    229233END
    230234#}}}
     235#check NUMCPUS_RUN options {{{1
     236if [ "$NUMCPUS_RUN" = "" ]
     237then
     238        echo "NUMCPUS_RUN option not found, defaulting to NUMCPUS_RUN = 1"
     239        NUMCPUS_RUN=1
     240fi
     241#}}}
    231242
    232243#Run tests
    233 #Call run.sh script{{{1
    234 cd $ISSM_DIR/cron/
    235 ./run.sh $1
     244#Launch all tests on different cpus {{{1
     245for (( i=1;i<=$NUMCPUS_RUN;i++ ))
     246do
     247        #Launch matlab and the nightly run script
     248        cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
     249        warning off %necessary to avoid a nightly.log of several Go for parallel runs
     250        try,
     251        cd $ISSM_DIR/test/NightlyRun
     252        startup;
     253        $(if [ "$NROPTIONS" = ""  ]
     254        then
     255                echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
     256        else
     257                echo "runme($NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
     258        fi
     259        )
     260        catch me,
     261                %An error occured, get report and exit
     262                directory=strsplit(pwd,'/');
     263                message=getReport(me)
     264                fid=fopen([ISSM_DIR '/nightlylog/matlaberror.log'], 'at');
     265                fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
     266                fprintf(fid,'%s',message);
     267                fclose(fid);
     268        end
     269        exit
     270EOF
     271
     272        #Start run from nightlylog directory
     273        cd $ISSM_DIR/nightlylog/
     274
     275        #Start test
     276        MATLAB_VERSION="7.6" #7.2,7.4,7.6 and 7.8
     277        /usr/local/pkgs/matlab-$MATLAB_VERSION/bin/matlab  -nojvm -nosplash  -r matlab_run$i -logfile matlab_log$i.log &
     278done
     279
     280#wait until matlab closes
     281wait
     282#}}}
     283#concatenate all reports {{{1
     284mv matlab_log1.log  matlab_log.log
     285for (( i=2;i<=$NUMCPUS_RUN;i++ ))
     286do
     287        cat matlab_log.log matlab_log$i.log > matlab_log.log.bak
     288        mv matlab_log.log.bak matlab_log.log
     289        rm matlab_log$i.log
     290
     291done
    236292#}}}
    237293#Complete nightly.log {{{1
Note: See TracChangeset for help on using the changeset viewer.