<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NO-BOK" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks for the hint.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I just tried:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">time v.surf.rst elevrand zcol=value elevation=elev_full --o nprocs=10<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Reading features from vector map ...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Processing segments in parallel...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Starting parallel work<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">v.surf.rst complete.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">real    0m33.814s<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">user    0m35.786s<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">sys     0m0.126s<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Seems, that also with nprocs=10 and OMP_NUM_THREADS=10 v.surf.rst only uses one CPU in GRASS 7.3.svn (despite the message
 about parallel work)…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Stefan<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Anna Petrášová [mailto:kratochanna@gmail.com]
<br>
<b>Sent:</b> søndag 29. oktober 2017 12.31<br>
<b>To:</b> Stefan Blumentrath <Stefan.Blumentrath@nina.no><br>
<b>Cc:</b> GRASS-dev <grass-dev@lists.osgeo.org><br>
<b>Subject:</b> RE: [GRASS-dev] Compilation options<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">v.surf.rst in trunk has nproc parameter, have you tried to use it?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Anna<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Oct 29, 2017 6:51 AM, "Stefan Blumentrath" <<a href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hei Anna,<br>
<br>
Thanks for looking into this.<br>
<br>
I did some tests with GRASS 7.2.1svn (r70188) and GRASS 7.3.svn (r70829) both compiled with --with-openmp<br>
<br>
It seems that r.proj does not use multiple threads in GRASS 7.2 (not tested in 7.3. yet). v.surf.rst uses more cores in GRASS 7.2 with OpenMP but that does not bring down execution time at all. OpenMP seems to be disabled for v.surf.rst in GRASS 7.3. v.surf.bspline
 however, is significantly faster in GRASS 7.3 with OpenMP...<br>
<br>
I will do some more, systematic tests and update the wiki entry as far as I can, if not someone with knowledge gets there first...<br>
<br>
Cheers<br>
Stefan<br>
<br>
P.S.: Some preliminary test results:<br>
# OpenMP support test<br>
$ OMP_NUM_THREADS=10<br>
$ export OMP_NUM_THREADS<br>
$ time v.surf.rst input=points elevation=test  --o --qq<br>
<br>
real    51m42.224s<br>
user    398m2.766s<br>
sys     0m18.874s<br>
<br>
$ OMP_NUM_THREADS=1<br>
$ export OMP_NUM_THREADS<br>
$ time v.surf.rst input=points elevation=test  --o --qq<br>
<br>
real    53m22.508s<br>
user    53m10.607s<br>
sys     0m4.793s<br>
<br>
$ OMP_NUM_THREADS=10<br>
$ export OMP_NUM_THREADS<br>
$ time v.surf.bspline elevrand column=value output=elev_full --o<br>
real    0m20.509s<br>
user    3m11.412s<br>
sys     0m1.963s<br>
<br>
$ OMP_NUM_THREADS=1<br>
$ export OMP_NUM_THREADS<br>
$ time v.surf.bspline elevrand column=value output=elev_full --o<br>
real    1m15.434s<br>
user    1m14.738s<br>
sys     0m0.447s<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
-----Original Message-----<br>
From: Anna Petrášová [mailto:<a href="mailto:kratochanna@gmail.com">kratochanna@gmail.com</a>]<br>
Sent: fredag 27. oktober 2017 17.00<br>
To: Stefan Blumentrath <<a href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a>><br>
Cc: GRASS developers list (<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>) <<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>><br>
Subject: Re: [GRASS-dev] Compilation options<br>
<br>
On Tue, Oct 24, 2017 at 10:27 AM, Stefan Blumentrath <<a href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a>> wrote:<br>
> Hi again,<br>
><br>
><br>
><br>
> Seek and ye shall find…<br>
><br>
><br>
><br>
> So, there is:<br>
><br>
> <a href="https://grasswiki.osgeo.org/wiki/OpenMP#OpenMP_support_in_GRASS_7" target="_blank">
https://grasswiki.osgeo.org/wiki/OpenMP#OpenMP_support_in_GRASS_7</a> and<br>
><br>
> <a href="https://grasswiki.osgeo.org/wiki/GPU" target="_blank">https://grasswiki.osgeo.org/wiki/GPU</a><br>
><br>
> Which helped me a bit further.<br>
><br>
><br>
><br>
> However, my impression is that not all info there (esp. on OpenMP) is<br>
> up to date (e.g. latest development like here:<br>
> <a href="https://lists.osgeo.org/pipermail/grass-dev/2017-August/085711.html" target="_blank">
https://lists.osgeo.org/pipermail/grass-dev/2017-August/085711.html</a>).<br>
> Neither did it became very clear to me which modules already have<br>
> robust and working support and which are just candidates or where<br>
> initial implementations are available (sometimes outside the code<br>
> base)…<br>
><br>
><br>
<br>
I updated it slightly to reflect the new modules, as always, more work is needed on that page.<br>
<a href="https://grasswiki.osgeo.org/wiki/OpenMP#OpenMP_support_in_GRASS_7" target="_blank">https://grasswiki.osgeo.org/wiki/OpenMP#OpenMP_support_in_GRASS_7</a><br>
<br>
Anna<br>
<br>
><br>
> Cheers<br>
><br>
> Stefan<br>
><br>
><br>
><br>
> From: grass-dev [mailto:<a href="mailto:grass-dev-bounces@lists.osgeo.org">grass-dev-bounces@lists.osgeo.org</a>] On Behalf<br>
> Of Stefan Blumentrath<br>
> Sent: mandag 23. oktober 2017 09.24<br>
> To: GRASS developers list (<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>)<br>
> <<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>><br>
> Subject: [GRASS-dev] Compilation options<br>
><br>
><br>
><br>
> Dear all,<br>
><br>
><br>
><br>
> Does someone of you know which modules benefit from --with-openmp and<br>
> --with-opencl compilation options?<br>
><br>
><br>
><br>
> I found this explanation of compilation options:<br>
> <a href="https://grass.osgeo.org/grass72/source/snapshot/REQUIREMENTS.html" target="_blank">
https://grass.osgeo.org/grass72/source/snapshot/REQUIREMENTS.html</a><br>
><br>
> But it does not cover OpenCL or OpenMP (as well as some few more other<br>
> option).<br>
><br>
><br>
><br>
> If I wanted to find out myself, could I just search the code for<br>
> modules that import the relevant headers of the respective libraries?<br>
><br>
> Or is that a bit more complex?<br>
><br>
><br>
><br>
> Another question is if it would be recommended to use the different<br>
> options, as I understood e.g. using --with-pthread is not necessarily<br>
> a good choice…<br>
><br>
><br>
><br>
> Thanks in advance.<br>
><br>
><br>
><br>
> Cheers<br>
><br>
> Stefan<br>
><br>
><br>
> _______________________________________________<br>
> grass-dev mailing list<br>
> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>