<div dir="ltr"><div>Thanks Moritz,<br><br></div>Indeed, I ended up creating mapsets on the fly using grass72 -c, and processing tiles in their respective mapsets.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 May 2017 at 18:18, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
Le 11 mai 2017 23:30:28 GMT+02:00, Pierre Roudier <<a href="mailto:pierre.roudier@gmail.com">pierre.roudier@gmail.com</a>> a écrit :<br>
>Thanks all,<br>
><br>
>I ended up having a script that tiles my overall region (using<br>
>v.mkgrid). I<br>
>then loop through the tiles, and create a set of subregions on the fly<br>
>(using the save= option available for g.region). So in the end I have<br>
>tiles<br>
>represeneted as a set of regions, named "region_[1-n]".<br>
><br>
>I then use the WIND_OVERRIDE env variable to process the tiles:<br>
><br>
>- On my personal machine, I can use GNU parallel:<br>
><br>
>g.list type=region pat=region_* | parallel WIND_OVERRIDE={} r.series<br>
>in=`g.list rast pat=temp_* sep=","` out=tiled_{} method=quantile<br>
>quantile=0.95 --o<br>
><br>
>- BUT: on the cluster, I can't use GNU parallel, so I generate one<br>
>script<br>
>per region, which essentially is a one liner:<br>
><br>
>WIND_OVERRIDE=region_n r.series in=`g.list rast pat=temp_* sep=","`<br>
>out=tiled_region_n method=quantile quantile=0.95 --o<br>
><br>
>This script is launch silently using GRASS_BATCH_JOB.<br>
><br>
>My problem now is that I got errors because several GRASS scripts are<br>
>hitting the GRASS database at the same time:<br>
><br>
>Starting GRASS GIS...<br>
>ERROR: pierre.roudier is currently running GRASS in selected mapset<br>
>(file<br>
</span>>*/projects/nesi00165/<wbr>nobackup/modis/grassdata/<wbr>modis_ts/PERMANENT/PERMANENT/*<wbr>.gislock<br>
<span class="">>found). Concurrent use not allowed.<br>
>You can force launching GRASS using -f flag (note that you need<br>
>permission for this operation). Have another look in the processor<br>
>manager just to be sure...<br>
>Exiting...<br>
><br>
>My question: in this instance, is it safe to use the -f flag, given<br>
>these<br>
>different GRASS instances are not writing the same dataset to the DB?<br>
<br>
</span>I would say that the generally recommended way would be to create separate mapsets to avoid such conflicts. At the end you can loop over all mapsets to copy the results into one final mapset.<br>
<span class="HOEnZb"><font color="#888888"><br>
Moritz<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
><br>
><br>
>On 21 April 2017 at 20:44, Blumentrath, Stefan<br>
><<a href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a>><br>
>wrote:<br>
><br>
>> Hi Pierre,<br>
>><br>
>> tiling should speed up significantly, if you process the tiles in<br>
>parallel<br>
>> (and if you have multiple cores and if IO is not the bottleneck (e.g.<br>
>slow<br>
>> network connection to the data)).<br>
>> Care has to be taken with the region settings, though.<br>
>><br>
>> See e.g.:<br>
>><br>
><a href="https://grasswiki.osgeo.org/wiki/Parallel_GRASS_jobs#Working_with_tiles" rel="noreferrer" target="_blank">https://grasswiki.osgeo.org/<wbr>wiki/Parallel_GRASS_jobs#<wbr>Working_with_tiles</a><br>
>><br>
>> Cheers<br>
>> Stefan<br>
>><br>
>> ______________________________<wbr>__________<br>
>> Von: grass-user <<a href="mailto:grass-user-bounces@lists.osgeo.org">grass-user-bounces@lists.<wbr>osgeo.org</a>> im Auftrag von<br>
>> Pierre Roudier <<a href="mailto:pierre.roudier@gmail.com">pierre.roudier@gmail.com</a>><br>
>> Gesendet: Freitag, 21. April 2017 00:49<br>
>> An: grass-user<br>
>> Betreff: [GRASS-user] Aggregation of massive number of raster layers<br>
>with<br>
>> r.series<br>
>><br>
>> Hi,<br>
>><br>
>> I am trying to compute the 95th percentile of a massive grid (12+<br>
>> million pixels) for a massive number of layers (~2500 layers).<br>
>><br>
>> I am doing the aggregation using r.series on our cluster running<br>
>grass<br>
>> 7.2, but of course it takes ages (21% there after 3 days).<br>
>><br>
>> - I tried to tile the process, but it doesn't seem to help much.<br>
>><br>
>> - Is there any benefit for me to switch to t.rast.aggregate? My<br>
>> understanding was that it was a wrapper around r.series.<br>
>><br>
>> - Does anyone have a fancy trick to make the aggregation go faster<br>
>> (parallelisation)?<br>
>><br>
>> Cheers,<br>
>><br>
>> Pierre<br>
>> ______________________________<wbr>_________________<br>
>> grass-user mailing list<br>
>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/grass-user</a><br>
>><br>
</div></div></blockquote></div><br></div>