Servers/ServerManager/vtkSMUtilities.cxx
int vtkSMUtilities::SaveImageOnProcessZero(vtkImageData* image,
                   const char* filename, const char* writerName)
{
  int error_code;
  vtkMultiProcessController *controller =
    vtkMultiProcessController::GetGlobalController();

  if (controller)
    {
    if (controller->GetLocalProcessId() == 0)
      {
      error_code = SaveImage(image, filename, writerName);
      }
    controller->Broadcast(&error_code, 1, 0);
    }
  else
    {
    error_code = SaveImage(image, filename, writerName);
    }

  return error_code;
}
//----------------------------------------------------------------------------
// This is usually called on a serial client, but if it is called in
// a parallel job (for example, while coprocessing for a solver), then
// we really only want to write out an image on process 0.
This is usually called on a serial client, but if it is called in
a parallel job (for example, while coprocessing for a solver), then
we really only want to write out an image on process 0.
This is usually called on a serial client but if it is called in a parallel job ( for example while coprocessing for a solver ) then we really only want to write out an image on process 0 .
int vtkSMUtilities::SaveImageOnProcessZero(vtkImageData* image,
                   const char* filename, const char* writerName)
{
  int error_code;
  vtkMultiProcessController *controller =
    vtkMultiProcessController::GetGlobalController();
  if (controller)
    {
    if (controller->GetLocalProcessId() == 0)
      {
      error_code = SaveImage(image, filename, writerName);
      }
    controller->Broadcast(&error_code, 1, 0);
    }
  else
    {
    error_code = SaveImage(image, filename, writerName);
    }
  return error_code;
}
int vtkSMUtilities :: SaveImageOnProcessZero ( vtkImageData * image , const char * filename , const char * writerName ) { int error_code ; vtkMultiProcessController * controller = vtkMultiProcessController :: GetGlobalController ( ) ; if ( controller ) { if ( controller -> GetLocalProcessId ( ) == 0 ) { error_code = SaveImage ( image , filename , writerName ) ; } controller -> Broadcast ( & error_code , 1 , 0 ) ; } else { error_code = SaveImage ( image , filename , writerName ) ; } return error_code ; }
This is usually called on a serial client, but if it is called in
a parallel job (for example, while coprocessing for a solver), then
we really only want to write out an image on process 0.
This is usually called on a serial client but if it is called in a parallel job ( for example while coprocessing for a solver ) then we really only want to write out an image on process 0 .