[Paraview-developers] ParaView plugins with MPI only on client

burlen burlen.loring at gmail.com
Sat Jun 1 13:19:27 EDT 2013


Hi Micheal,

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...

276 
//-----------------------------------------------------------------------------
277 int vtkSQBOVReaderBase::CanReadFile(const char *file)
278 {
279   #if defined SQTK_DEBUG
280   pCerr() << "=====vtkSQBOVReaderBase::CanReadFile" << endl;
281   pCerr() << "Check " << safeio(file) << "." << endl;
282   #endif
283
284   int status=0;
285
286   #ifdef SQTK_WITHOUT_MPI
287   (void)file;
288   #else
289   // first check that MPI is initialized. in builtin mode MPI will
290   // never be initialized and this reader will be unable to read files
291   // so we always return false in this case
292   int mpiOk=0;
293   MPI_Initialized(&mpiOk);
294   if (!mpiOk)
295     {
296     return 0;
297     }
298
299   // only rank 0 opens the file, this results in metadata
300   // being parsed. If the parsing of md is successful then
301   // the file is ours.
302   this->Reader->SetCommunicator(MPI_COMM_SELF);
303   status=this->Reader->Open(file);
304   this->Reader->Close();
305   #endif
306
307   return status;
308 }

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...

Burlen

On 06/01/2013 08:15 AM, Michael Schlottke wrote:
> Hi,
>
> 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.
>
> 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.
>
> 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.
>
> Regards,
>
> Michael
>
>
> --
> Michael Schlottke
>
> SimLab Highly Scalable Fluids & Solids Engineering
> Jülich Aachen Research Alliance (JARA-HPC)
> RWTH Aachen University
> Wüllnerstraße 5a
> 52062 Aachen
> Germany
>
> Phone: +49 (241) 80 95188
> Fax: +49 (241) 80 92257
> Mail: m.schlottke at aia.rwth-aachen.de 
> <mailto:m.schlottke at aia.rwth-aachen.de>
> Web: http://www.jara.org/jara-hpc
>
>
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20130601/27643f2e/attachment.htm>


More information about the Paraview-developers mailing list