fixed nan (#436)

This PR fixes nan issues in corner cases in hypre_BoomerAMGInterpTruncationDevice.
This commit is contained in:
Ruipeng Li 2021-08-03 09:27:54 -07:00 committed by GitHub
parent ffe4f7384b
commit 9117fc20f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -1497,25 +1497,31 @@ hypre_BoomerAMGSetup( void *amg_vdata,
num_functions, dof_func_array[level], debug_flag,
agg_P12_trunc_factor, agg_P12_max_elmts, &P1);
}
else if (agg_interp_type == 5)
{
hypre_BoomerAMGBuildModExtInterp(A_array[level],
CF_marker, S, coarse_pnts_global1,
num_functions, dof_func_array[level],
debug_flag,
agg_P12_trunc_factor, agg_P12_max_elmts, &P1);
}
else if (agg_interp_type == 6)
{
hypre_BoomerAMGBuildModExtPIInterp(A_array[level],
CF_marker, S, coarse_pnts_global1,
num_functions, dof_func_array[level],
debug_flag,
agg_P12_trunc_factor, agg_P12_max_elmts, &P1);
}
else if (agg_interp_type == 7)
{
hypre_BoomerAMGBuildModExtPEInterp(A_array[level],
CF_marker, S, coarse_pnts_global1,
num_functions, dof_func_array[level],
debug_flag,
agg_P12_trunc_factor, agg_P12_max_elmts, &P1);
}
if (agg_interp_type == 4)
{
hypre_BoomerAMGCorrectCFMarker (CF_marker, local_num_vars,

View File

@ -79,7 +79,16 @@ hypreCUDAKernel_InterpTruncation( HYPRE_Int nrows,
}
}
row_scal = row_sum / warp_allreduce_sum(row_scal);
row_scal = warp_allreduce_sum(row_scal);
if (row_scal)
{
row_scal = row_sum / row_scal;
}
else
{
row_scal = 1.0;
}
/* 3. scale the row */
for (HYPRE_Int i = p + lane; i <= last_pos; i += HYPRE_WARP_SIZE)