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

Extend Restart to Adaptive samplers #1283

Merged
merged 17 commits into from
Jul 23, 2020

Conversation

PaulTalbot-INL
Copy link
Collaborator

@PaulTalbot-INL PaulTalbot-INL commented Jul 16, 2020


Pull Request Description

What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)

Closes #1280

What are the significant changes in functionality due to this change request?

Extends expected existing restart mechanics to Adaptive samplers. This can be improved once:

  • the Sampler's generateInput returns a realization instead of storing on self
  • we have the Realization instance

For Change Control Board: Change Request Review

The following review must be completed by an authorized member of the Change Control Board.

  • 1. Review all computer code.
  • 2. If any changes occur to the input syntax, there must be an accompanying change to the user manual and xsd schema. If the input syntax change deprecates existing input files, a conversion script needs to be added (see Conversion Scripts).
  • 3. Make sure the Python code and commenting standards are respected (camelBack, etc.) - See on the wiki for details.
  • 4. Automated Tests should pass, including run_tests, pylint, manual building and xsd tests. If there are changes to Simulation.py or JobHandler.py the qsub tests must pass.
  • 5. If significant functionality is added, there must be tests added to check this. Tests should cover all possible options. Multiple short tests are preferred over one large test. If new development on the internal JobHandler parallel system is performed, a cluster test must be added setting, in XML block, the node <internalParallel> to True.
  • 6. If the change modifies or adds a requirement or a requirement based test case, the Change Control Board's Chair or designee also needs to approve the change. The requirements and the requirements test shall be in sync.
  • 7. The merge request must reference an issue. If the issue is closed, the issue close checklist shall be done.
  • 8. If an analytic test is changed/added is the the analytic documentation updated/added?
  • 9. If any test used as a basis for documentation examples (currently found in raven/tests/framework/user_guide and raven/docs/workshop) have been changed, the associated documentation must be reviewed and assured the text matches the example.

@PaulTalbot-INL
Copy link
Collaborator Author

@wangcj05 @alfoa for your reviewing pleasure.

Note that the Adaptive MonteCarlo did work fine with the restart, as we believed. You have to look at the solution export, especially exp_restart, which before this fix only had entries 6-15, and now has 1-15.

@alfoa
Copy link
Collaborator

alfoa commented Jul 17, 2020

Test invalidated to get the new modifications in the BasicStats tests (see PR #1282)

@moosebuild
Copy link

Job Mingw Test on 3c1f0e2 : invalidated by @alfoa

@PaulTalbot-INL PaulTalbot-INL requested review from alfoa and wangcj05 and removed request for alfoa July 20, 2020 15:43
Copy link
Collaborator

@wangcj05 wangcj05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor comments

"""
#for future compatibility with Python 3--------------------------------------------------------------
from __future__ import division, print_function, unicode_literals, absolute_import
#End compatibility block for Python 3----------------------------------------------------------------
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do not need this import anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the linter will error if it doesn't find this. We should change this globally, as a separate action.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alfoa I think you are trying to remove the __future__ import, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we removed the check on that because it is not needed anymore... @joshua-cogliati-inl ???

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we removed it. we can remove the "future" (I know we need to do that to the other files too...I will take care of it)

handler object
@ In, args, dict, this is a list of arguments that will be passed as
function parameters into whatever method is stored in functionToRun.
e.g., functionToRun(*args)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change args to data

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<description>
Tests restarting an Adaptive Monte Carlo sampling from restart. \texttt{makeCoarse} samples initial data, then \texttt{makeRestart}
makes additional samples, restarting from the first set of samples. \texttt{makeFine} does all the samples without restart
for comparison. The model for "coarse" always returns a value of 1, while the model for "restart" returns a value of 2, so
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ``'' instead ""?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, used texttt instead

<?xml version="1.0" ?>
<Simulation verbosity="debug">
<TestInfo>
<name>framework/Samplers/Restart.AdaptiveMC</name>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change AdaptiveMC to AMC

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@wangcj05
Copy link
Collaborator

@alfoa Changes are good to me. Do you want to have review on this PR?

"""
#for future compatibility with Python 3--------------------------------------------------------------
from __future__ import division, print_function, unicode_literals, absolute_import
#End compatibility block for Python 3----------------------------------------------------------------
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we removed it. we can remove the "future" (I know we need to do that to the other files too...I will take care of it)

@alfoa alfoa added the RAVENv2.1 All tasks and defects that will go in RAVEN v2.1 label Jul 23, 2020
@alfoa
Copy link
Collaborator

alfoa commented Jul 23, 2020

Comments addressed...

Checklist passed...

PR can be merged

@alfoa alfoa merged commit 82edf0c into idaholab:devel Jul 23, 2020
@PaulTalbot-INL PaulTalbot-INL deleted the adaptive_restart branch April 8, 2021 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RAVENv2.1 All tasks and defects that will go in RAVEN v2.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Improvement on Restart Capability
4 participants