| 146 | } |
| 147 | |
| 148 | int 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 | } |
nothing calls this directly
no test coverage detected