Skip to content

Commit

Permalink
fix verb
Browse files Browse the repository at this point in the history
  • Loading branch information
huiscliu committed Jan 16, 2024
1 parent 7d0c003 commit e716c0c
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions src/sxamg.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ SX_RTN sx_solver_amg(SX_MAT *A, SX_VEC *x, SX_VEC *b, SX_AMG_PARS *pars)
// Step 1: AMG setup phase
sx_amg_setup(&mg, A, pars);

// print out CPU time if needed
if (verb > 0) {
AMG_end = sx_get_time();
sx_printf("AMG setup time: %"fFMTg" s\n", AMG_end - AMG_start);
}

// Step 2: AMG solve phase
rtn = sx_solver_amg_solve(&mg, x, b);

Expand Down Expand Up @@ -201,7 +207,7 @@ SX_RTN sx_solver_gmres(SX_KRYLOV *ks, SX_AMG_PARS *pars)
pars = &npars;
}

verb = pars->verb;
verb = ks->verb;

nnz = A->num_nnzs;
m = A->num_rows;
Expand All @@ -223,6 +229,12 @@ SX_RTN sx_solver_gmres(SX_KRYLOV *ks, SX_AMG_PARS *pars)
// Step 1: AMG setup phase
sx_amg_setup(&mg, A, pars);

// print out CPU time if needed
if (verb > 0) {
AMG_end = sx_get_time();
sx_printf("AMG setup time: %"fFMTg" s\n", AMG_end - AMG_start);
}

// Step 2: solve phase
rtn = sx_solver_gmres_itnl(ks, &mg);

Expand Down Expand Up @@ -265,7 +277,7 @@ SX_RTN sx_solver_cg(SX_KRYLOV *ks, SX_AMG_PARS *pars)
pars = &npars;
}

verb = pars->verb;
verb = ks->verb;

nnz = A->num_nnzs;
m = A->num_rows;
Expand All @@ -287,6 +299,12 @@ SX_RTN sx_solver_cg(SX_KRYLOV *ks, SX_AMG_PARS *pars)
// Step 1: AMG setup phase
sx_amg_setup(&mg, A, pars);

// print out CPU time if needed
if (verb > 0) {
AMG_end = sx_get_time();
sx_printf("AMG setup time: %"fFMTg" s\n", AMG_end - AMG_start);
}

// Step 2: solve phase
rtn = sx_solver_cg_itnl(ks, &mg);

Expand Down Expand Up @@ -329,7 +347,7 @@ SX_RTN sx_solver_bicgstab(SX_KRYLOV *ks, SX_AMG_PARS *pars)
pars = &npars;
}

verb = pars->verb;
verb = ks->verb;

nnz = A->num_nnzs;
m = A->num_rows;
Expand All @@ -351,6 +369,12 @@ SX_RTN sx_solver_bicgstab(SX_KRYLOV *ks, SX_AMG_PARS *pars)
// Step 1: AMG setup phase
sx_amg_setup(&mg, A, pars);

// print out CPU time if needed
if (verb > 0) {
AMG_end = sx_get_time();
sx_printf("AMG setup time: %"fFMTg" s\n", AMG_end - AMG_start);
}

// Step 2: solve phase
rtn = sx_solver_bicgstab_itnl(ks, &mg);

Expand Down

0 comments on commit e716c0c

Please sign in to comment.