Changeset 5082
- Timestamp:
- 08/09/10 12:25:40 (15 years ago)
- Location:
- issm/trunk/scripts
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/scripts/dailyrun.sh
r5077 r5082 2 2 #This bash script calls the dailyrun.m matlab file to run our daily test decks. 3 3 #It then processes the results and sends an email to the Ice developpers. 4 5 #Hard coded options 6 NUMCPUS_RUN=7 7 NROPTIONS="" 4 8 5 9 #some functions … … 58 62 fi 59 63 #}}} 60 #Create dailylog directory and daily.log {{{1 61 #put installation elapsed time in daily.log 64 #create softlink to startup {{{1 65 cd $ISSM_DIR/test/NightlyRun/ 66 ln -s $ISSM_DIR/startup.m . 67 #}}} 68 #Create dailylog directory and info.log {{{1 69 #put installation elapsed time in info.log 62 70 INSTALL_TIME=$(timer) 63 71 ELAPSED_INSTALL=$(timer $START_TIME) 64 72 rm -rf $ISSM_DIR/dailylog 65 73 mkdir $ISSM_DIR/dailylog 66 cat << END > $ISSM_DIR/dailylog/ daily.log74 cat << END > $ISSM_DIR/dailylog/info.log 67 75 today: $(echo $TODAY) 68 76 user: $(echo $USER) … … 74 82 END 75 83 #}}} 84 #check NUMCPUS_RUN options {{{1 85 if [ "$NUMCPUS_RUN" = "" ] 86 then 87 echo "NUMCPUS_RUN option not found, defaulting to NUMCPUS_RUN = 1" 88 NUMCPUS_RUN=1 89 fi 90 #}}} 76 91 77 92 #Run tests 78 #Call run.sh script{{{1 79 cd $ISSM_DIR/scripts 80 ./run.sh 93 #Launch all tests on different cpus {{{1 94 for (( i=1;i<=$NUMCPUS_RUN;i++ )) 95 do 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 119 EOF 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 & 127 done 128 129 #wait until matlab closes 130 wait 81 131 #}}} 82 #Complete daily.log {{{1 132 #concatenate all reports {{{1 133 cd $ISSM_DIR/dailylog/ 134 mv matlab_log1.log matlab_log.log 135 for (( i=2;i<=$NUMCPUS_RUN;i++ )) 136 do 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 141 done 142 #}}} 143 #Complete info.log {{{1 83 144 ELAPSED_RUN=$(timer $INSTALL_TIME) 84 145 ELAPSED_TOTAL=$(timer $START_TIME) 85 cat << END >> $ISSM_DIR/dailylog/ daily.log146 cat << END >> $ISSM_DIR/dailylog/info.log 86 147 elapsed_run: $(echo $ELAPSED_RUN) 87 148 elapsed_total: $(echo $ELAPSED_TOTAL) … … 92 153 #Build html report {{{1 93 154 cd $ISSM_DIR/dailylog/ 94 sh ../ cron/report.sh155 sh ../scripts/report.sh 95 156 ln -s $ISSM_DIR/dailylog/report.html $INIT_PATH 96 echo "html report located in $ISSM_DIR/dailylog/report.html and $INIT_PATH "157 echo "html report located in $ISSM_DIR/dailylog/report.html and $INIT_PATH/report.html" 97 158 #}}}
Note:
See TracChangeset
for help on using the changeset viewer.