------------------------------------------------------------------------------
| 452 | |
| 453 | //------------------------------------------------------------------------------ |
| 454 | bool vtkPContingencyStatistics::Broadcast(vtkIdType xySizeTotal, vtkStdString& xyPacked, |
| 455 | std::vector<vtkStdString>& xyValues, vtkIdType kcSizeTotal, std::vector<vtkIdType>& kcValues, |
| 456 | vtkIdType rProc) |
| 457 | { |
| 458 | vtkCommunicator* com = this->Controller->GetCommunicator(); |
| 459 | |
| 460 | // Broadcast the xy and kc buffer sizes |
| 461 | if (!com->Broadcast(&xySizeTotal, 1, rProc)) |
| 462 | { |
| 463 | vtkErrorMacro( |
| 464 | "Process " << com->GetLocalProcessId() << " could not broadcast (x,y) buffer size."); |
| 465 | |
| 466 | return true; |
| 467 | } |
| 468 | |
| 469 | if (!com->Broadcast(&kcSizeTotal, 1, rProc)) |
| 470 | { |
| 471 | vtkErrorMacro( |
| 472 | "Process " << com->GetLocalProcessId() << " could not broadcast (k,c) buffer size."); |
| 473 | |
| 474 | return true; |
| 475 | } |
| 476 | |
| 477 | // Resize vectors so they can receive the broadcasted xy and kc values |
| 478 | xyPacked.resize(xySizeTotal); |
| 479 | kcValues.resize(kcSizeTotal); |
| 480 | |
| 481 | // Broadcast the contents of contingency table to everyone |
| 482 | if (!com->Broadcast(&(*xyPacked.begin()), xySizeTotal, rProc)) |
| 483 | { |
| 484 | vtkErrorMacro("Process " << com->GetLocalProcessId() << " could not broadcast (x,y) values."); |
| 485 | |
| 486 | return true; |
| 487 | } |
| 488 | |
| 489 | if (!com->Broadcast(&(*kcValues.begin()), kcSizeTotal, rProc)) |
| 490 | { |
| 491 | vtkErrorMacro("Process " << com->GetLocalProcessId() << " could not broadcast (k,c) values."); |
| 492 | |
| 493 | return true; |
| 494 | } |
| 495 | |
| 496 | // Unpack the packet of strings |
| 497 | StringBufferToStringVector(xyPacked, xyValues); |
| 498 | |
| 499 | return false; |
| 500 | } |
| 501 | VTK_ABI_NAMESPACE_END |
no test coverage detected