Skip to content

Commit

Permalink
grt: check if congestion grid vectors are empty before shuffling them
Browse files Browse the repository at this point in the history
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
  • Loading branch information
eder-matheus committed Dec 30, 2024
1 parent a288d5b commit 7b7e7d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/grt/src/fastroute/src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2495,8 +2495,13 @@ void FastRouteCore::saveCongestion(const int iter)
const int seed = 42;
g.seed(seed);

utl::shuffle(congestionGridsV.begin(), congestionGridsV.end(), g);
utl::shuffle(congestionGridsH.begin(), congestionGridsH.end(), g);
if (!congestionGridsH.empty()) {
utl::shuffle(congestionGridsH.begin(), congestionGridsH.end(), g);
}

if (!congestionGridsV.empty()) {
utl::shuffle(congestionGridsV.begin(), congestionGridsV.end(), g);
}
}

const std::string marker_group_name = fmt::format(
Expand Down

0 comments on commit 7b7e7d3

Please sign in to comment.