vtkCPProcessor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCPProcessor.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14  =========================================================================*/
15 #ifndef vtkCPProcessor_h
16 #define vtkCPProcessor_h
17 
18 #include "vtkObject.h"
19 #include "vtkPVCatalystModule.h" // For windows import/export of shared libraries
20 
21 struct vtkCPProcessorInternals;
23 class vtkCPPipeline;
24 class vtkMPICommunicatorOpaqueComm;
26 class vtkSMSourceProxy;
27 
32 
59 {
60 public:
61  static vtkCPProcessor* New();
62  vtkTypeMacro(vtkCPProcessor, vtkObject);
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
67  virtual int AddPipeline(vtkCPPipeline* pipeline);
68 
70  virtual int GetNumberOfPipelines();
71 
73  virtual vtkCPPipeline* GetPipeline(int which);
74 
76  virtual void RemovePipeline(vtkCPPipeline* pipeline);
77  virtual void RemoveAllPipelines();
78 
79  // Controls cache size, in terms of timesteps, available for temporal
80  // data caching. Default is zero, which disables any caching.
81  virtual void SetTemporalCacheSize(int);
82  vtkGetMacro(TemporalCacheSize, int);
83 
84  // Accessor to specific temporal cache. Names match CPInputData names
85  virtual void MakeTemporalCache(const char* name);
86  virtual vtkSMSourceProxy* GetTemporalCache(const char* name);
87 
95  virtual int Initialize(const char* workingDirectory = nullptr);
96 #ifndef __WRAP__
97  virtual int Initialize(
98  vtkMPICommunicatorOpaqueComm& comm, const char* workingDirectory = nullptr);
99 #endif
100 
105  // adaptor inputs to pipeline sources.
106  static const char* GetInputArrayName() { return "__CatalystChannel__"; }
107 
115  virtual int RequestDataDescription(vtkCPDataDescription* dataDescription);
116 
120  virtual int CoProcess(vtkCPDataDescription* dataDescription);
121 
124  virtual int Finalize();
125 
131  vtkGetStringMacro(WorkingDirectory);
132 
133 protected:
134  vtkCPProcessor();
135  ~vtkCPProcessor() override;
136 
138  virtual vtkObject* NewInitializationHelper();
139 
143  vtkSetStringMacro(WorkingDirectory);
144 
148  void FinalizeAndRemovePipelines();
149 
150 private:
151  vtkCPProcessor(const vtkCPProcessor&) = delete;
152  void operator=(const vtkCPProcessor&) = delete;
153 
154  vtkCPProcessorInternals* Internal;
155  vtkObject* InitializationHelper;
156  static vtkMultiProcessController* Controller;
157  char* WorkingDirectory;
158  int TemporalCacheSize = 0;
159 };
160 
161 #endif
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
static const char * GetInputArrayName()
The Catalyst input field data string array name.
proxy for a VTK source on a server
#define VTKPVCATALYST_EXPORT
There are 3 distinct phases for the operation of a co-processor.
Generic interface for operating on pipelines.
Definition: vtkCPPipeline.h:29
static vtkObject * New()
void operator=(const vtkObjectBase &)
This class provides the description of the data for the coprocessor pipelines.