| 602 | } |
| 603 | |
| 604 | int vtkGenerateStatistics::RequestData( |
| 605 | vtkInformation* vtkNotUsed(request), vtkInformationVector** input, vtkInformationVector* output) |
| 606 | { |
| 607 | vtkDataObject* dataObjIn = vtkDataObject::GetData(input[0], 0); |
| 608 | if (!dataObjIn) |
| 609 | { |
| 610 | // Silently ignore missing data. |
| 611 | return 1; |
| 612 | } |
| 613 | |
| 614 | int numArrays = this->GetNumberOfInputArraySpecifications(); |
| 615 | if (numArrays <= 0) |
| 616 | { |
| 617 | // If we have variables specified by the EnableAttributeArray API, |
| 618 | // use it to populate "SetInputArraysToProcess". |
| 619 | if (!this->P->Buffer.empty()) |
| 620 | { |
| 621 | this->P->AddBufferToRequests(); |
| 622 | } |
| 623 | int aa = 0; |
| 624 | for (const auto& request : this->P->Requests) |
| 625 | { |
| 626 | for (const auto& name : request) |
| 627 | { |
| 628 | this->SetInputArrayToProcess( |
| 629 | aa, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS, name.c_str()); |
| 630 | ++aa; |
| 631 | } |
| 632 | } |
| 633 | // Silently ignore empty requests. |
| 634 | numArrays = this->GetNumberOfInputArraySpecifications(); |
| 635 | if (numArrays <= 0) |
| 636 | { |
| 637 | return 1; |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | // Get output model data and sci-viz data. |
| 642 | auto* modelObjOu = vtkPartitionedDataSetCollection::GetData(output, 0); |
| 643 | if (!modelObjOu) |
| 644 | { |
| 645 | // Silently ignore missing data. |
| 646 | return 1; |
| 647 | } |
| 648 | |
| 649 | // TODO: Perform a "pre-run" stage to compute total number of samples across |
| 650 | // all blocks in all partitions on all ranks? If so, we should then |
| 651 | // have a target sample size on a per-leaf basis. This stage is only |
| 652 | // needed if users are allowed to specify a fixed sample size rather |
| 653 | // than a training *fraction*. |
| 654 | |
| 655 | int stat = this->RequestLocalDataDispatch(dataObjIn, modelObjOu); |
| 656 | |
| 657 | // The RequestLocalDataDispatch() above requires no communication and does |
| 658 | // all the local model aggregation possible. The remaining global model(s) |
| 659 | // then need to be collectively aggregated (in pairs of ranks with ⌈log₂(N)⌉ |
| 660 | // merges for N ranks) resulting in the final model aggregated on rank 0. |
| 661 | // The final model(s) should then be broadcast from rank 0 to all ranks so |
nothing calls this directly
no test coverage detected