------------------------------------------------------------------------------
| 538 | |
| 539 | //------------------------------------------------------------------------------ |
| 540 | bool vtkADIOS2CoreImageReader::InitWorkDistribution() |
| 541 | { |
| 542 | try |
| 543 | { |
| 544 | // Determine the blocks that need to be read for the current rank |
| 545 | auto iter = this->Impl->InquiredVars.find(this->DimensionArray); |
| 546 | if (iter == this->Impl->InquiredVars.end()) |
| 547 | { |
| 548 | vtkErrorMacro( |
| 549 | "Dimension Array (" << this->DimensionArray << ") must be one of the loaded arrays."); |
| 550 | return false; |
| 551 | } |
| 552 | std::string varName = iter->first; |
| 553 | std::string typeStr = this->FetchTypeStringFromVarName(varName); |
| 554 | if (typeStr.empty()) |
| 555 | { |
| 556 | vtkErrorMacro("Cannot find a type for " << varName << " invalid name is provided"); |
| 557 | return false; |
| 558 | } |
| 559 | // FIXME: adios2 IO object returns an template dependent class instance instead of |
| 560 | // a pointer or template independent object. Without using std::variant, |
| 561 | // if statements are used to overcome the limitation |
| 562 | // Use the adios_types_map in adios2 code base to generate types |
| 563 | if (typeStr == "string") |
| 564 | { |
| 565 | this->CalculateWorkDistribution<std::string>(varName); |
| 566 | } |
| 567 | else if (typeStr == "int8_t") |
| 568 | { |
| 569 | this->CalculateWorkDistribution<int8_t>(varName); |
| 570 | } |
| 571 | else if (typeStr == "uint8_t") |
| 572 | { |
| 573 | this->CalculateWorkDistribution<uint8_t>(varName); |
| 574 | } |
| 575 | else if (typeStr == "int16_t") |
| 576 | { |
| 577 | this->CalculateWorkDistribution<int16_t>(varName); |
| 578 | } |
| 579 | else if (typeStr == "uint16_t") |
| 580 | { |
| 581 | this->CalculateWorkDistribution<uint16_t>(varName); |
| 582 | } |
| 583 | else if (typeStr == "int32_t") |
| 584 | { |
| 585 | this->CalculateWorkDistribution<int32_t>(varName); |
| 586 | } |
| 587 | else if (typeStr == "uint32_t") |
| 588 | { |
| 589 | this->CalculateWorkDistribution<uint32_t>(varName); |
| 590 | } |
| 591 | else if (typeStr == "int64_t") |
| 592 | { |
| 593 | this->CalculateWorkDistribution<int64_t>(varName); |
| 594 | } |
| 595 | else if (typeStr == "uint64_t") |
| 596 | { |
| 597 | this->CalculateWorkDistribution<uint64_t>(varName); |
no test coverage detected