<div dir="ltr">Hi Michael<br><div><br>It will be the same as a regular OpenMP program without the OMP_NUM_THREADS environment variable.<br><br></div><div>-Sujin<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 8, 2016 at 9:39 AM, Schlottke-Lakemper, Michael <span dir="ltr"><<a href="mailto:m.schlottke-lakemper@aia.rwth-aachen.de" target="_blank">m.schlottke-lakemper@aia.rwth-aachen.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Hi Sujin,
<div><br>
</div>
<div>Thanks again for the fast and helpful answer! One last question: if I do not call vtkSMPTools::Initialize() and OMP_NUM_THREADS is not set, which number of threads will be used? Will it be the same as if running a normal OpenMP program with OMP_NUM_THREADS
 not set or will a different value be used?</div><span class="HOEnZb"><font color="#888888">
<div><br>
</div>
<div>Michael</div></font></span><div><div class="h5">
<div><br>
<div>
<blockquote type="cite">
<div>On 08 Mar 2016, at 15:22 , Sujin Philip <<a href="mailto:sujin.philip@kitware.com" target="_blank">sujin.philip@kitware.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr">
<div>
<div>
<div>Hi Michael,<br>
<br>
- What is the default SMP backend if I do not configure anything during ParaView compilation (I assume “Sequential”)?<br>
Sequential is the default backend.<br>
<br>
- With OpenMP, will I have to call vtkSMPTools::Initialize(nThreads) explicitly with nThreads determined by myself, or will it honor e.g. OMP_NUM_THREADS automatically?<br>
It is not necessary to call vtkSMPTools::Initialize. If initialize is not called and OMP_NUM_THREADS is set, it will be used.<br>
<br>
- Am I correct in the assumption that the backend type should not change the results, i.e. that on hosts where I do not know which SMP backend is configured, I can assume my algorithms “just work”?<br>
</div>
Yes, the different backends should produce the same results. The only noticeable difference should be in the performance. If the results are not the same then its a bug.<br>
<br>
</div>
Thanks<br>
</div>
Sujin<br>
<br>
<div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Mar 8, 2016 at 9:08 AM, Schlottke-Lakemper, Michael
<span dir="ltr"><<a href="mailto:m.schlottke-lakemper@aia.rwth-aachen.de" target="_blank">m.schlottke-lakemper@aia.rwth-aachen.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi Utkarsh,<br>
<br>
Thanks for the fast answer. I have a a few follow-up questions, if I may:<br>
<br>
- What is the default SMP backend if I do not configure anything during ParaView compilation (I assume “Sequential”)?<br>
- With OpenMP, will I have to call vtkSMPTools::Initialize(nThreads) explicitly with nThreads determined by myself, or will it honor e.g. OMP_NUM_THREADS automatically?<br>
- If I have to call vtkSMPTools::Initialize(nThreads) explicitly, where should it be done in case of a plugin? In the plugin’s ctor, in the RequestData method, or someplace else?<br>
- Am I correct in the assumption that the backend type should not change the results, i.e. that on hosts where I do not know which SMP backend is configured, I can assume my algorithms “just work”?<br>
<br>
Thanks a lot in advance<br>
<span><font color="#888888"><br>
Michael<br>
</font></span>
<div>
<div><br>
> On 08 Mar 2016, at 14:39 , Utkarsh Ayachit <<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>> wrote:<br>
><br>
> Michael,<br>
><br>
> The VTK-SMP approach is indeed the way to go for this. To make the<br>
> backend use OpenMP, you simply compile VTK/ParaView with<br>
> VTK_SMP_IMPLEMENTATION_TYPE set to OpenMP. The programming model<br>
> described in the SMP Guide PDF has been implemented for all supported<br>
> backends including OpenMP and TBB.<br>
><br>
> Utkarsh<br>
><br>
> On Tue, Mar 8, 2016 at 6:22 AM, Schlottke-Lakemper, Michael<br>
> <<a href="mailto:m.schlottke-lakemper@aia.rwth-aachen.de" target="_blank">m.schlottke-lakemper@aia.rwth-aachen.de</a>> wrote:<br>
>> Hi everyone,<br>
>><br>
>> We have a custom parallel reader plugin that works well with our files even<br>
>> on large-ish (100-1000) number of cores for the pvserver. Recently we’ve<br>
>> added the capability to also create ghost cells with this reader such that<br>
>> MPI domain boundaries become transparent to filters that need neighbor data,<br>
>> e.g., for gradient computations. However, this ghost cell generation takes<br>
>> up quite some time, so we would like to keep the number of MPI ranks at a<br>
>> minimum and use hybrid MPI-OpenMP parallelism for our plugin.<br>
>><br>
>> My question is thus if it is possible to use OpenMP inside a custom plugin?<br>
>> And if yes, is there a canonical way to do it (maybe an example plugin) or<br>
>> is it going to be a hack?<br>
>><br>
>> When searching the interwebs for ParaView and OpenMP, I only came up with an<br>
>> old VTK mailing list thread from 2014<br>
>> (<a href="http://public.kitware.com/pipermail/vtkusers/2014-March/083399.html" rel="noreferrer" target="_blank">http://public.kitware.com/pipermail/vtkusers/2014-March/083399.html</a>), in<br>
>> which David (DeMarle) refers to some initial documentation of the SMP<br>
>> framework (<a href="http://www.vtk.org/Wiki/images/3/3b/VTK_SMP_Guide.pdf" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/images/3/3b/VTK_SMP_Guide.pdf</a>). However,<br>
>> the linked PDF does not contain references to OpenMP.<br>
>><br>
>> Thanks a lot in advance!<br>
>><br>
>> Michael<br>
>><br>
>> --<br>
>> Michael Schlottke-Lakemper<br>
>><br>
>> Chair of Fluid Mechanics and Institute of Aerodynamics<br>
>> RWTH Aachen University<br>
>> Wüllnerstraße 5a<br>
>> 52062 Aachen<br>
>> Germany<br>
>><br>
>> Phone: <a href="tel:%2B49%20%28241%29%2080%2095188" value="+492418095188" target="_blank">
+49 (241) 80 95188</a><br>
>> Fax: <a href="tel:%2B49%20%28241%29%2080%2092257" value="+492418092257" target="_blank">
+49 (241) 80 92257</a><br>
>> Mail: <a href="mailto:m.schlottke-lakemper@aia.rwth-aachen.de" target="_blank">m.schlottke-lakemper@aia.rwth-aachen.de</a><br>
>> Web: <a href="http://www.aia.rwth-aachen.de/" rel="noreferrer" target="_blank">
http://www.aia.rwth-aachen.de</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank">
www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Search the list archives at:<br>
>> <a href="http://markmail.org/search/?q=Paraview-developers" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=Paraview-developers</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">
http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
>><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank">
www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div></div></div>

</blockquote></div><br></div>