Skip to content

Commit

Permalink
Fix error tests and add new tests for ErrorVerbosity() function (#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfalgout authored Nov 5, 2024
1 parent 5398ba7 commit aa1f66d
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 20 deletions.
8 changes: 6 additions & 2 deletions src/test/TEST_error/error.jobs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -difconv -c 0 0 0 > error.out.2
mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -rlx 0 -w -1.0 > error.out.3
mpirun -np 2 ./ij -solver 0 -mg_max_iter 2 > error.out.4

# Test the HYPRE_GetErrorMessages() routine
mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -rlx 0 -w -1.0 -test_error 1 > error.out.10
# Test the HYPRE_GetErrorMessages() and HYPRE_SetPrintErrorVerbosity() routines
mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -rlx 0 -w -1.0 > error.out.10
mpirun -np 2 ./ij -solver 0 -mg_max_iter 1 -ns 0 -nc 2 > error.out.11
mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -rlx 0 -w -1.0 -test_error 1 > error.out.15
mpirun -np 2 ./ij -solver 0 -mg_max_iter 1 -ns 0 -nc 2 -test_error 1 > error.out.16

65 changes: 52 additions & 13 deletions src/test/TEST_error/error.saved
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@


Iters ||r||_2 conv.rate ||r||_2/||b||_2
----- ------------ --------- ------------
----- ------------ --------- ------------
1 3.651484e+01 1.154701 1.154701e+00
2 2.779522e+01 0.761203 8.789620e-01
# Output file: error.out.1


Iters ||r||_2 conv.rate ||r||_2/||b||_2
----- ------------ --------- ------------
----- ------------ --------- ------------
1 9.666492e+00 0.305681 3.056813e-01
2 6.025557e-01 0.062334 1.905448e-02
# Output file: error.out.2
<b,b>: 1.000000e+03


Iters ||r||_2 conv.rate ||r||_2/||b||_2
----- ------------ --------- ------------
----- ------------ --------- ------------
1 1.995213e+00 0.063094 6.309416e-02
# Output file: error.out.3


Iters ||r||_2 conv.rate ||r||_2/||b||_2
----- ------------ --------- ------------
----- ------------ --------- ------------
1 5.298880e+01 1.675653 1.675653e+00
2 5.298880e+01 1.000000 1.675653e+00
# Output file: error.out.4
Expand All @@ -37,22 +37,61 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2


Iters ||r||_2 conv.rate ||r||_2/||b||_2
----- ------------ --------- ------------
----- ------------ --------- ------------
1 5.298880e+01 1.675653 1.675653e+00
2 5.298880e+01 1.000000 1.675653e+00
# Output file: error.out.11
Average Convergence Factor = 1.379821

Complexity: grid = 1.555000
operator = 2.667344
cycle = 5.332187

# Output file: error.out.15


Iters ||r||_2 conv.rate ||r||_2/||b||_2
----- ------------ --------- ------------
1 5.298880e+01 1.675653 1.675653e+00
2 5.298880e+01 1.000000 1.675653e+00
# Output file: error.out.16
Average Convergence Factor = 1.379821

Complexity: grid = 1.555000
operator = 2.667344
cycle = 5.332187

0: hypre error in file "par_amg.c", line 2025, error code = 20
0: hypre error in file "par_amg_solve.c", line 341, error code = 256
0: hypre error in file "par_amg_solve.c", line 341, error code = 256
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
0: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG
0: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG
0: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG
0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence
0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence
0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence
0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence
1: hypre error in file "par_amg_solve.c", line 341, error code = 256
1: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG
1: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG
1: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG
1: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence
1: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence
1: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence
1: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence
1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors
3 changes: 3 additions & 0 deletions src/test/TEST_error/error.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ FILES="\
${TNAME}.out.3\
${TNAME}.out.4\
${TNAME}.out.10\
${TNAME}.out.11\
${TNAME}.out.15\
${TNAME}.out.16\
"

for i in $FILES
Expand Down
16 changes: 11 additions & 5 deletions src/test/ij.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,6 @@ main( hypre_int argc,
size_t umpire_host_pool_size = 4294967296; // 4 GiB
#endif

HYPRE_SetPrintErrorMode(1);
//HYPRE_SetPrintErrorVerbosity(HYPRE_ERROR_GENERIC, 0); /* turn generic errors off */
//HYPRE_SetPrintErrorVerbosity(-1, 0); /* turn all errors off */
//HYPRE_SetPrintErrorVerbosity(HYPRE_ERROR_CONV, 1); /* turn convergence errors on */

/*-----------------------------------------------------------
* Set defaults
*-----------------------------------------------------------*/
Expand Down Expand Up @@ -2747,6 +2742,17 @@ main( hypre_int argc,
hypre_printf(" solver ID = %d\n\n", solver_id);
}

/*-----------------------------------------------------------
* Set various things
*-----------------------------------------------------------*/

HYPRE_SetPrintErrorMode(1);
if (test_error == 1)
{
HYPRE_SetPrintErrorVerbosity(-1, 0); /* turn all errors off */
HYPRE_SetPrintErrorVerbosity(HYPRE_ERROR_GENERIC, 1); /* turn generic errors on */
}

#if defined(HYPRE_USING_DEVICE_POOL)
/* To be effective, hypre_SetCubMemPoolSize must immediately follow HYPRE_Init */
HYPRE_SetGPUMemoryPoolSize( mempool_bin_growth, mempool_min_bin,
Expand Down

0 comments on commit aa1f66d

Please sign in to comment.