MCPcopy Create free account
hub / github.com/Kitware/VTK / PTextureMapToSphere

Function PTextureMapToSphere

Filters/Parallel/Testing/Cxx/PTextureMapToSphere.cxx:148–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148int PTextureMapToSphere(int argc, char* argv[])
149{
150 // This is here to avoid false leak messages from vtkDebugLeaks when
151 // using mpich. It appears that the root process which spawns all the
152 // main processes waits in MPI_Init() and calls exit() when
153 // the others are done, causing apparent memory leaks for any objects
154 // created before MPI_Init().
155 MPI_Init(&argc, &argv);
156
157 // Note that this will create a vtkMPIController if MPI
158 // is configured, vtkThreadedController otherwise.
159 vtkNew<vtkMPIController> contr;
160 contr->Initialize(&argc, &argv, 1);
161
162 int retVal = 1;
163
164 vtkMultiProcessController::SetGlobalController(contr);
165
166 int me = contr->GetLocalProcessId();
167
168 if (!contr->IsA("vtkMPIController"))
169 {
170 if (me == 0)
171 {
172 std::cout << "DistributedData test requires MPI" << std::endl;
173 }
174 return retVal; // is this the right error val? TODO
175 }
176
177 vtkNew<MyProcess> p;
178 p->SetArgs(argc, argv);
179 contr->SetSingleProcessObject(p);
180 contr->SingleMethodExecute();
181
182 retVal = p->GetReturnValue();
183
184 contr->Finalize();
185
186 return !retVal;
187}

Callers

nothing calls this directly

Calls 8

IsAMethod · 0.80
GetReturnValueMethod · 0.80
InitializeMethod · 0.45
GetLocalProcessIdMethod · 0.45
SetArgsMethod · 0.45
SingleMethodExecuteMethod · 0.45
FinalizeMethod · 0.45

Tested by

no test coverage detected