<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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@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:Consolas;
        panose-1:2 11 6 9 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";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";
        color:black;}
span.EmailStyle21
        {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;}
--></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 bgcolor="white" lang="EN-GB" 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">Michael,<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 style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">I had the same problem with a plugin of mine, so I added some code to call mpi init in the client,<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">Have a look at this patch. I can’t remember why I put in an #ifdef win32 now, (maybe because I usually run the gui on windows and
the servers on the cray and probably it needed a tweak on linux…)<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"><a href="https://github.com/biddisco/ParaView/commit/10e4affe2d7a4736d05d1d14cfaffc996c227649">https://github.com/biddisco/ParaView/commit/10e4affe2d7a4736d05d1d14cfaffc996c227649</a><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 style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">note also I needed thread multiple, so you might be able to simplify it slightly.<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 style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">This patch might be obsolete, because I think I found a way of doing it inside the plugin…[pause] … no in the plugin I swap the global
communicator from a dummycontroller to a true mpi controller. Try this patch and if it doesn’t work I’ll point you to my plugin tweaks.<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 style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">JB<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>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:windowtext"> paraview-developers-bounces@paraview.org
[mailto:paraview-developers-bounces@paraview.org] <b>On Behalf Of </b>burlen<br>
<b>Sent:</b> 01 June 2013 19:19<br>
<b>To:</b> Michael Schlottke<br>
<b>Cc:</b> ParaView Developers<br>
<b>Subject:</b> Re: [Paraview-developers] ParaView plugins with MPI only on client<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Micheal,<br>
<br>
I think you better let ParaView start MPI. There is a method that every reader should implement called CanReadFile. If you're reader cannot run with out MPI then in CanReadFile you should check if MPI is initialized and if not then you should return false.
Then ParaView will not attempt to use your reader. This will avoid crashes when you are not running in client server mode. Something like this...<br>
<br>
<tt><span style="font-size:10.0pt">276 //-----------------------------------------------------------------------------</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>277 int vtkSQBOVReaderBase::CanReadFile(const char *file)</tt><br>
<tt>278 {</tt><br>
<tt>279 #if defined SQTK_DEBUG</tt><br>
<tt>280 pCerr() << "=====vtkSQBOVReaderBase::CanReadFile" << endl;</tt><br>
<tt>281 pCerr() << "Check " << safeio(file) << "." << endl;</tt><br>
<tt>282 #endif</tt><br>
<tt>283</tt><br>
<tt>284 int status=0;</tt><br>
<tt>285</tt><br>
<tt>286 #ifdef SQTK_WITHOUT_MPI</tt><br>
<tt>287 (void)file;</tt><br>
<tt>288 #else</tt><br>
<tt>289 // first check that MPI is initialized. in builtin mode MPI will</tt><br>
<tt>290 // never be initialized and this reader will be unable to read files</tt><br>
<tt>291 // so we always return false in this case</tt><br>
<tt>292 int mpiOk=0;</tt><br>
<tt>293 MPI_Initialized(&mpiOk);</tt><br>
<tt>294 if (!mpiOk)</tt><br>
<tt>295 {</tt><br>
<tt>296 return 0;</tt><br>
<tt>297 }</tt><br>
<tt>298</tt><br>
<tt>299 // only rank 0 opens the file, this results in metadata</tt><br>
<tt>300 // being parsed. If the parsing of md is successful then</tt><br>
<tt>301 // the file is ours.</tt><br>
<tt>302 this->Reader->SetCommunicator(MPI_COMM_SELF);</tt><br>
<tt>303 status=this->Reader->Open(file);</tt><br>
<tt>304 this->Reader->Close();</tt><br>
<tt>305 #endif</tt><br>
<tt>306</tt><br>
<tt>307 return status;</tt><br>
<tt>308 }</tt></span><br>
<br>
Of course if ParaView is built without MPI then you should always return false. An even better solution is to structure your reader to work both with and without mpi. I know it's doable if you're using unidata netcdf ver 4, not so sure about pnetcdf...<br>
<br>
Burlen <br>
<br>
On 06/01/2013 08:15 AM, Michael Schlottke wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi, <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">for one of our own ParaView reader plugins we rely on Parallel NetCDF (pnetcdf) to do read in data in parallel, which in turn uses MPI to do the parallel I/O. Principally our reading algorithm works with any number of processes, including
one.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">At the moment, we always have to start a pvserver instance with MPI (i.e. mpiexec -n NN pvserver), start a normal client, and connect to the pvserver instance if we want to use the plugin - this also works for NN=1. However, when I start
the ParaView client, the plugin crashes because MPI was not loaded/started. Thus we always have to go through the extra steps of starting a pvserver if we want to use the plugin.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thus my question is whether there is a way to either start/load MPI manually from the plugin, or if it is possible to configure the client to automatically load and start the MPI library? Just enabling the Multi-Core option in the ParaView
settings does not seem to do the trick.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Michael<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">--<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">Michael Schlottke<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif""><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">SimLab Highly Scalable Fluids & Solids Engineering<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">Jülich Aachen Research Alliance (JARA-HPC)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">RWTH Aachen University<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">Wüllnerstraße 5a<br>
52062 Aachen<br>
Germany<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif""><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">Phone: +49 (241) 80 95188<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">Fax: +49 (241) 80 92257<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">Mail:
<a href="mailto:m.schlottke@aia.rwth-aachen.de">m.schlottke@aia.rwth-aachen.de</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif"">Web: <a href="http://www.jara.org/jara-hpc">http://www.jara.org/jara-hpc</a><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br>
<br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Paraview-developers mailing list<o:p></o:p></pre>
<pre><a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.org</a><o:p></o:p></pre>
<pre><a href="http://public.kitware.com/mailman/listinfo/paraview-developers">http://public.kitware.com/mailman/listinfo/paraview-developers</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>