| 587 | } |
| 588 | |
| 589 | void Conductor::computeHeatMap(ExecID eid, std::vector<NodeID> ns) |
| 590 | { |
| 591 | |
| 592 | auto it = exec_meta_.find(eid); |
| 593 | |
| 594 | if (it == exec_meta_.end()) |
| 595 | { |
| 596 | print("No metadata for eid {} (ExecMeta)", eid); |
| 597 | return; |
| 598 | } |
| 599 | |
| 600 | /// check if namemap is there |
| 601 | const auto nm = it->second.name_map; |
| 602 | |
| 603 | if (!nm) |
| 604 | { |
| 605 | print("no name map for eid: {}", eid); |
| 606 | return; |
| 607 | } |
| 608 | |
| 609 | const auto exec = executions_.at(eid); |
| 610 | |
| 611 | const auto &sd = exec->solver_data(); |
| 612 | |
| 613 | std::unordered_map<int, int> con_counts; |
| 614 | |
| 615 | for (const auto& n : ns) |
| 616 | { |
| 617 | const auto *cs = sd.getContribConstraints(n); |
| 618 | |
| 619 | if (!cs) |
| 620 | continue; |
| 621 | |
| 622 | for (int con_id : *cs) |
| 623 | { |
| 624 | con_counts[con_id]++; |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | int max_count = 0; |
| 629 | for (const auto& p : con_counts) |
| 630 | { |
| 631 | if (p.second > max_count) |
| 632 | { |
| 633 | max_count = p.second; |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | const auto url = getHeatMapUrl(*nm, con_counts, max_count); |
| 638 | |
| 639 | if (url.empty()) |
| 640 | return; |
| 641 | |
| 642 | std::stringstream label; |
| 643 | |
| 644 | for (const auto n : ns) |
| 645 | { |
| 646 | label << std::to_string(n) << ' '; |
nothing calls this directly
no test coverage detected