<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div>Dear sir,</div><div><br></div><div>I've &nbsp;used GDALWarper to develop a program for image resampling, resolution of 10m up to 2.5m. In this process I found that the&nbsp;ChunkAndWarpImage( ) in&nbsp;GDALWarpOperation was too slow that it almost took me an hour to get a sence of QuickBird image. After checking source codes, I would like to promote two ways to get this process faster.</div><div><br></div><div>1. Set the&nbsp;dfWarpMemoryLimit larger than 64. Since the computer I am using has a RAM of 12GB, 64M is a little smaller under this condition. Besides, the smaller&nbsp;dfWarpMemoryLimit is, the more chunks will be creat. That means we have to do lots of RasterIO( ), which takes a long time to complete. ( Thanks for your advice in the declaration before the definition, in which you have advice that&nbsp;we should&nbsp;try various schemes to query physical RAM. I just wanna offer some help to somebody who has the same confusion with me, in case they could find a solution here by google or something else.)</div><div><br></div><div>2. Add parallelization support to GDAL build options, such as OpenMP or CUDA. (I've been able to use CUDA along with GDAL.)&nbsp;Then question comes: how can I add OpenMP to GDAL? I konw nothing about Cmake or gcc. After googling I tried the following metrods:</div><div><br></div><div>In nmake.opt, add:</div><div><div># Any extra libraries needed on this platform?</div><div># Basic Makefile for OpenMP</div><div>OMP_CFLAGS = -fopenmp</div></div><div><br></div><div>In alg\makefile.vc, add:</div><div><div>!IFDEF OMP_CFLAGS</div><div>OMP_CFLAGS = $(OMP_CFLAGS) -DOMP_SUPPORT</div><div>!ENDIF</div></div><div><br></div><div>Finally a little test for OpenMP in alg\gdalwarpkernel.cpp:</div><div>#include &lt;omp.h&gt;</div><div>...Ln2706:</div><div>int ncore = omp_get_num_procs();</div><div><div>#pragma omp parallel for num_threads(ncore*2)</div></div><div>for(...)...</div><div><br></div><div>I put vcomp90.dll and Microsoft.VC90.OpenMP.manifest in the same path as makegdal90.sln, rebuilded the makegdal solution and re-made a brand new gdal18.dll with no error appearing. However, when I tried to run my program for image resampling, only 4 of the 8 cores of my cpu were running effectively, and it still took a long time, just as no OpenMP used.</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, verdana, sans-serif; line-height: 25px; ">Since OpenMP could speed up codes so easily, w</span><span class="Apple-style-span" style="font-family: arial, verdana, sans-serif; line-height: 25px; ">ould you please help me to add it into GDAL? I'm using GDAL1.8.0 and VS2009, Win7 Ultimate.</span></div><div><font class="Apple-style-span" face="arial, verdana, sans-serif"><span class="Apple-style-span" style="line-height: 25px;"><br></span></font><span class="Apple-style-span" style="font-family: arial, verdana, sans-serif; line-height: 25px; "><div>Thank you!</div><div><br></div><div>&nbsp;Xiaolu Song&nbsp;</div><div>2011-11-05&nbsp;</div><div>&nbsp;--&nbsp;</div><div>Xiaolu Song&nbsp;</div><div>Center for Earth Observation and Digital Earth Chinese Academy of Sciences&nbsp;</div><div>No.9 Dengzhuang South Road, Haidian District, Beijing 100094, China&nbsp;</div><div>Tel: +86-010-82178188 +86-18610335605&nbsp;</div><div>Email:<a href="mailto:talent_sxl@126.com" target="_blank">talent_sxl@126.com</a>&nbsp;</div><div>中国科学院对地观测与数字地球科学中心&nbsp;</div><div>北京市海淀区邓庄南路9号</div><div><br></div></span></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>