Fix comparisons between HYPRE_Real and HYPRE_Complex (#880)

This fixes the machine-tux regression failures from 04/12/23
This commit is contained in:
Victor A. P. Magri 2023-04-12 14:04:18 -04:00 committed by GitHub
parent 461b6eee60
commit b08a962924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -4511,7 +4511,7 @@ hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A,
jj = A_diag_j[ii];
if ((jj >= bidxm1) &&
(jj < bidxp1) &&
hypre_abs(A_diag_data[ii]) > HYPRE_REAL_MIN)
hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN)
{
bidx = j * blk_size + jj - bidxm1;
diag_data[i * bs2 + bidx] = A_diag_data[ii];
@ -4532,7 +4532,7 @@ hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A,
jj = A_diag_j[ii];
if ((jj >= bidxm1) &&
(jj < bidxp1) &&
hypre_abs(A_diag_data[ii]) > HYPRE_REAL_MIN)
hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN)
{
bidx = j * left_size + jj - bidxm1;
diag_data[bstart + bidx] = A_diag_data[ii];
@ -4561,7 +4561,7 @@ hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A,
{
if ((jj - row_offset >= bidxm1) &&
(jj - row_offset < bidxp1) &&
(hypre_abs(A_diag_data[ii]) > HYPRE_REAL_MIN))
(hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN))
{
didx = bidx * bs2 + ridx * blk_size + jj - bidxm1 - row_offset;
diag_data[didx] = A_diag_data[ii];
@ -4595,7 +4595,7 @@ hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A,
{
if ((jj - row_offset >= bidxm1) &&
(jj - row_offset < bidxp1) &&
(hypre_abs(A_diag_data[ii]) > HYPRE_REAL_MIN))
(hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN))
{
didx = bstart + ridx * left_size + jj - bidxm1 - row_offset;
diag_data[didx] = A_diag_data[ii];
@ -4627,7 +4627,7 @@ hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A,
{
for (i = 0; i < num_points; i++)
{
if (hypre_abs(diag_data[i]) < HYPRE_REAL_MIN)
if (hypre_cabs(diag_data[i]) < HYPRE_REAL_MIN)
{
diag_data[i] = 0.0;
}
@ -5009,8 +5009,8 @@ hypre_MGRBlockRelaxSetup( hypre_ParCSRMatrix *A,
{
for (i = 0; i < n; i++)
{
// FIX-ME: zero-diagonal should be tested previously
if (hypre_abs(diaginv[i]) < HYPRE_REAL_MIN)
/* TODO: zero-diagonal should be tested previously */
if (hypre_cabs(diaginv[i]) < HYPRE_REAL_MIN)
{
diaginv[i] = 0.0;
}

View File

@ -128,7 +128,7 @@ hypre_MGRSolve( void *mgr_vdata,
if (logging > 1)
{
hypre_ParVectorCopy(F_array[0], residual );
if (tol > fp_zero)
if (tol > hypre_cabs(fp_zero))
{
hypre_ParCSRMatrixMatvec(fp_neg_one, A_array[0], U_array[0], fp_one, residual);
}
@ -137,7 +137,7 @@ hypre_MGRSolve( void *mgr_vdata,
else
{
hypre_ParVectorCopy(F_array[0], Vtemp);
if (tol > fp_zero)
if (tol > hypre_cabs(fp_zero))
{
hypre_ParCSRMatrixMatvec(fp_neg_one, A_array[0], U_array[0], fp_one, Vtemp);
}
@ -646,7 +646,7 @@ hypre_MGRCycle( void *mgr_vdata,
HYPRE_Real convergence_factor_cg;
hypre_BoomerAMGGetRelResidualNorm(cg_solver, &convergence_factor_cg);
(mgr_data -> cg_convergence_factor) = convergence_factor_cg;
if ((print_level) > 1 && my_id == 0 && convergence_factor_cg > fp_one)
if ((print_level) > 1 && my_id == 0 && convergence_factor_cg > hypre_cabs(fp_one))
{
hypre_printf("Warning!!! Coarse grid solve diverges. Factor = %1.2e\n",
convergence_factor_cg);