<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=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<title>Re: [Paraview-developers] MPI_Init during standalone ParaView operation</title>
<style>
<!--
 /* Font Definitions */
 @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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</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=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Fabian<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif"'><br>
reusing the sim&#8217;s mpi_world and need to have that shared into paraview&#8217;s stuff?
&nbsp;Or is it using something else?<span style='color:#1F497D'><o:p></o:p></span></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>The sim&#8217;s communicator is
joined to the app&#8217;s communicator using an &nbsp;MPI_accept / MPI_Connect pair where
the app calls accpt and the sim connects &#8211; via the dsm.&nbsp; Any old communicator
will do me on the app side, so lojng as paraview runs. It&#8217;s really because debug/testing
is too slow when you have to init pvservers and attach debuggers and wotnot.
Much easier to run standalone.<o:p></o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:
12.0pt;margin-left:5.25pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Otherwise,
I think the paraview client initializes the global controller with Dummy, but I
think perhaps you could safely replace that when you detect the need by
initializing a new MPIController and SetGlobalController().<br>
<br>
</span><o:p></o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>OK. I tried MPI_Init and all
is well, then I create a new controller and assign it to the DSM manager and
setit globally, and all seems to be working. The DSM is not doing what it is
supposed to, but the app is not crashing, so I think paraview is fooled &#8220;enough&#8221;.
If I can fix the DSM to work as it is, then I&#8217;m happy. Thanks for the pointers.
<o:p></o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>JB<o:p></o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>NB. MPI_Init_thread(blah) is not
working since we need to start (win32) with &#8220;&#8211;channel mt&#8221; on the command line,
so I guess I may need to run as an mpi app anyway &lt;sigh&gt;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-family:
"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>vtkSmartPointer</span><span
style='color:olive'>&lt;</span><span style='color:green'>vtkMPIController</span><span
style='color:olive'>&gt;</span> <span style='color:green'>controller</span> <span
style='color:olive'>=</span> <span style='color:green'>vtkSmartPointer</span><span
style='color:olive'>&lt;</span><span style='color:green'>vtkMPIController</span><span
style='color:olive'>&gt;::</span><span style='color:green'>New</span><span
style='color:olive'>();</span></span></b><span style='font-family:"Courier New";
color:olive'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-family:
"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>controller</span><span
style='color:olive'>-&gt;</span><span style='color:green'>Initialize</span><span
style='color:olive'>(&amp;</span><span style='color:green'>argc</span><span
style='color:olive'>,</span> <span style='color:olive'>&amp;</span><span
style='color:green'>_argv</span><span style='color:olive'>,</span> <span
style='color:red'>1</span><span style='color:olive'>);</span></span></b><span
style='font-family:"Courier New";color:olive'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-family:
"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:maroon'>this</span><span
style='color:olive'>-&gt;</span><span style='color:green'>SetController</span><span
style='color:olive'>(</span><span style='color:green'>controller</span><span
style='color:olive'>);</span></span></b><span style='font-family:"Courier New";
color:olive'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-family:
"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>vtkMPIController</span><span
style='color:olive'>::</span><span style='color:green'>SetGlobalController</span><span
style='color:olive'>(</span><span style='color:green'>controller</span><span
style='color:olive'>);</span></span></b><span style='font-family:"Courier New";
color:olive'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p>

</div>

</div>

</body>

</html>