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

Biddiscombe, John A. biddisco at cscs.ch
Mon Jun 3 07:05:05 EDT 2013


Burlen, Michael

Yes what you say is quite correct. All I meant was that even running the use-multicore option doesn't cause mpi init in the client, so any plugin code running on the client will be in trouble. The readers should be created on the servers, but the client still creates a bunch of stuff which might cause trouble if MPI code is in there.

Incidentally, this is my check code in my plugin. this is the bit which checks the controller and sets it approriately.

JB

//----------------------------------------------------------------------------
void vtkDsmManager::CheckMPIController()
{
  if (this->Controller->IsA("vtkDummyController"))
  {
    vtkDebugMacro("Running vtkDummyController : replacing it");
    int flag = 0;
    MPI_Initialized(&flag);
    if (flag == 0)
    {
      vtkDebugMacro("Running without MPI, attempting to initialize ");
      //int argc = 1;
      //const char *argv = "D:\\cmakebuild\\pv-shared\\bin\\RelWithDebInfo\\paraview.exe";
      //char **_argv = (char**) &argv;
      int provided, rank, size;
      MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
      MPI_Comm_rank(MPI_COMM_WORLD, &rank);
      MPI_Comm_size(MPI_COMM_WORLD, &size);
      //
      if (rank == 0) {
        if (provided != MPI_THREAD_MULTIPLE) {
          std::cout << "MPI_THREAD_MULTIPLE not set, you may need to recompile your "
            << "MPI distribution with threads enabled" << std::endl;
        }
        else {
          std::cout << "MPI_THREAD_MULTIPLE is OK (DSM override)" << std::endl;
        }
      }
    }
    //
    vtkDebugMacro("Setting Global MPI controller");
    vtkSmartPointer<vtkMPIController> controller = vtkSmartPointer<vtkMPIController>::New();
    if (flag == 0) controller->Initialize(NULL, NULL, 1);
    this->SetController(controller);
    vtkMPIController::SetGlobalController(controller);
  }
}



From: Burlen Loring [mailto:burlen.loring at gmail.com]
Sent: 02 June 2013 23:48
To: Biddiscombe, John A.
Cc: Michael Schlottke; ParaView Developers
Subject: Re: [Paraview-developers] ParaView plugins with MPI only on client

On 6/2/2013 1:15 PM, Biddiscombe, John A. wrote:
The reason that the multi-core option doesn't work is because all it does is internally spawn N pvservers and connect to them silently - the client is still a serial process without mpi enabled or initted (is that a word?).
John, I think you're wrong about that. here's why: when paraview is running in client server mode, via its internal multicore startup or otherwise, the reader is constructed on the pvserver not on the client. and in the these cases pvserver has mpi initted... this is not to say that you wont crash the client if you're not careful about making mpi calls in client only mode when mpi is not initted. so you'd need to avoid mpi calls when mpi is not initted if you want your reader to place nice with standard pv ... I guess in your case you need the threaded mpi init too... don't forget to load your plugin...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20130603/1a20e58d/attachment-0001.htm>


More information about the Paraview-developers mailing list