Changeset 2185
- Timestamp:
- 09/10/09 12:40:15 (16 years ago)
- Location:
- issm/trunk/cron
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/cron/nightlyrun.sh
r2182 r2185 23 23 function todaydate() 24 24 { 25 export today=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`; 26 suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'` 25 suffix=`date | awk '{printf("%s-%s-%s %s",$2,$3,$6,$4);}'` 27 26 echo $suffix; 28 27 } … … 30 29 { 31 30 #return host name depending on the OS 32 if [ [ "$1" == "winxp32" ]]31 if [ "$1" = "winxp32" ] 33 32 then 34 33 HOST_NAME=`hostname`; … … 45 44 echo "no config file specified. Exiting..." 46 45 exit 1 47 else 48 #launch nightly run (get start time) 49 source $1; 50 START_TIME=$(timer) 51 fi 52 53 #create nightly run variables 54 export TODAY=$(todaydate); 55 export HOST_NAME=$(host_name $OS); 56 export ISSM_RELEASE="issm" 57 export OS 46 fi 47 48 #launch nightly run (get start time) 49 source $1; 50 TODAY=$(todaydate); 51 HOST_NAME=$(host_name $OS); 52 START_TIME=$(timer) 53 54 #Initialize nightly run output 55 rm -rf $ISSM_DIR/test/Verification/NightlyRun 56 mkdir $ISSM_DIR/test/Verification/NightlyRun 57 cat << END > $ISSM_DIR/test/Verification/NightlyRun/nightly.log 58 today: $(echo $TODAY) 59 user: $(whoami) 60 host: $(echo $HOST_NAME) 61 OS: $(echo $OS) 62 release: $(echo "issm") 63 END 58 64 59 65 #create ISSM variables … … 61 67 export ISSM_ARCH 62 68 63 # Erase previous code and Fetch the new one64 rm -rf trunk 65 svn checkout $REPOSITORY 66 67 #install ISSM 68 69 #1: modify some variables 70 cd $ISSM_DIR/etc 71 72 #source environment variables with new matlab path 73 source environment.sh MATLAB_DIR=$MATLAB_PATH74 75 #create simpler cluster.rc file, with only the cluster we are interested in.76 cat << END > cluster.rc69 #Checkout and install ISSM if required 70 if [ "$SKIPINSTALLATION" != "yes" ] 71 then 72 73 #Erase previous code and Fetch the new one 74 rm -rf trunk 75 svn checkout $REPOSITORY 76 77 #source environment variables with new matlab path 78 cd $ISSM_DIR/etc 79 source environment.sh MATLAB_DIR=$MATLAB_PATH 80 81 #create simpler cluster.rc file, with only the cluster we are interested in. 82 cat << END > cluster.rc 77 83 begin 78 84 cluster_name=$HOST_NAME … … 83 89 END 84 90 85 if [[ $SKIPPACKAGESCOMPILATION == "yes" ]] 86 then 87 #erase externapackages, and link with externalpackages_dir 91 #Install external packages 92 if [ "$SKIPPACKAGESCOMPILATION" = "yes" ] 93 then 94 95 #erase externapackages, and link with externalpackages_dir 96 cd $ISSM_DIR 97 rm -rf externalpackages 98 cp -Rf $EXTERNALPACKAGESDIR ./ 99 100 rm -rf devpackages 101 cp -Rf $DEVPACKAGESDIR ./ 102 else 103 104 cd $ISSM_DIR/externalpackages 105 for ep in $EXTERNALPACKAGES 106 do 107 cd $ep 108 cp configs/$OS/* . 109 ./install.sh $NUMCPUS 110 cd .. 111 done 112 113 #3: install automake and autoconf 114 cd $ISSM_DIR/devpackages 115 make 116 cd .. 117 fi 118 else 119 120 #source environment variables with new matlab path 121 cd $ISSM_DIR/etc 122 source environment.sh MATLAB_DIR=$MATLAB_PATH 123 124 fi 125 126 #Generate Makefiles and compile ISSM if requested 127 if [ "$SKIPCOMPILATION" != "yes" ] 128 then 88 129 cd $ISSM_DIR 89 rm -rf externalpackages 90 cp -Rf $EXTERNALPACKAGESDIR ./ 91 92 rm -rf devpackages 93 cp -Rf $DEVPACKAGESDIR ./ 94 else 95 #2: install some required external packages 96 cd $ISSM_DIR/externalpackages 97 for ep in $EXTERNALPACKAGES 98 do 99 cd $ep 100 cp configs/$OS/* . 101 ./install.sh $NUMCPUS 102 cd .. 103 done 104 105 #3: install automake and autoconf 106 cd $ISSM_DIR/devpackages 107 make 108 cd .. 109 fi 110 111 #3: generate MakeFiles 112 cd $ISSM_DIR 113 sh scripts/automakererun.sh 114 sh configs/$OS/$OS.sh 115 116 #4: compile and install ISSM 117 if [[ "$OS" == "winxp32" ]] 118 then 119 cd $ISSM_DIR/src/c 120 ./intel-compile.sh >> ../../c-compilation.log 2>&1 121 cd $ISSM_DIR/src/mex 122 make install >> ../../mex-compilation.log 2>&1 123 cd $ISSM_DIR 124 else 125 make -j $NUMCPUS >> ../../cmex-compilation.log 2>&1 126 make -j $NUMCPUS install >> ../../cmex-compilation.log 2>&1 127 fi 128 129 INSTAL_TIME=$(timer) 130 export ELAPSED_INSTAL=$(timer $START_TIME) 130 sh scripts/automakererun.sh 131 sh configs/$OS/$OS.sh 132 133 #4: compile and install ISSM 134 if [ "$OS" = "winxp32" ] 135 then 136 cd $ISSM_DIR/src/c 137 ./intel-compile.sh >> ../../c-compilation.log 2>&1 138 cd $ISSM_DIR/src/mex 139 make install >> ../../mex-compilation.log 2>&1 140 cd $ISSM_DIR 141 else 142 make -j $NUMCPUS >> ../../cmex-compilation.log 2>&1 143 make -j $NUMCPUS install >> ../../cmex-compilation.log 2>&1 144 fi 145 fi 131 146 132 147 #windows environments: ISSM_DIR_WIN variable not correctly picked up when using 133 148 #the cron job. just get startup to take the ISSM_DIR variable as the pwd: 134 if [ [ "$OS" == "winxp32" ]]149 if [ "$OS" = "winxp32" ] 135 150 then 136 151 cat startup.m | sed 's/clear status/clear status; ISSM_DIR=pwd;/g' > startup.m.bak … … 138 153 fi 139 154 155 #put installation elapsed time in nightly.log 156 INSTALL_TIME=$(timer) 157 ELAPSED_INSTALL=$(timer $START_TIME) 158 cat << END >> $ISSM_DIR/test/Verification/NightlyRun/nightly.log 159 elapsed_install: $(echo $ELAPSED_INSTALL) 160 END 161 140 162 #Launch matlab and the nightly run script 141 mktemp matlaberror.log 142 cat > matlab_run.m << EOF 143 startup 144 warning off %necessary to avoid a nightly.log of several Go for cielo_parallel 145 try, 146 nightlyrun; 147 catch me, 148 %An error occured, get report and exit 149 directory=strsplit(pwd,'/'); 150 message=getReport(me) 151 fid=fopen([ISSM_DIR '/matlaberror.log'], 'wt'); 152 fprintf(fid,'Matlab error occured in: %s\n',directory{end}); 153 fprintf(fid,'%s',message); 154 fclose(fid); 155 end 163 cd $ISSM_DIR/cron/ 164 ./run.sh $NROPTIONS 165 ELAPSED_RUN=$(timer $INSTALL_TIME) 166 ELAPSED_TOTAL=$(timer $START_TIME) 167 cat << END >> $ISSM_DIR/test/Verification/NightlyRun/nightly.log 168 elapsed_run: $(echo $ELAPSED_RUN) 169 elapsed_total: $(echo $ELAPSED_TOTAL) 170 END 171 172 #Build html report 173 cd $ISSM_DIR/cron/ 174 ./report.sh 175 echo "html report located in $ISSM_DIR/test/Verification/NightlyRun/report.html" 156 176 exit 157 EOF158 159 matlab -nojvm -nosplash -r matlab_run -logfile nightlylong.log160 161 #removed unused lines to deal with a smaller file162 cat nightlylong.log | egrep 'ERROR|SUCCESS|FAILURE' > nightly.log163 #rm nightlylong.log164 165 #Build html report166 export ELAPSED_RUN=$(timer $INSTAL_TIME)167 export ELAPSED_TOTAL=$(timer $START_TIME)168 ./cron/report.sh169 177 170 178 #send mail … … 172 180 for i in `echo $MAILINGLIST`; do 173 181 174 if [ [ "$OS" == "winxp32" ]]182 if [ "$OS" = "winxp32" ] 175 183 then 176 184 email -html -f "ISSM Nightly run $EMAIL_ADRESS" -s "Nightly runs of $ISSM_RELEASE , operating system: $OS. " $i < report.html 177 185 else 178 if [ [ "$OS" == "linux64" ]]186 if [ "$OS" = "linux64" ] 179 187 then 180 188 cat - report.html <<HERE | /usr/lib/sendmail -oi -t … … 197 205 198 206 done 199 200 #Erase log and error logs201 #rm -rf nightly.log report.html202 203 #Erase ice code204 #cd ..205 #rm -rf trunk/ -
issm/trunk/cron/report.sh
r2182 r2185 2 2 #generate html report from nightly.log output file 3 3 4 #Process log 5 cat nightly.log | grep 'ERROR' | grep -v "PETSC ERROR" > errors.log 6 cat nightly.log | grep 'SUCCESS' > success.log 7 cat nightly.log | grep 'FAILURE' > failures.log 4 cd $ISSM_DIR/test/Verification/NightlyRun/ 5 6 #process nightly.log 7 TODAY=` cat nightly.log | grep "today" | awk '{printf("%s %s",$2,$3);}'` 8 USER=` cat nightly.log | grep "user" | awk '{print $2}'` 9 HOST_NAME=` cat nightly.log | grep "host" | awk '{print $2}'` 10 OS=` cat nightly.log | grep "OS" | awk '{print $2}'` 11 RELEASE=` cat nightly.log | grep "release" | awk '{print $2}'` 12 EL_INSTALL=`cat nightly.log | grep "elapsed_install" | awk '{print $2}'` 13 EL_RUN=` cat nightly.log | grep "elapsed_run" | awk '{print $2}'` 14 EL_TOTAL=` cat nightly.log | grep "elapsed_total" | awk '{print $2}'` 15 16 #Process matlab_log.log 17 cat matlab_log.log | egrep 'ERROR|SUCCESS|FAILURE' > matlab.log 18 NUM_TOT=`wc -l matlab.log | awk '{print $1}'` 19 NUM_ERR=`cat matlab.log | grep 'ERROR' | grep -v "PETSC ERROR" | wc -l` 20 NUM_SUC=`cat matlab.log | grep 'SUCCESS' | wc -l` 21 NUM_FAI=`cat matlab.log | grep 'FAILURE' | wc -l` 22 23 #style 24 H1_STYLE='width="1000px" cellpadding="20"' 25 H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:35px;" align="center"' 26 27 H2_STYLE='width="900px" cellpadding="20"' 28 H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:28px; font-weight: bold;" align="left"' 29 30 TABLE_STYLE='width="800px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"' 31 TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14; font-weight: normal;" align="left"' 32 33 MATLAB_STYLE='width="1000px" rules=none' 34 MATLAB_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px; font-weight: normal;" align="left"' 35 36 BODY_STYLE='width="1000px"' 37 BODY_FONT="style=\"color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;\"" 38 39 FOOTER_STYLE='width="800px" cellpadding="10"' 40 FOOTER_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="center"' 41 42 #style 2 43 BODY_FONTC=`echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:center; /g"` 44 BODY_FONTL=`echo $BODY_FONT | sed -e "s/style=\"/style=\"text-align:left; /g"` 8 45 9 46 #create some variables … … 14 51 IS_INSTALL=1 15 52 fi 16 if [ $(wc -l nightly.log | awk '{printf("%s",$1);}') -eq 0 ]53 if [ $(wc -l matlab.log | awk '{printf("%s",$1);}') -eq 0 ] 17 54 then 18 55 IS_RUN=0 … … 20 57 IS_RUN=1 21 58 fi 22 23 #style24 H1_STYLE='width="800px" cellpadding="20"'25 H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:35px;" align="center"'26 27 H2_STYLE='width="840px" cellpadding="20"'28 H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:28px; font-weight: bold;" align="left"'29 30 TABLE_STYLE='width="820px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'31 TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14; font-weight: normal;" align="left"'32 33 MATLAB_STYLE='width="820px" rules=none'34 MATLAB_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px; font-weight: normal;" align="left"'35 36 BODY_STYLE='width="820px"'37 BODY_FONT="style=\"color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;\""38 39 NOTEST_STYLE='width="650px"'40 NOTEST_FONT='style="color:#FF0000; font-family:Arial, Verdana, Tahoma; font-size:14px;" align="left"'41 42 FOOTER_STYLE='width="800px" cellpadding="10"'43 FOOTER_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="center"'44 59 45 60 #build report.html … … 56 71 </tr> 57 72 <tr> 58 <td $TABLE_FONT>user: $(whoami)</td>59 <td $TABLE_FONT>total elapsed time: $ELAPSED_TOTAL</td>60 </tr>61 <tr>62 73 <td $TABLE_FONT>OS: $OS</td> 63 <td $TABLE_FONT>installation elapsed time: $ELAPSED_INSTAL</td> 64 </tr> 65 <tr> 66 $(#print status 67 if [ $(echo $IS_INSTALL) -eq 0 ]; 68 then 69 #installation failed, end of report 70 echo "<td $TABLE_FONT>status: <span style=\"color:#FF0000\">installation failed</span></td>" 71 echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>" 72 echo "</tr>" 73 echo "</table>" 74 rm errors.log success.log 75 else 76 #installation successful. Did we go to the end? 77 78 if [ $(echo $IS_RUN) -eq 0 ]; 74 <td $TABLE_FONT>user: $USER</td> 75 </tr> 76 <tr> 77 <td $TABLE_FONT>status: STATUS</td> 78 <td $TABLE_FONT>release: $RELEASE</td> 79 </tr> 80 <tr> 81 <td $TABLE_FONT>number of success: $NUM_SUC/$NUM_TOT 82 <td $TABLE_FONT>total elapsed time: $EL_TOTAL</td> 83 </tr> 84 <tr> 85 <td $TABLE_FONT>number of errors: $NUM_ERR/$NUM_TOT 86 87 <td $TABLE_FONT>installation elapsed time: $EL_INSTALL</td> 88 </tr> 89 <tr> 90 <td $TABLE_FONT>number of failures: $NUM_FAI/$NUM_TOT 91 <td $TABLE_FONT>installation elapsed time: $EL_INSTALL</td> 92 </tr> 93 </table> 94 <br><hr width="1000px"> 95 END 96 97 #update status 98 if [ $IS_RUN -eq 1 ] 99 then 100 cat summary.html | sed -e "s/STATUS/<span style=\"color:#008000\">all test desks have been run<\/span>/g" > summary2.html 101 mv summary2.html summary.html 102 else 103 if [ $IS_INSTALL -eq 1 ] 79 104 then 80 #run failed, end of report 81 echo "<td $TABLE_FONT>status: <span style=\"color:#FF0000\">installation successful but tests runs failed</span></td>" 82 echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>" 83 echo "</tr>" 84 echo "</table>" 85 rm errors.log success.log failures.log 86 105 cat summary.html | sed -e "s/STATUS/<span style=\"color:#ff0000\">installation successful but tests runs failed<\/span>/g" > summary2.html 106 mv summary2.html summary.html 87 107 else 88 89 echo "<td $TABLE_FONT>status: <span style=\"color:#008000\">all test desks have been run</span></td>" 90 echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>" 91 echo "</tr>" 92 echo "<tr>" 93 echo "<td $TABLE_FONT>number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l nightly.log | awk '{printf("%s",$1);}'; rm errors.log)</td>" 94 echo "<td $TABLE_FONT> </td>" 95 echo "</tr>" 96 echo "<tr>" 97 echo "<td $TABLE_FONT>number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l nightly.log | awk '{printf("%s",$1);}'; rm success.log)</td>" 98 echo "<td $TABLE_FONT> </td>" 99 echo "</tr>" 100 echo "</table>" 101 102 #draw a line and clean up 103 echo "<br><hr width=\"900px\">" 108 cat summary.html | sed -e "s/STATUS/<span style=\"color:#ff0000\">installation failed<\/span>/g" > summary2.html 109 mv summary2.html summary.html 104 110 fi 105 fi) 106 END 111 fi 107 112 108 113 #Matlab error report 114 if [ -e matlaberror.log ] 115 then 109 116 cat << END > matlaberror.html 110 117 <table $H2_STYLE><tr><td $H2_FONT>Matlab error</td></tr></table> … … 113 120 </td></tr></table> 114 121 END 122 else 123 mktemp matlaberror.html 124 fi 115 125 116 126 #report content 117 if [ $ (echo $IS_INSTALL) =1 ];127 if [ $IS_INSTALL -eq 1 ]; 118 128 then 119 129 cat << END > content.html … … 130 140 <th $(echo $BODY_FONT)>Control fit</th> 131 141 <th $(echo $BODY_FONT)>Parallel</th> 132 </tr> 133 $( COUNTER=0 134 MAX=`wc -l nightly.log | awk '{printf("%s",$1);}'` 135 while [ $COUNTER -lt $MAX ]; do 136 let COUNTER=COUNTER+1 137 138 echo "<tr>" 139 140 #see wether it is success or error (get color: red or green) 141 RESULT="$(cat nightly.log | awk '{ printf "line%so %s\n", NR, $0 }' | awk '/line'$COUNTER'o/ {printf("%s\n",$2);}';)" 142 if [ "$RESULT" = "SUCCESS" ]; 143 then 144 color="bgcolor=#ddffdd"; 145 else 146 if [ "$RESULT" = "ERROR" ]; 147 then 148 color="bgcolor=#ffdddd"; 149 else 150 color="bgcolor=#ddddff"; 151 fi 152 fi 153 FONT=$(echo "$BODY_FONT $color") 154 155 #build html corresponding line 156 cat nightly.log | awk '{ printf "line%so %s\n", NR, $0 }' | awk -v FONT="$FONT" ' 157 /line'$COUNTER'o/ { printf("<td %s>%s</td><td %s>%s%s%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td>",FONT,$2,FONT,$4,$5,$6,FONT,$8,FONT,$10,FONT,$12,FONT,$14,FONT,$16,FONT,$18,FONT,$20);} 158 '; 159 160 echo "</tr>" 161 162 done) 142 <th $(echo $BODY_FONT)>Field checked</th> 143 </tr> 144 $(cat matlab.log | while read line 145 do 146 echo "<tr>" 147 148 #get status 149 STATUS=`echo $line | awk '{print $1}'` 150 151 #FAILURE 152 if [ "$STATUS" = "FAILURE" ] 153 then 154 155 FONTC=$(echo "$BODY_FONTC bgcolor=#ffff00"); 156 FONTL=$(echo "$BODY_FONTL bgcolor=#ffff00"); 157 echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" ' 158 { printf("<td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td>",FONTL,$1,FONTC,"N/A",FONTL,$3,FONTL,$5,FONTL,$7,FONTC,$9,FONTC,$11,FONTC,$13,FONTC,$15,FONTC,"N/A");} 159 '; 160 161 else 162 163 #SUCCESS 164 if [ "$STATUS" = "SUCCESS" ] 165 then 166 color="bgcolor=#ddffdd"; 167 168 #ERROR 169 else 170 color="bgcolor=#ffdddd"; 171 fi 172 173 FONTC=$(echo "$BODY_FONTC $color") 174 FONTL=$(echo "$BODY_FONTL $color") 175 echo $line | awk -v FONTC="$FONTC" -v FONTL="$FONTL" ' 176 { printf("<td %s>%s</td><td %s>%s%s%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td>",FONTL,$1,FONTL,$3,$4,$5,FONTL,$7,FONTL,$9,FONTL,$11,FONTC,$13,FONTC,$15,FONTC,$17,FONTC,$19,FONTL,$21);} 177 '; 178 fi 179 180 echo "</tr>" 181 182 done 183 ) 163 184 </table> 164 185 <br> … … 176 197 177 198 #concatenate files 178 if [ $IS_RUN -eq 0 ]; 179 then 180 cat summary.html matlaberror.html content.html footer.html > report.html 181 else 182 cat summary.html content.html footer.html > report.html 183 fi 184 rm summary.html content.html footer.html matlaberror.html 199 cat summary.html matlaberror.html content.html footer.html > report.html 200 rm summary.html content.html footer.html matlaberror.html matlab.log -
issm/trunk/cron/run.sh
r2180 r2185 3 3 numprocs=8; 4 4 5 #figure out if startup.m is here, otherwise, symlink it. 6 if [ -e startup.m ] 7 then 8 echo "" 9 #startup.m exists, do nothing 10 else 11 echo "creating startup.m symlink file" 12 ln -s $ISSM_DIR/startup.m 13 fi 5 #create softlink to startup 6 rm startup.m 7 cd $ISSM_DIR/test/Verification/NightlyRun/ 8 ln -s $ISSM_DIR/startup.m . 14 9 15 10 #Launch all tests on different cpus 16 11 for (( i=1;i<=$numprocs;i++ )) 17 12 do 18 13 #Launch matlab and the nightly run script 19 cat > matlab_run$i.m << EOF 20 startup 14 cat > $ISSM_DIR/test/Verification/NightlyRun/matlab_run$i.m << EOF 21 15 warning off %necessary to avoid a nightly.log of several Go for cielo_parallel 22 16 try, 23 nightlyrun($i,$numprocs); 17 $(if [ "$1" = "" ] 18 then 19 echo "nightlyrun('rank',$i,'numprocs',$numprocs);" 20 else 21 echo "nightlyrun($1,'rank',$i,'numprocs',$numprocs);" 22 fi 23 ) 24 24 catch me, 25 25 %An error occured, get report and exit 26 26 directory=strsplit(pwd,'/'); 27 27 message=getReport(me) 28 fid=fopen([ISSM_DIR '/ matlaberror.log'], 'wt');29 fprintf(fid,' Matlab error occured in: %s\n',directory{end});28 fid=fopen([ISSM_DIR '/test/Verification/NightlyRun/matlaberror.log'], 'wt'); 29 fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end}); 30 30 fprintf(fid,'%s',message); 31 31 fclose(fid); … … 33 33 exit 34 34 EOF 35 matlab -nojvm -nosplash -r matlab_run$i -logfile nightlylong$i.log &35 matlab -nojvm -nosplash -r matlab_run$i -logfile matlab_log$i.log & 36 36 done 37 37 38 38 wait 39 39 40 #remove matlab_run scripts. 41 rm -rf matlab_run*.m 42 40 43 #concatenate all reports 41 mv nightlylong1.log nightlylong.log44 mv matlab_log1.log matlab_log.log 42 45 for (( i=2;i<=$numprocs;i++ )) 43 46 do 44 cat nightlylong.log nightlylong$i.log > nightlylong.log.bak45 mv nightlylong.log.bak nightlylong.log46 rm nightlylong$i.log47 cat matlab_log.log matlab_log$i.log > matlab_log.log.bak 48 mv matlab_log.log.bak matlab_log.log 49 rm matlab_log$i.log 47 50 48 51 done 49 50 #remove unused lines to deal with a smaller file51 cat nightlylong.log | egrep 'difference: |NIGHTLYRUNTERMINATEDCORRECTLY' > nightly.log52 rm nightlylong.log53 54 #remove matlab_run scripts.55 rm -rf matlab_run*.m
Note:
See TracChangeset
for help on using the changeset viewer.