Skip to content

Commit

Permalink
#32: fix invalid condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie authored and cwschilly committed Aug 14, 2024
1 parent b562a95 commit 2f3a400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vt-tv/render/render.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Render::Render(Info in_info)
// Generically set rank grid dimensions according to the total number of ranks
grid_size_[2] = 1; // we assume 2D representation

int sqrt_n_ranks = std::sqrt(n_ranks_);
if(static_cast<uint64_t>(sqrt_n_ranks) == n_ranks_) {
uint64_t sqrt_n_ranks = static_cast<uint64_t>(std::sqrt(static_cast<double>(n_ranks_)));
if(sqrt_n_ranks * sqrt_n_ranks == n_ranks_) {
// n_ranks is a perfect square
grid_size_[0] = sqrt_n_ranks;
grid_size_[1] = sqrt_n_ranks;
Expand Down

0 comments on commit 2f3a400

Please sign in to comment.