Skip to content

Commit

Permalink
[prec] add sor to benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelKoch committed Jul 9, 2024
1 parent 5a5a6c8 commit b85c145
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion benchmark/utils/preconditioners.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DEFINE_string(preconditioners, "none",
"A comma-separated list of preconditioners to use. "
"Supported values are: none, jacobi, paric, parict, parilu, "
"parilut, ic, ilu, paric-isai, parict-isai, parilu-isai, "
"parilut-isai, ic-isai, ilu-isai, overhead");
"parilut-isai, ic-isai, ilu-isai, sor, overhead");

DEFINE_uint32(parilu_iterations, 5,
"The number of iterations for ParIC(T)/ParILU(T)");
Expand All @@ -49,6 +49,12 @@ DEFINE_double(jacobi_accuracy, 1e-1,
DEFINE_uint32(jacobi_max_block_size, 32,
"Maximal block size of the block-Jacobi preconditioner");

DEFINE_double(sor_relaxation_factor, 1.0,
"The relaxation factor for the SOR preconditioner");

DEFINE_bool(sor_symmetric, false,
"Apply the SOR preconditioner symmetrically, i.e. use SSOR");


// parses the Jacobi storage optimization command line argument
gko::precision_reduction parse_storage_optimization(const std::string& flag)
Expand Down Expand Up @@ -292,6 +298,15 @@ const std::map<std::string, std::function<std::unique_ptr<gko::LinOpFactory>(
.with_sparsity_power(FLAGS_isai_power)
.on(exec);
}},
{"sor",
[](std::shared_ptr<const gko::Executor> exec) {
return gko::preconditioner::Sor<etype, itype>::build()
.with_relaxation_factor(
static_cast<gko::remove_complex<etype>>(
FLAGS_sor_relaxation_factor))
.with_symmetric(FLAGS_sor_symmetric)
.on(exec);
}},
{"overhead", [](std::shared_ptr<const gko::Executor> exec) {
return gko::Overhead<etype>::build()
.with_criteria(gko::stop::ResidualNorm<etype>::build()
Expand Down

0 comments on commit b85c145

Please sign in to comment.