<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">
      <blockquote type="cite">@Burlen: Starting paraview with mpiexec
        doesn't work either (I think the client is inherently a serial
        application, so mpiexec -n 2 will just start the client twice).</blockquote>
      my comments about portability , potentially needing to start
      paraview client with mpiexec, etc only applies if you go with
      Johns patch....<br>
      <br>
      <blockquote type="cite"> And I double checked: "Use Multi-Core" is
        enabled and the number of cores is set to 2, but doing an
        MPI_Initialized(isInit); in my plugin still yields the result
        that MPI was in fact NOT initialized yet.</blockquote>
      in that case I think that something's wrong with your
      build/install, because that's not at all the behavior I see...  
      you saw the snippet of code that my reader uses, and it works with
      the multicore option.  Which version of ParaView are you using?
      Which OS? I tested multicore  with my mpi only reader with 3.98.1 
      and git master from a couple days ago on linux.  <br>
      <br>
      <blockquote type="cite">I tried starting MPI in the constructor of
        the plugin, but that is not a good idea since the constructor is
        called multiple times. Also, if ParaView should (legitimately)
        try to start MPI afterwards, it will crash since MPI was already
        started. </blockquote>
      Exactly. So don't go that route.<br>
      <br>
      <blockquote type="cite">Argh, it seems like I will have to
        implement both I/O libraries to get around this…</blockquote>
      ...the multicore option should work...you may want to figure out
      why it's not working for you before you rewrite...<br>
      <br>
      <br>
      On 6/2/2013 11:09 AM, Michael Schlottke wrote:<br>
    </div>
    <blockquote
      cite="mid:2CF817AF-AE9E-4EB8-925F-322C883F5E74@aia.rwth-aachen.de"
      type="cite">
      <div>@John: Indeed, portability is an issue, so there's no way I
        can compile ParaView for all users with a custom source code
        patch :-/ Thanks for your idea, though, if it was just for me,
        I'd probably go this way and be done with it.</div>
      <div><br>
      </div>
      <div>@Burlen: Starting paraview with mpiexec doesn't work either
        (I think the client is inherently a serial application, so
        mpiexec -n 2 will just start the client twice). And I double
        checked: "Use Multi-Core" is enabled and the number of cores is
        set to 2, but doing an MPI_Initialized(isInit); in my plugin
        still yields the result that MPI was in fact NOT initialized
        yet.</div>
      <div><br>
      </div>
      <div>I tried starting MPI in the constructor of the plugin, but
        that is not a good idea since the constructor is called multiple
        times. Also, if ParaView should (legitimately) try to start MPI
        afterwards, it will crash since MPI was already started. Argh,
        it seems like I will have to implement both I/O libraries to get
        around this…</div>
      <div><br>
      </div>
      <div>Michael</div>
      <div><br>
        <div>
          <div>On Jun 2, 2013, at 09:30 , burlen wrote:</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <meta content="text/html; charset=windows-1252"
              http-equiv="Content-Type">
            <div bgcolor="#FFFFFF" text="#000000">
              <div class="moz-cite-prefix">that could be a fine solution
                if you're not overly concerned about portability. if you
                did that then you might have to use mpiexec(or whatever
                launcher) to start the paraview client. (but mpich and
                openmpi seem to be fine without mpiexec for 1 process
                runs...ymmv) you'd also be prevented from running the
                client on login nodes at certain hpc sites.<br>
                <br>
                but wait a second...<br>
                <blockquote type="cite"> Just enabling the Multi-Core
                  option in the ParaView settings does not seem to do
                  the trick.</blockquote>
                I think that this should work. at least my reader which
                can't run without mpi works with it. Is this a recent
                version of ParaVIew? Are you sure you tried on an mpi
                endowed build? Once you check the multicore setting you
                need to restart paraview.<br>
                <br>
                <br>
                On 06/01/2013 03:20 PM, Biddiscombe, John A. wrote:<br>
              </div>
              <blockquote
                cite="mid:50320452A334BD42A5EC72BAD2145099085DD335@MBX10.d.ethz.ch"
                type="cite">
                <meta http-equiv="Content-Type" content="text/html;
                  charset=windows-1252">
                <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]-->
                <div class="WordSection1">
                  <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
                  <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-US"><a
                        moz-do-not-send="true"
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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
                  <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
                  <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
                  <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;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
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:windowtext"
                            lang="EN-US">From:</span></b><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:windowtext"
                          lang="EN-US"> <a moz-do-not-send="true"
                            class="moz-txt-link-abbreviated"
                            href="mailto:paraview-developers-bounces@paraview.org">paraview-developers-bounces@paraview.org</a>
                          [<a moz-do-not-send="true"
                            class="moz-txt-link-freetext"
                            href="mailto:paraview-developers-bounces@paraview.org">mailto:paraview-developers-bounces@paraview.org</a>]
                          <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:&quot;Courier

                        New&quot;"><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() &lt;&lt;
                          "=====vtkSQBOVReaderBase::CanReadFile"
                          &lt;&lt; endl;</tt><br>
                        <tt>281   pCerr() &lt;&lt; "Check " &lt;&lt;
                          safeio(file) &lt;&lt; "." &lt;&lt; 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(&amp;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-&gt;Reader-&gt;SetCommunicator(MPI_COMM_SELF);</tt><br>
                        <tt>303   status=this-&gt;Reader-&gt;Open(file);</tt><br>
                        <tt>304   this-&gt;Reader-&gt;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:&quot;Helvetica&quot;,&quot;sans-serif&quot;">--<o:p></o:p></span></p>
                                          </div>
                                          <div>
                                            <p class="MsoNormal"><span
style="font-size:13.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;">Michael

                                                Schlottke<o:p></o:p></span></p>
                                          </div>
                                          <div>
                                            <p class="MsoNormal"><span
style="font-size:13.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;"><o:p> </o:p></span></p>
                                          </div>
                                          <div>
                                            <p class="MsoNormal"><span
style="font-size:13.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;">SimLab

                                                Highly Scalable Fluids
                                                &amp; Solids Engineering<o:p></o:p></span></p>
                                          </div>
                                          <div>
                                            <p class="MsoNormal"><span
style="font-size:13.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;">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:&quot;Helvetica&quot;,&quot;sans-serif&quot;">RWTH

                                                Aachen University<o:p></o:p></span></p>
                                          </div>
                                          <div>
                                            <p class="MsoNormal"><span
style="font-size:13.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;">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:&quot;Helvetica&quot;,&quot;sans-serif&quot;"><o:p> </o:p></span></p>
                                          </div>
                                          <div>
                                            <p class="MsoNormal"><span
style="font-size:13.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;">Phone:

                                                +49 (241) 80 95188<o:p></o:p></span></p>
                                          </div>
                                          <div>
                                            <p class="MsoNormal"><span
style="font-size:13.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;">Fax:

                                                +49 (241) 80 92257<o:p></o:p></span></p>
                                          </div>
                                          <div>
                                            <p class="MsoNormal"><span
style="font-size:13.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;">Mail:

                                                <a
                                                  moz-do-not-send="true"
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:&quot;Helvetica&quot;,&quot;sans-serif&quot;">Web: <a
                                                  moz-do-not-send="true"
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 moz-do-not-send="true" href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.org</a><o:p></o:p></pre>
                    <pre><a moz-do-not-send="true" 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>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>