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

CodeInterface samplers dictionary needs to be updated. #35

Closed
joshua-cogliati-inl opened this issue Apr 5, 2017 · 4 comments · Fixed by #181
Closed

CodeInterface samplers dictionary needs to be updated. #35

joshua-cogliati-inl opened this issue Apr 5, 2017 · 4 comments · Fixed by #181
Labels
external interfaces priority_normal task This tag should be used for any new capability, improvement or enanchment

Comments

@joshua-cogliati-inl
Copy link
Collaborator

This was https://hpcgitlab.inl.gov/idaholab/raven/issues/648

Inside MooseBasedAppInterface.py, we are using the following to point to the sampler:

    self._samplersDictionary                          = {}
    self._samplersDictionary['MonteCarlo'           ] = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['Grid'                 ] = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['Stratified'           ] = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['DynamicEventTree'     ] = self.dynamicEventTreeForMooseBasedApp
    self._samplersDictionary['StochasticCollocation'] = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['FactorialDesign'      ] = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['ResponseSurfaceDesign'] = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['Adaptive']              = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['SparseGridCollocation'] = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['EnsembleForward'      ] = self.pointSamplerForMooseBasedApp
    self._samplersDictionary['CustomSampler'        ] = self.pointSamplerForMooseBasedApp

Since we do have new Samplers, such as Sobol, AdaptiveSparseGrid, ..., we need to add these new Samplers in the ```self._samplersDictioinary''' so that the user can use it.

The following interfaces will also have the same problem: RELAP5, RELAP7, Rattlesnake, Bison, Mammoth

A suggested fix was:

diff --git a/framework/CodeInterfaces/MooseBasedApp/MooseBasedAppInterface.py b/framework/CodeInterfaces/MooseBasedApp/MooseBasedAppInterface.py
index ae298b2..eae50a8 100644
--- a/framework/CodeInterfaces/MooseBasedApp/MooseBasedAppInterface.py
+++ b/framework/CodeInterfaces/MooseBasedApp/MooseBasedAppInterface.py
@@ -57,18 +57,12 @@ class MooseBasedApp(CodeInterfaceBase):
       @ Out, newInputFiles, list, list of newer input files, list of the new input files (modified and not)
     """
     import MOOSEparser
-    self._samplersDictionary                          = {}
-    self._samplersDictionary['MonteCarlo'           ] = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['Grid'                 ] = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['Stratified'           ] = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['DynamicEventTree'     ] = self.dynamicEventTreeForMooseBasedApp
-    self._samplersDictionary['StochasticCollocation'] = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['FactorialDesign'      ] = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['ResponseSurfaceDesign'] = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['Adaptive']              = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['SparseGridCollocation'] = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['EnsembleForward'      ] = self.pointSamplerForMooseBasedApp
-    self._samplersDictionary['CustomSampler'        ] = self.pointSamplerForMooseBasedApp
+    self._samplersDictionary = {}
+    unImplementedSamplers = ['DynamicEventTree', 'LimitSurfaceSearch','AdaptiveDynamicEventTree']
+    if samplerType in unImplementedSamplers:
+      self._samplersDictionary[samplerType] = self.dynamicEventTreeForMooseBasedApp
+    else:
+      self._samplersDictionary[samplerType] = self.pointSamplerForMooseBasedApp
     found = False
     for index, inputFile in enumerate(currentInputFiles):
       inputFile = inputFile.getAbsFile()

@PaulTalbot-INL
Copy link
Collaborator

The unimplemented samplers only raise an error when they try to run, anyway, right? Perhaps we should rethink the classifying process entirely, as I don't think any other code interfaces go through this procedure.

@joshua-cogliati-inl
Copy link
Collaborator Author

Does #181 solve this?

@maljovec
Copy link
Contributor

I believe so.

@maljovec maljovec added external interfaces task This tag should be used for any new capability, improvement or enanchment priority_normal labels May 17, 2017
@maljovec
Copy link
Contributor


For Change Control Board: Issue Review

This review should occur before any development is performed as a response to this issue.

  • 1. Is it tagged with a type: defect or improvement?
  • 2. Is it tagged with a priority: critical, normal or minor?
  • 3. If it will impact requirements or requirements tests, is it tagged with requirements? Does not impact requirements
  • 4. If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users. Not a defect
  • 5. Is a rationale provided? (Such as explaining why the improvement is needed or why current code is wrong.)

For Change Control Board: Issue Closure

This review should occur when the issue is imminently going to be closed.

  • 1. If the issue is a defect, is the defect fixed?
  • 2. If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.) Not a defect
  • 3. If the issue can impact users, has an email to the users group been written (the email should specify if the defect impacts stable or master)? No impact to users
  • 4. If the issue is a defect, does it impact the latest stable branch? If yes, is there any issue tagged with stable (create if needed)? Not a defect
  • 5. If the issue is being closed without a merge request, has an explanation of why it is being closed been provided?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external interfaces priority_normal task This tag should be used for any new capability, improvement or enanchment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants