| 368 | } |
| 369 | |
| 370 | int DistributedData(int argc, char* argv[]) |
| 371 | { |
| 372 | int retVal = 1; |
| 373 | |
| 374 | vtkMPIController* contr = vtkMPIController::New(); |
| 375 | contr->Initialize(&argc, &argv); |
| 376 | |
| 377 | vtkMultiProcessController::SetGlobalController(contr); |
| 378 | |
| 379 | int numProcs = contr->GetNumberOfProcesses(); |
| 380 | int me = contr->GetLocalProcessId(); |
| 381 | |
| 382 | if (numProcs != 2) |
| 383 | { |
| 384 | if (me == 0) |
| 385 | { |
| 386 | std::cout << "DistributedData test requires 2 processes" << std::endl; |
| 387 | } |
| 388 | contr->Delete(); |
| 389 | return retVal; |
| 390 | } |
| 391 | |
| 392 | if (!contr->IsA("vtkMPIController")) |
| 393 | { |
| 394 | if (me == 0) |
| 395 | { |
| 396 | std::cout << "DistributedData test requires MPI" << std::endl; |
| 397 | } |
| 398 | contr->Delete(); |
| 399 | return retVal; // is this the right error val? TODO |
| 400 | } |
| 401 | |
| 402 | MyProcess* p = MyProcess::New(); |
| 403 | p->SetArgs(argc, argv); |
| 404 | contr->SetSingleProcessObject(p); |
| 405 | contr->SingleMethodExecute(); |
| 406 | |
| 407 | retVal = p->GetReturnValue(); |
| 408 | p->Delete(); |
| 409 | |
| 410 | // test special case 'numCells < numProcs' |
| 411 | vtkNew<MyProcess2> p2; |
| 412 | p2->SetArgs(argc, argv); |
| 413 | contr->SetSingleProcessObject(p2.Get()); |
| 414 | contr->SingleMethodExecute(); |
| 415 | if (retVal == vtkTesting::PASSED) |
| 416 | { |
| 417 | retVal = p2->GetReturnValue(); |
| 418 | } |
| 419 | |
| 420 | contr->Finalize(); |
| 421 | contr->Delete(); |
| 422 | |
| 423 | return !retVal; |
| 424 | } |
nothing calls this directly
no test coverage detected