Keep smooth_num_levels in sync with amg_data (#954)
This solves an out-of-bounds memory error during `hypre_BoomerAMGSetup` when called multiple times without a call to `hypre_BoomerAMGDestroy` interleaved. This pull request makes sure that `smooth_num_levels` is reset to `hypre_ParAMGDataSmoothNumLevels(amg_data)` before the smoothers variable is allocated.
This commit is contained in:
parent
0e43aec1d4
commit
cd8f9c363e
@ -957,6 +957,7 @@ hypre_BoomerAMGSetup( void *amg_vdata,
|
||||
agg_P_max_elmts = hypre_ParAMGDataAggPMaxElmts(amg_data);
|
||||
agg_P12_max_elmts = hypre_ParAMGDataAggP12MaxElmts(amg_data);
|
||||
jacobi_trunc_threshold = hypre_ParAMGDataJacobiTruncThreshold(amg_data);
|
||||
smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data);
|
||||
if (smooth_num_levels > level)
|
||||
{
|
||||
smoother = hypre_CTAlloc(HYPRE_Solver, smooth_num_levels, HYPRE_MEMORY_HOST);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user