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

tw_opt_set #164

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

tw_opt_set #164

wants to merge 4 commits into from

Conversation

gonsie
Copy link
Member

@gonsie gonsie commented Sep 18, 2019

This is a new API function which can be used to set options during runtime (any options that are registered with TWOPT). It may be useful for models that always require certain options.

This is also a step in the direction of formalizing the ROSS API and removing the need for models to muck with global variables. The hope is that models only worry about options documented by --help text and never need to remember g_tw_xxx variables.

Some larger discussion should take place in #162.


If this merge represents a feature addition to ROSS, the following items must be completed before the branch will be merged:

  • Document the feature on the blog (See the website Contributing guide).
    Include a link to your blog post in the Pull Request.
  • Builds should cleanly compile with -Wall and -Wextra.
  • One or more TravisCI tests should be created (and they should pass)
  • Through the TravisCI tests, coverage should increase
  • Test with CODES to ensure everything continues to work

@gonsie
Copy link
Member Author

gonsie commented Sep 18, 2019

This needs some logic as to whether tw_opt_set is being called before or after tw_opt_parse. At first blush, I feel like it is incorrect to call set after parse... but really, there is no reason not to, other than being sane for model developers and ensuring that options set on the command-line always take precedence.

@codecov
Copy link

codecov bot commented Sep 18, 2019

Codecov Report

Merging #164 into develop will decrease coverage by 0.52%.
The diff coverage is 61.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop    #164      +/-   ##
==========================================
- Coverage    58.42%   57.9%   -0.53%     
==========================================
  Files           32      32              
  Lines         3541    3578      +37     
==========================================
+ Hits          2069    2072       +3     
- Misses        1472    1506      +34
Impacted Files Coverage Δ
core/tw-opts.c 22.31% <61.9%> (-2.81%) ⬇️
core/gvt/mpi_allreduce.c 90.42% <0%> (ø) ⬆️
core/gvt/mpi_allreduce.h 87.5% <0%> (+0.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 995a433...2666260. Read the comment docs.

@gonsie
Copy link
Member Author

gonsie commented Sep 19, 2019

I should also de-allocate that memory I use...

Hopefully the model developers don't drive themselves crazy by
overwriting options coming from the command line :\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant