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

Function DistributedData

Filters/Parallel/Testing/Cxx/DistributedData.cxx:370–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370int 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}

Callers

nothing calls this directly

Calls 12

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

Tested by

no test coverage detected