Skip to content

Commit

Permalink
add doc for unsupported parameters, and uniform the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed May 30, 2024
1 parent fa82235 commit 8eae9e1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/config/config_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ parse_or_get_factory<const LinOpFactory>(const pnode& config,
} else if (config.get_tag() == pnode::tag_t::map) {
return parse(config, context, td);
} else {
GKO_INVALID_STATE("The data of config is not valid.");
GKO_INVALID_STATE("The type of config is not valid.");
}
}

Expand All @@ -57,7 +57,7 @@ parse_or_get_factory<const stop::CriterionFactory>(const pnode& config,
return criterion_map.at(config.get("type").get_string())(config,
context, td);
} else {
GKO_INVALID_STATE("The data of config is not valid.");
GKO_INVALID_STATE("The type of config is not valid.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/config/config_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ parse_or_get_specific_factory(const pnode& config, const registry& context,
} else if (config.get_tag() == pnode::tag_t::map) {
return T_non_const::parse(config, context, td);
} else {
GKO_INVALID_STATE("The data of config is not valid.");
GKO_INVALID_STATE("The type of config is not valid.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/config/trisolver_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ inline void common_trisolver_parse(SolverParam& params, const pnode& config,
} else if (str == "syncfree") {
params.with_algorithm(trisolve_algorithm::syncfree);
} else {
GKO_INVALID_STATE("Wrong value for algorithm");
GKO_INVALID_CONFIG_VALUE("algorithm", str);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions core/preconditioner/jacobi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ Jacobi<ValueType, IndexType>::parse(const config::pnode& config,
if (auto& obj = config.get("skip_sorting")) {
params.with_skip_sorting(gko::config::get_value<bool>(obj));
}
// No array support
if (config.get("block_pointers")) {
GKO_INVALID_STATE(
"preconditioner::Jacobi does not support block_pointers in file "
"config.");
}
// storage_optimization_type is not public. It uses precision_reduction
// as input. It allows value and array input, but we only support the value
// input [x, y] -> one precision_reduction (value mode)
Expand Down
3 changes: 3 additions & 0 deletions include/ginkgo/core/preconditioner/jacobi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,9 @@ class Jacobi : public EnableLinOp<Jacobi<ValueType, IndexType>>,
* default uses the value/index type of this class.
*
* @return parameters
*
* @note Jacobi does not support block_pointers and storage_optimization
* array.
*/
static parameters_type parse(
const config::pnode& config, const config::registry& context,
Expand Down
2 changes: 2 additions & 0 deletions include/ginkgo/core/solver/multigrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ class Multigrid : public EnableLinOp<Multigrid>,
* @param td_for_child the type descriptor for children configs
*
* @return parameters
*
* @note Multigrid does not support the selector option in file config
*/
static parameters_type parse(const config::pnode& config,
const config::registry& context,
Expand Down

0 comments on commit 8eae9e1

Please sign in to comment.