<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi, Brian — <div>The grib2 cache is a linked list of 2-D grids that are described by the file number, the coordinates of the non-varying dimensions (Z, T, and E), the size of the grid, and the name of the variable. If you are doing more than one display from that grid, the data are read from the cache instead of re-doing the I/O. Each new grid that is read is added to the list, most recent first. But because of the size limit of the grib2 cache, if you exceed the size, the grid at the end of the chain is released to make room for the new grid. So, if you are displaying data from 22 different grids, that is probably enough to exceed the size of the cache and when you go back to grid #1 the I/O has to be done again because that grid is no longer in the cache. It therefore makes a lot of sense for you to re-arrange the order of your nesting loops and do all your displays of a single cached grid before moving to the next variable. </div><div><br></div><div><font face="Courier" size="2">loop over file names</font></div><div><font face="Courier" size="2"> open file</font></div><div><font face="Courier" size="2"> loop over variables</font></div><div><font face="Courier" size="2"> loop over lat/lon domains </font></div><div><font face="Courier" size="2"> draw plot </font></div><div><font face="Courier" size="2"> print image</font></div><div><font face="Courier" size="2"> end</font></div><div><font face="Courier" size="2"> end</font></div><div><font face="Courier" size="2"> close file</font></div><div><font face="Courier" size="2">end</font></div><div><br></div><div>The metafile buffer size option is parsed but not looked at in version 2.1. I should probably add a warning to alert the user, or remove it altogether. </div><div>--Jennifer</div><div><br></div><div><br></div><div><br><div><div>On Mar 26, 2015, at 12:26 PM, Brian Gaze <<a href="mailto:brian.gaze@NTLWORLD.COM">brian.gaze@NTLWORLD.COM</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi,<div><br></div><div>When working concurrently with multiple grib2 files I'm encountering a performance issue. I initially thought this was caused by the grib2 cache but now wonder if it is related to the metafile buffer. </div><div><br></div><div>The sample script below helps to explain. Scenario is....</div><div><br></div><div>1) Open all files</div><div>2) Outer loop where latitude and longitude for plot are set</div><div>3) Inner loop through all open files plotting 2 variables from each one for the latitude and longitude currently set</div><div>4) Write output to an image file</div><div>5) Iterate</div><div><br></div><div>If I reduce the filenumber count to be lower than 13 OR only plot 1 variable the image files are generated quickly, approx 1.5 per second. </div><div><br></div><div>If I leave the filenumber count as it is and plot the 2 variables the plot plot is very slow taking approx 50 seconds to be written to the file system.</div><div> </div><div> <br></div><div><div><br></div><div>*Open files 1 to 22</div><div>'open file00.ctl'</div><div>'open file01.ctl'</div><div>'open filexx.ctl'</div><div><br></div><div><br></div><div>while(b<60)</div><div><br></div><div>filenumber=1</div><div>while (filenumber<23)</div><div>'set dfile ' %filenumber</div><div>'d var1'</div><div>'d var2'</div><div>filenumber=filenumber+1</div><div>endwhile</div><div><br></div><div>op = ' C:\'%imagefilename% '.png png x800 y600'</div><div>'gxprint ' %op ' white'</div><div><br></div><div>B=B+1</div><div>endwhile </div><div><br></div><div><br></div><div>When running the .gs I've tried using the -m NNN option to increase the metafile buffer size (e.g. to 3<span style="font-family: Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; background-color: rgb(197, 213, 255);">000000</span>) but this doesn't seem to make any difference. </div><div><br></div><div>Any ideas??</div><div><br></div><div>Thanks</div><div><br></div><div>Brian</div><div><br></div><div><br></div><div><br></div></div></div>
_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams<br>Center for Ocean-Land-Atmosphere Studies (COLA)<br>111 Research Hall, Mail Stop 2B3<br>George Mason University<br>4400 University Drive<br>Fairfax, VA 22030 <br><br></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>