raven icon indicating copy to clipboard operation
raven copied to clipboard

[TASK] Sampler/Optimizer function execution order

Open aalfonsi opened this issue 10 months ago • 3 comments


Issue Description

Is your feature request related to a problem? Please describe. For complex problems, a set of functions (in Samplers/Optimizers) might depend on another one/another set. Currently there is no way in RAVEN to specify an order of execution or for RAVEN to infer the order of execution as function of the input/output variables.

Describe the solution you'd like 2 options are possible:

  • Easiest to implement: allow the user to specify an order of execution of the variables/functions evaluation
  • More rubust: usage of graph theory (EnsembleModel-like) to infer the order of execution.

Describe alternatives you've considered In all the functions that depend on another function/function set, the code snippet needed to compute the "common quantity" is copied pasted in each function.


For Change Control Board: Issue Review

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

  • [x] 1. Is it tagged with a type: defect or task?
  • [x] 2. Is it tagged with a priority: critical, normal or minor?
  • [x] 3. If it will impact requirements or requirements tests, is it tagged with requirements?
  • [x] 4. If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users.
  • [x] 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.)
  • [ ] 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)?
  • [ ] 4. If the issue is a defect, does it impact the latest release branch? If yes, is there any issue tagged with release (create if needed)?
  • [ ] 5. If the issue is being closed without a pull request, has an explanation of why it is being closed been provided?

aalfonsi avatar Apr 17 '24 03:04 aalfonsi

@wangcj05 @mandd @PaulTalbot-INL @joshua-cogliati-inl ALL what do you think?

aalfonsi avatar Apr 17 '24 03:04 aalfonsi

@aalfonsi Both are good for me. If you choose the option two, I think we need to switch "variables" of "Functions" to "Inputs"/"Outputs" instead.

wangcj05 avatar Apr 17 '24 04:04 wangcj05

@aalfonsi Both are good for me. If you choose the option two, I think we need to switch "variables" of "Functions" to "Inputs"/"Outputs" instead.

Oh Yes absolutely that can be done to be more explicit. Implicitly in case of "functions" i think the input output relation is in their definition. For example in a case like the one below:

<Functions>
  <External file="myFile.py" name="myFunction">
    <variables>sampleVar1,variablefromOtherFunction</variables>
  </External>
</Functions>

<variable name="myVar">
  <function>myFunction</function>
</variable>

The output is myVar (the variable name) and the inputs are the Functions variables.

alfoa avatar Apr 17 '24 18:04 alfoa

issue closure checklist is good.

wangcj05 avatar Jun 07 '24 14:06 wangcj05