<div dir="ltr">Dear Kor,<br><br>Yes I have 8 cores! The I/O output files are different for each process. I have to preform the gdal_calc on different maps each process. I just wanted to lunch more than one gdal_calc.py script at time.<br><br>Best<br><br>Lorenzo</div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-03 11:34 GMT+01:00 Kor de Jong <span dir="ltr"><<a href="mailto:kor@jemig.eu" target="_blank">kor@jemig.eu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Lorenzo,<br>
<br>
On 03/03/2016 12:44 AM, Lorenzo Bottaccioli wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If i run the code with out parallelization it takes around 650s to<br>
complete the calculation. Each process of the for loop is executed in<br>
~10s. If i run with parallelization it takes ~900s to complete the<br>
procces and each process of the for loop it takes ~30s.<br>
<br>
How is that? how can i Fix this?<br>
</blockquote>
<br>
If I am not mistaken, you are splitting your process into 8 concurrent processes. Do you have at least 8 cores in your machine and can you observe that the processes run indeed in parallel? If so, the overhead may come from the processes trying to get access to input and output files at the same time. Although your computations may run in parallel, the I/O will still happen sequentially and less optimal than during your non-concurrent run, because multiple processes are now frequently fighting to get access to files at the same time, blocking each other.<br>
<br>
You should probably instrument your code to figure out where the time is spent.<br>
<br>
In case I/O is indeed the bottleneck, then you might get better results by distributing the processes over multiple disks (multiple controllers). This will get rid of some synchronization points allowing multiple processes to continue to run in parallel, even while doing I/O.<br>
<br>
As a general rule, you don't want large scale I/O to happen concurrently on non-parallel hardware.<br>
<br>
Best regards,<br>
Kor<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div><br></div>