<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">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>276
//-----------------------------------------------------------------------------</tt><tt><br>
      </tt><tt>277 int vtkSQBOVReaderBase::CanReadFile(const char *file)</tt><tt><br>
      </tt><tt>278 {</tt><tt><br>
      </tt><tt>279&nbsp;&nbsp; #if defined SQTK_DEBUG</tt><tt><br>
      </tt><tt>280&nbsp;&nbsp; pCerr() &lt;&lt;
        "=====vtkSQBOVReaderBase::CanReadFile" &lt;&lt; endl;</tt><tt><br>
      </tt><tt>281&nbsp;&nbsp; pCerr() &lt;&lt; "Check " &lt;&lt; safeio(file)
        &lt;&lt; "." &lt;&lt; endl;</tt><tt><br>
      </tt><tt>282&nbsp;&nbsp; #endif</tt><tt><br>
      </tt><tt>283</tt><tt><br>
      </tt><tt>284&nbsp;&nbsp; int status=0;</tt><tt><br>
      </tt><tt>285</tt><tt><br>
      </tt><tt>286&nbsp;&nbsp; #ifdef SQTK_WITHOUT_MPI</tt><tt><br>
      </tt><tt>287&nbsp;&nbsp; (void)file;</tt><tt><br>
      </tt><tt>288&nbsp;&nbsp; #else</tt><tt><br>
      </tt><tt>289&nbsp;&nbsp; // first check that MPI is initialized. in builtin
        mode MPI will</tt><tt><br>
      </tt><tt>290&nbsp;&nbsp; // never be initialized and this reader will be
        unable to read files</tt><tt><br>
      </tt><tt>291&nbsp;&nbsp; // so we always return false in this case</tt><tt><br>
      </tt><tt>292&nbsp;&nbsp; int mpiOk=0;</tt><tt><br>
      </tt><tt>293&nbsp;&nbsp; MPI_Initialized(&amp;mpiOk);</tt><tt><br>
      </tt><tt>294&nbsp;&nbsp; if (!mpiOk)</tt><tt><br>
      </tt><tt>295&nbsp;&nbsp;&nbsp;&nbsp; {</tt><tt><br>
      </tt><tt>296&nbsp;&nbsp;&nbsp;&nbsp; return 0;</tt><tt><br>
      </tt><tt>297&nbsp;&nbsp;&nbsp;&nbsp; }</tt><tt><br>
      </tt><tt>298</tt><tt><br>
      </tt><tt>299&nbsp;&nbsp; // only rank 0 opens the file, this results in
        metadata</tt><tt><br>
      </tt><tt>300&nbsp;&nbsp; // being parsed. If the parsing of md is successful
        then</tt><tt><br>
      </tt><tt>301&nbsp;&nbsp; // the file is ours.</tt><tt><br>
      </tt><tt>302&nbsp;&nbsp; this-&gt;Reader-&gt;SetCommunicator(MPI_COMM_SELF);</tt><tt><br>
      </tt><tt>303&nbsp;&nbsp; status=this-&gt;Reader-&gt;Open(file);</tt><tt><br>
      </tt><tt>304&nbsp;&nbsp; this-&gt;Reader-&gt;Close();</tt><tt><br>
      </tt><tt>305&nbsp;&nbsp; #endif</tt><tt><br>
      </tt><tt>306</tt><tt><br>
      </tt><tt>307&nbsp;&nbsp; return status;</tt><tt><br>
      </tt><tt>308 }</tt><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:<br>
    </div>
    <blockquote
      cite="mid:1559EA7C-08BA-4C1D-AA73-5ED304C26106@aia.rwth-aachen.de"
      type="cite">Hi,
      <div><br>
      </div>
      <div>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.</div>
      <div><br>
      </div>
      <div>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.</div>
      <div><br>
      </div>
      <div>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.</div>
      <div><br>
      </div>
      <div>Regards,</div>
      <div><br>
      </div>
      <div>Michael</div>
      <br>
      <br>
      <div apple-content-edited="true">
        <span class="Apple-style-span" style="border-collapse: separate;
          color: rgb(0, 0, 0); font-family: Helvetica; font-style:
          normal; font-variant: normal; font-weight: normal;
          letter-spacing: normal; line-height: normal; orphans: 2;
          text-align: -webkit-auto; text-indent: 0px; text-transform:
          none; white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-border-horizontal-spacing: 0px;
          -webkit-border-vertical-spacing: 0px;
          -webkit-text-decorations-in-effect: none;
          -webkit-text-size-adjust: auto; -webkit-text-stroke-width:
          0px; font-size: medium; "><span class="Apple-style-span"
            style="border-collapse: separate; color: rgb(0, 0, 0);
            font-family: Helvetica; font-style: normal; font-variant:
            normal; font-weight: normal; letter-spacing: normal;
            line-height: normal; orphans: 2; text-align: -webkit-auto;
            text-indent: 0px; text-transform: none; white-space: normal;
            widows: 2; word-spacing: 0px;
            -webkit-border-horizontal-spacing: 0px;
            -webkit-border-vertical-spacing: 0px;
            -webkit-text-decorations-in-effect: none;
            -webkit-text-size-adjust: auto; -webkit-text-stroke-width:
            0px; font-size: medium; ">
            <div style="word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space; "><span
                class="Apple-style-span" style="border-collapse:
                separate; color: rgb(0, 0, 0); font-family: Helvetica;
                font-style: normal; font-variant: normal; font-weight:
                normal; letter-spacing: normal; line-height: normal;
                orphans: 2; text-align: -webkit-auto; text-indent: 0px;
                text-transform: none; white-space: normal; widows: 2;
                word-spacing: 0px; -webkit-border-horizontal-spacing:
                0px; -webkit-border-vertical-spacing: 0px;
                -webkit-text-decorations-in-effect: none;
                -webkit-text-size-adjust: auto;
                -webkit-text-stroke-width: 0px; font-size: medium; ">
                <div style="word-wrap: break-word; -webkit-nbsp-mode:
                  space; -webkit-line-break: after-white-space; "><span
                    class="Apple-style-span" style="border-collapse:
                    separate; color: rgb(0, 0, 0); font-family:
                    Helvetica; font-style: normal; font-variant: normal;
                    font-weight: normal; letter-spacing: normal;
                    line-height: normal; orphans: 2; text-align:
                    -webkit-auto; text-indent: 0px; text-transform:
                    none; white-space: normal; widows: 2; word-spacing:
                    0px; -webkit-border-horizontal-spacing: 0px;
                    -webkit-border-vertical-spacing: 0px;
                    -webkit-text-decorations-in-effect: none;
                    -webkit-text-size-adjust: auto;
                    -webkit-text-stroke-width: 0px; font-size: medium; ">
                    <div style="word-wrap: break-word;
                      -webkit-nbsp-mode: space; -webkit-line-break:
                      after-white-space; "><span
                        class="Apple-style-span" style="border-collapse:
                        separate; color: rgb(0, 0, 0); font-family:
                        Helvetica; font-style: normal; font-variant:
                        normal; font-weight: normal; letter-spacing:
                        normal; line-height: normal; orphans: 2;
                        text-align: -webkit-auto; text-indent: 0px;
                        text-transform: none; white-space: normal;
                        widows: 2; word-spacing: 0px;
                        -webkit-border-horizontal-spacing: 0px;
                        -webkit-border-vertical-spacing: 0px;
                        -webkit-text-decorations-in-effect: none;
                        -webkit-text-size-adjust: auto;
                        -webkit-text-stroke-width: 0px; font-size:
                        medium; ">
                        <div style="word-wrap: break-word;
                          -webkit-nbsp-mode: space; -webkit-line-break:
                          after-white-space; "><span
                            class="Apple-style-span"
                            style="border-collapse: separate; color:
                            rgb(0, 0, 0); font-family: Helvetica;
                            font-style: normal; font-variant: normal;
                            font-weight: normal; letter-spacing: normal;
                            line-height: normal; orphans: 2; text-align:
                            -webkit-auto; text-indent: 0px;
                            text-transform: none; white-space: normal;
                            widows: 2; word-spacing: 0px;
                            -webkit-border-horizontal-spacing: 0px;
                            -webkit-border-vertical-spacing: 0px;
                            -webkit-text-decorations-in-effect: none;
                            -webkit-text-size-adjust: auto;
                            -webkit-text-stroke-width: 0px; font-size:
                            medium; ">
                            <div style="word-wrap: break-word;
                              -webkit-nbsp-mode: space;
                              -webkit-line-break: after-white-space; "><span
                                class="Apple-style-span"
                                style="border-collapse: separate; color:
                                rgb(0, 0, 0); font-family: Helvetica;
                                font-style: normal; font-variant:
                                normal; font-weight: normal;
                                letter-spacing: normal; line-height:
                                normal; orphans: 2; text-align:
                                -webkit-auto; text-indent: 0px;
                                text-transform: none; white-space:
                                normal; widows: 2; word-spacing: 0px;
                                -webkit-border-horizontal-spacing: 0px;
                                -webkit-border-vertical-spacing: 0px;
                                -webkit-text-decorations-in-effect:
                                none; -webkit-text-size-adjust: auto;
                                -webkit-text-stroke-width: 0px;
                                font-size: medium; ">
                                <div style="word-wrap: break-word;
                                  -webkit-nbsp-mode: space;
                                  -webkit-line-break: after-white-space;
                                  "><span class="Apple-style-span"
                                    style="border-collapse: separate;
                                    color: rgb(0, 0, 0); font-family:
                                    Helvetica; font-style: normal;
                                    font-variant: normal; font-weight:
                                    normal; letter-spacing: normal;
                                    line-height: normal; orphans: 2;
                                    text-align: -webkit-auto;
                                    text-indent: 0px; text-transform:
                                    none; white-space: normal; widows:
                                    2; word-spacing: 0px;
                                    -webkit-border-horizontal-spacing:
                                    0px;
                                    -webkit-border-vertical-spacing:
                                    0px;
                                    -webkit-text-decorations-in-effect:
                                    none; -webkit-text-size-adjust:
                                    auto; -webkit-text-stroke-width:
                                    0px; font-size: medium; ">
                                    <div style="word-wrap: break-word;
                                      -webkit-nbsp-mode: space;
                                      -webkit-line-break:
                                      after-white-space; "><span
                                        class="Apple-style-span"
                                        style="border-collapse:
                                        separate; color: rgb(0, 0, 0);
                                        font-family: Helvetica;
                                        font-style: normal;
                                        font-variant: normal;
                                        font-weight: normal;
                                        letter-spacing: normal;
                                        line-height: normal; orphans: 2;
                                        text-align: -webkit-auto;
                                        text-indent: 0px;
                                        text-transform: none;
                                        white-space: normal; widows: 2;
                                        word-spacing: 0px;
                                        -webkit-border-horizontal-spacing:
                                        0px;
                                        -webkit-border-vertical-spacing:
                                        0px;
                                        -webkit-text-decorations-in-effect:
                                        none; -webkit-text-size-adjust:
                                        auto; -webkit-text-stroke-width:
                                        0px; font-size: medium; ">
                                        <div style="word-wrap:
                                          break-word; -webkit-nbsp-mode:
                                          space; -webkit-line-break:
                                          after-white-space; "><span
                                            class="Apple-style-span"
                                            style="border-collapse:
                                            separate; color: rgb(0, 0,
                                            0); font-family: Helvetica;
                                            font-style: normal;
                                            font-variant: normal;
                                            font-weight: normal;
                                            letter-spacing: normal;
                                            line-height: normal;
                                            orphans: 2; text-align:
                                            -webkit-auto; text-indent:
                                            0px; text-transform: none;
                                            white-space: normal; widows:
                                            2; word-spacing: 0px;
                                            -webkit-border-horizontal-spacing:
                                            0px;
                                            -webkit-border-vertical-spacing:
                                            0px;
                                            -webkit-text-decorations-in-effect:
                                            none;
                                            -webkit-text-size-adjust:
                                            auto;
                                            -webkit-text-stroke-width:
                                            0px; font-size: medium; ">
                                            <div style="word-wrap:
                                              break-word;
                                              -webkit-nbsp-mode: space;
                                              -webkit-line-break:
                                              after-white-space; "><span
                                                class="Apple-style-span"
                                                style="border-collapse:
                                                separate; color: rgb(0,
                                                0, 0); font-family:
                                                Helvetica; font-style:
                                                normal; font-variant:
                                                normal; font-weight:
                                                normal; letter-spacing:
                                                normal; line-height:
                                                normal; orphans: 2;
                                                text-align:
                                                -webkit-auto;
                                                text-indent: 0px;
                                                text-transform: none;
                                                white-space: normal;
                                                widows: 2; word-spacing:
                                                0px;
                                                -webkit-border-horizontal-spacing:
                                                0px;
                                                -webkit-border-vertical-spacing:
                                                0px;
                                                -webkit-text-decorations-in-effect:
                                                none;
                                                -webkit-text-size-adjust:
                                                auto;
                                                -webkit-text-stroke-width:
                                                0px; font-size: medium;
                                                ">
                                                <div style="word-wrap:
                                                  break-word;
                                                  -webkit-nbsp-mode:
                                                  space;
                                                  -webkit-line-break:
                                                  after-white-space; ">
                                                  <div>--</div>
                                                  <div>Michael Schlottke</div>
                                                  <div><br>
                                                  </div>
                                                  <div>SimLab Highly
                                                    Scalable Fluids
                                                    &amp; Solids
                                                    Engineering</div>
                                                  <div>J&uuml;lich Aachen
                                                    Research Alliance
                                                    (JARA-HPC)</div>
                                                  <div>RWTH Aachen
                                                    University</div>
                                                  <div>W&uuml;llnerstra&szlig;e 5a<br>
                                                    52062 Aachen<br>
                                                    Germany</div>
                                                  <div><br>
                                                  </div>
                                                  <div>Phone: +49 (241)
                                                    80 95188</div>
                                                  <div>Fax: +49 (241) 80
                                                    92257</div>
                                                  <div>Mail: <a
                                                      moz-do-not-send="true"
href="mailto:m.schlottke@aia.rwth-aachen.de">m.schlottke@aia.rwth-aachen.de</a></div>
                                                  <div>Web:&nbsp;<a
                                                      moz-do-not-send="true"
href="http://www.jara.org/jara-hpc">http://www.jara.org/jara-hpc</a></div>
                                                </div>
                                              </span></div>
                                          </span></div>
                                      </span></div>
                                  </span></div>
                              </span></div>
                          </span></div>
                      </span></div>
                  </span></div>
              </span></div>
          </span></span>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Paraview-developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.org</a>
<a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/paraview-developers">http://public.kitware.com/mailman/listinfo/paraview-developers</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>