<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>That's the right idea, but a bit more complicated than necessary. You don't have to mess with MPI. The generic vtkMultiProcessController has reduce methods, so it's much easier to just use those. Alan will also need to add a Controller ivar to his class
(which is clearly in your code but not explained). The code becomes something like this (I haven't actually compiled so sorry for typos). First, in your header file add an ivar called Controller that is of type vtkMultiProcessController.</div>
<div><br>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px;">
<div><font class="Apple-style-span" face="Consolas">class vtkReplicateGeometry : public vtkAppropriateSuperclassAlgorithm</font></div>
<div><font class="Apple-style-span" face="Consolas">{</font></div>
<div><font class="Apple-style-span" face="Consolas">public:</font></div>
<div><font class="Apple-style-span" face="Consolas"> ...</font></div>
<div><font class="Apple-style-span" face="Consolas"> vtkGetObjectMacro(Controller, vtkMultiProcessController);</font></div>
<div><font class="Apple-style-span" face="Consolas"> virtual void SetController(vtkMultiProcessController *);</font></div>
<div><font class="Apple-style-span" face="Consolas"> ...</font></div>
<div><font class="Apple-style-span" face="Consolas">protected:</font></div>
<div><font class="Apple-style-span" face="Consolas"> ...</font></div>
<div><font class="Apple-style-span" face="Consolas"> vtkMultiProcessController *Controller;</font></div>
</blockquote>
<div><font class="Apple-style-span" face="Consolas"><br>
</font></div>
<div>And in your source file declare the SetController method and initialize the controller to the global controller.</div>
<div><br>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px;">
<div><font class="Apple-style-span" face="Consolas">vtkCxxSetObjectMacro(vtkReplicateGeometry, Controller, vtkMultiProcessController);</font></div>
<div><font class="Apple-style-span" face="Consolas">...</font></div>
<div><font class="Apple-style-span" face="Consolas">vtkReplicateGeometry::vtkReplicateGeometry()</font></div>
<div><font class="Apple-style-span" face="Consolas">{</font></div>
<div><font class="Apple-style-span" face="Consolas"> ...</font></div>
<div><font class="Apple-style-span" face="Consolas"> this->Controller = NULL;</font></div>
<div><font class="Apple-style-span" face="Consolas"> this->SetController(vtkMultiProcessController::GetGlobalController());</font></div>
</blockquote>
<div><font class="Apple-style-span" face="Consolas"><br>
</font></div>
<div>Now you are ready in your RequestData method to use the Reduce method of the communicator to find the global mins and maxes.</div>
<div><br>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px;">
<div><font class="Apple-style-span" face="Consolas">double bounds[6];</font></div>
<div><font class="Apple-style-span" face="Consolas">input->GetBounds(bounds);</font></div>
<div><font class="Apple-style-span" face="Consolas">if (this->Controller)</font></div>
<div><font class="Apple-style-span" face="Consolas"> {</font></div>
<div><font class="Apple-style-span" face="Consolas"> double mins[3] = {bounds[0], bounds[2], bounds[4]};</font></div>
<div><font class="Apple-style-span" face="Consolas"> double maxes[3] = {bounds[1], bounds[3], bounds[5]};</font></div>
<div><font class="Apple-style-span" face="Consolas"> double globalMins[3], globalMaxes[3];</font></div>
<div><font class="Apple-style-span" face="Consolas"> this->Controller->AllReduce(mins, globalMins, 3, vtkCommunicator::MIN_OP);</font></div>
<div><font class="Apple-style-span" face="Consolas"> this->Controller->AllReduce(maxes, globalMaxes, 3, vtkCommunicator::MAX_OP);</font></div>
<div><font class="Apple-style-span" face="Consolas"> bounds[0] = mins[0]; bounds[1] = maxes[0];</font></div>
<div><font class="Apple-style-span" face="Consolas"> bounds[2] = mins[1]; bounds[3] = maxes[1];</font></div>
<div><font class="Apple-style-span" face="Consolas"> bounds[4] = mins[2]; bounds[5] = maxes[2];</font></div>
<div><font class="Apple-style-span" face="Consolas"> }</font></div>
</blockquote>
<div><font class="Apple-style-span" face="Consolas"><br>
</font></div>
<div>That should be it.</div>
<div><br>
</div>
<div>-Ken</div>
<div><font size="2"><font face="Consolas,Courier New,Courier"><span style="font-size:10pt"><br>
**** Kenneth Moreland<br>
*** Sandia National Laboratories<br>
*********** <br>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><br>
** *** ** phone: (505) 844-8919<br>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><br>
</span></font></font></div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>"Biddiscombe, John A." <<a href="mailto:biddisco@cscs.ch">biddisco@cscs.ch</a>><br>
<span style="font-weight:bold">Date: </span>Wed, 27 Jul 2011 05:11:30 +0000<br>
<span style="font-weight:bold">To: </span>"Scott, W Alan" <<a href="mailto:wascott@sandia.gov">wascott@sandia.gov</a>>, "<a href="mailto:paraview-developers@paraview.org">paraview-developers@paraview.org</a>" <<a href="mailto:paraview-developers@paraview.org">paraview-developers@paraview.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Paraview-developers] Plugin client/server<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div 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">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 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.emailquote, li.emailquote, div.emailquote
        {mso-style-name:emailquote;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:1.0pt;
        border:none;
        padding: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-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1616449674;
        mso-list-template-ids:1774456484;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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]-->
<div lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">I believe that the client does collect boxes from all nodes and generate the information you need, but on the servers ... if my filters require the global bounds,
I use this.<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; "><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="color: teal; font-family: 'Courier New'; ">#ifdef</span></b><b><span style="font-family: 'Courier New'; "><span style="color:green">VTK_USE_MPI</span><o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:green">vtkMPICommunicator</span> *<span style="color:green">communicator</span> =
<span style="color:green">vtkMPICommunicator</span>::<span style="color:green">SafeDownCast</span>(<span style="color:maroon">this</span>-><span style="color:green">Controller</span>-><span style="color:green">GetCommunicator</span>());<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:green">MPI_Comm</span> <span style="color:green">mpiComm</span> =
<span style="color:green">MPI_COMM_NULL</span>;<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:maroon">if</span> (<span style="color:green">communicator</span>) {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:green">mpiComm</span> = *(<span style="color:green">communicator</span>-><span style="color:green">GetMPIComm</span>()-><span style="color:green">GetHandle</span>());<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; "> }<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; "><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">...<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; "><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:maroon">double</span> <span style="color:green">bounds</span>[<span style="color:red">6</span>];<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:green">input</span>-><span style="color:green">GetBounds</span>(<span style="color:green">bounds</span>);<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:maroon">double</span> <span style="color:green">bmin</span>[<span style="color:red">3</span>],
<span style="color:green">bmn</span>[<span style="color:red">3</span>] = {<span style="color:green">bounds</span>[<span style="color:red">0</span>],
<span style="color:green">bounds</span>[<span style="color:red">2</span>], <span style="color:green">
bounds</span>[<span style="color:red">4</span>]};<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:maroon">double</span> <span style="color:green">bmax</span>[<span style="color:red">3</span>],
<span style="color:green">bmx</span>[<span style="color:red">3</span>] = {<span style="color:green">bounds</span>[<span style="color:red">1</span>],
<span style="color:green">bounds</span>[<span style="color:red">3</span>], <span style="color:green">
bounds</span>[<span style="color:red">5</span>]};<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:green">MPI_Allreduce</span>(<span style="color:green">bmn</span>,
<span style="color:green">bmin</span>, <span style="color:red">3</span>, <span style="color:green">
MPI_DOUBLE</span>, <span style="color:green">MPI_MIN</span>, <span style="color:green">
mpiComm</span>);<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">
<span style="color:green">MPI_Allreduce</span>(<span style="color:green">bmx</span>,
<span style="color:green">bmax</span>, <span style="color:red">3</span>, <span style="color:green">
MPI_DOUBLE</span>, <span style="color:green">MPI_MAX</span>, <span style="color:green">
mpiComm</span>);<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; "><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">Cut’n’pasted with some extra code removed. Apologies if I deleted the wrong lines<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; "><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; ">JB<o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-family: 'Courier New'; "><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125); font-family: Calibri, sans-serif; "><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125); font-family: Calibri, sans-serif; "><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">
<a href="mailto:paraview-developers-bounces@paraview.org">paraview-developers-bounces@paraview.org</a> [<a href="mailto:paraview-developers-bounces@paraview.org">mailto:paraview-developers-bounces@paraview.org</a>]
<b>On Behalf Of </b>Scott, W Alan<br>
<b>Sent:</b> 27 July 2011 03:56<br>
<b>To:</b> <a href="mailto:paraview-developers@paraview.org">paraview-developers@paraview.org</a><br>
<b>Subject:</b> [Paraview-developers] Plugin client/server<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">I have written a filter that runs client/ multiple remote server. This filter works correctly, from what I can see. (It just replicates a dataset, in order to create a
larger dataset in memory for testing and benching.)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">I am trying to convert this filter to a plugin. It works local server, but fails client/ remote server. I believe that my problem is that I am trying to calculate the geometric
bounds of the dataset, and each of the processors is returning a different bounding box – representing the bounding box of this server’s data. What I want is the bounding box of all server’s data. I am using a vtkDataSet function called GetBounds.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">My questions are as follows:<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:0cm;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<span style="font-size: 10pt; "><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">Is there an example of how to make plugins that work for remote servers, that calculate the bounds of all of the data, for all processors?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:0cm;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<span style="font-size: 10pt; "><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">If not, is there anywhere that I should look for ldeas?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:0cm;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<span style="font-size: 10pt; "><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">If not, is there someone I should talk to?<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">Thanks,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">Alan<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Calibri, sans-serif; ">--------------------------------------------------------</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; ">W. Alan Scott</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; ">ParaView Support Manager</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; "> </span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; ">GAITS</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; ">Sandia National Laboratories, MS 0822</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; ">Org 9326 - Building 880 A1-C</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; ">(505) 284-0932 FAX (505) 845-0833</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; ">---------------------------------------------------------</span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial, sans-serif; "> </span><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></p>
</div>
</div>
</div>
</div>
_______________________________________________ Paraview-developers mailing list <a href="mailto:Paraview-developers@paraview.org">
Paraview-developers@paraview.org</a> <a href="http://public.kitware.com/mailman/listinfo/paraview-developers">
http://public.kitware.com/mailman/listinfo/paraview-developers</a> </blockquote>
</span>
</body>
</html>