Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comprehensive way to manage ReSolve configuration parameters #96

Closed
pelesh opened this issue Dec 2, 2023 · 7 comments · Fixed by #215
Closed

Comprehensive way to manage ReSolve configuration parameters #96

pelesh opened this issue Dec 2, 2023 · 7 comments · Fixed by #215
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@pelesh
Copy link
Collaborator

pelesh commented Dec 2, 2023

ReSolve includes several different linear solvers and supports three hardware backends. There is a large number of parameters in ReSolve to select specific solution strategy and to tune its performance. Many of the parameters are specific to a specific solver type or hardware backend or both. We need a hierarchical method to allow user to configure ReSolve easily without sifting through dozens of (often cryptically described) parameters. Most of these parameters need to be set at runtime.

This issue is to start discussion how to handle this most effectively.

The issue originally raised by @kswirydo in #86 (comment)_

@pelesh pelesh added enhancement New feature or request question Further information is requested labels Dec 2, 2023
@pelesh
Copy link
Collaborator Author

pelesh commented Dec 3, 2023

Another part of this discussion is how to implement interface to ReSolve's select-from-the-list options. Currently we are just passing strings as this is quick'n'dirty way to set those options and get everything running. Perhaps a better way is to expose those lists to users in a form of enums. This will require some thinking about the scope in which these enums will live.

See how we handled similar issue in #12.

Also suggested by @kswirydo in #86 (comment)_

@stonecoldhughes
Copy link
Collaborator

stonecoldhughes commented Sep 20, 2024

has this utility been tested for all input conditions? Is there logic to detect and report ill-formed combinations of options?

Config options are often represented naturally with a hierarchical data format, and this allows them to be saved for later use. Does that capability exist with this parser? If not, is it desirable?

https://github.com/nlohmann/json is a single header file, so it could be added to the repo once and never bothered with again.

https://github.com/nlohmann/json can parse JSON from a file or the command line directly via stdin if file I/O is undesirable.

Thousands of users have helped refine json.hpp, it is extremely robust and extensively tested.

@stonecoldhughes
Copy link
Collaborator

For compile-time options, it looks like CMakePresets is being used, which is definitely the best way to organize repeatable build configurations with CMake

@cameronrutherford
Copy link
Collaborator

has this utility been tested for all input conditions? Is there logic to detect and report ill-formed combinations of options?

Config options are often represented naturally with a hierarchical data format, and this allows them to be saved for later use. Does that capability exist with this parser? If not, is it desirable?

https://github.com/nlohmann/json is a single header file, so it could be added to the repo once and never bothered with again.

https://github.com/nlohmann/json can parse JSON from a file or the command line directly via stdin if file I/O is undesirable.

Thousands of users have helped refine json.hpp, it is extremely robust and extensively tested.

Storing Re::Solve runtime options as JSON seems like a reasonable enough option to me.

We have used TOML files for another project to some success for storing arrays of test cases with sane defaults. Doing this in JSON might be a little harder.

Maybe we can do a mix of TOML for testing, and JSON for runtime options?

@stonecoldhughes
Copy link
Collaborator

Lots of content online indicates that JSON is not the best choice for configuration:

https://revelry.co/insights/development/json-configuration-file-format/
https://medium.com/trabe/stop-using-json-config-files-ab9bc55d82fa

TOML and YAML seem like better options for configurations than JSON!

@stonecoldhughes
Copy link
Collaborator

@cameronrutherford would you please link the TOML parsing code from the other project you mentioned, if you get a chance? I imagine it could be used in this project with minor repurposing, or at the very least a helpful reference. This looks a promising library for TOML parsing: https://marzer.github.io/tomlplusplus/index.html. @pelesh one way to begin this would be to identify one of the unit/system tests that requires some configuration, represent the configuration as TOML, then modify the test to consume a TOML file.

@cameronrutherford
Copy link
Collaborator

@cameronrutherford would you please link the TOML parsing code from the other project you mentioned, if you get a chance? I imagine it could be used in this project with minor repurposing, or at the very least a helpful reference. This looks a promising library for TOML parsing: https://marzer.github.io/tomlplusplus/index.html. @pelesh one way to begin this would be to identify one of the unit/system tests that requires some configuration, represent the configuration as TOML, then modify the test to consume a TOML file.

ExaGO is the reference project... Let me know if you need more clarifications:

Let me know if you need more clarification ◡̈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants