-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
For some parameter combinations for RGG2D graphs, we are passing invalid probabilities (> 1) to std::binomial_distribution. When building in debug mode, glibc throws an assertion for that.
This can be reproduced with parameters rgg2d;N=10;M=10 with 1 MPI rank.
Generating graph ... /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/bits/random.h:3974: std::binomial_distribution<_IntType>::param_type::param_type(_IntType, double) [with _IntType = long long unsigned int]: Assertion '(_M_t >= _IntType(0)) && (_M_p >= 0.0) && (_M_p <= 1.0)' failed.
I tracked that down to
KaGen/kagen/generators/geometric/rgg/rgg_2d.cpp
Lines 154 to 157 in e00a227
| SInt h = sampling::Spooky::hash(seed); | |
| SInt cell_vertices = rng_.GenerateBinomial(h, n, cell_area / total_area); | |
| LPFloat cell_start_x = std::get<1>(chunk) + (i / cells_per_dim_) * cell_size_; | |
| LPFloat cell_start_y = std::get<2>(chunk) + (i % cells_per_dim_) * cell_size_; |
From my understanding that happens when the chunk and cell area are equal. Then, round errors may lead to probabilities greater than 1.
We should also check if any other part of the code is affected by that.
Metadata
Metadata
Assignees
Labels
No labels