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

Function ParallelResampling

Filters/Parallel/Testing/Cxx/ParallelResampling.cxx:134–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 10

IsAMethod · 0.80
GetReturnValueMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
InitializeMethod · 0.45
GetLocalProcessIdMethod · 0.45
SetArgsMethod · 0.45
SingleMethodExecuteMethod · 0.45
FinalizeMethod · 0.45

Tested by

no test coverage detected