vtkCPProcessor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkCPProcessor_h
4 #define vtkCPProcessor_h
5 
6 #include "vtkObject.h"
7 #include "vtkPVCatalystModule.h" // For windows import/export of shared libraries
8 
9 struct vtkCPProcessorInternals;
11 class vtkCPPipeline;
12 class vtkMPICommunicatorOpaqueComm;
14 class vtkSMSourceProxy;
15 
20 
47 {
48 public:
49  static vtkCPProcessor* New();
50  vtkTypeMacro(vtkCPProcessor, vtkObject);
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
55  virtual int AddPipeline(vtkCPPipeline* pipeline);
56 
58  virtual int GetNumberOfPipelines();
59 
61  virtual vtkCPPipeline* GetPipeline(int which);
62 
64  virtual void RemovePipeline(vtkCPPipeline* pipeline);
65  virtual void RemoveAllPipelines();
66 
67  // Controls cache size, in terms of timesteps, available for temporal
68  // data caching. Default is zero, which disables any caching.
69  virtual void SetTemporalCacheSize(int);
70  vtkGetMacro(TemporalCacheSize, int);
71 
72  // Accessor to specific temporal cache. Names match CPInputData names
73  virtual void MakeTemporalCache(const char* name);
74  virtual vtkSMSourceProxy* GetTemporalCache(const char* name);
75 
83  virtual int Initialize(const char* workingDirectory = nullptr);
84 #ifndef __WRAP__
85  virtual int Initialize(
86  vtkMPICommunicatorOpaqueComm& comm, const char* workingDirectory = nullptr);
87 #endif
88 
93  // adaptor inputs to pipeline sources.
94  static const char* GetInputArrayName() { return "__CatalystChannel__"; }
95 
103  virtual int RequestDataDescription(vtkCPDataDescription* dataDescription);
104 
108  virtual int CoProcess(vtkCPDataDescription* dataDescription);
109 
112  virtual int Finalize();
113 
119  vtkGetStringMacro(WorkingDirectory);
120 
121 protected:
122  vtkCPProcessor();
123  ~vtkCPProcessor() override;
124 
126  virtual vtkObject* NewInitializationHelper();
127 
131  vtkSetStringMacro(WorkingDirectory);
132 
136  void FinalizeAndRemovePipelines();
137 
138 private:
139  vtkCPProcessor(const vtkCPProcessor&) = delete;
140  void operator=(const vtkCPProcessor&) = delete;
141 
142  vtkCPProcessorInternals* Internal;
143  vtkObject* InitializationHelper;
144  static vtkMultiProcessController* Controller;
145  char* WorkingDirectory;
146  int TemporalCacheSize = 0;
147 };
148 
149 #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:17
static vtkObject * New()
void operator=(const vtkObjectBase &)
This class provides the description of the data for the coprocessor pipelines.