idaholab / raven

RAVEN is a flexible and multi-purpose probabilistic risk analysis, validation and uncertainty quantification, parameter optimization, model reduction and data knowledge-discovering framework.
https://raven.inl.gov/
Apache License 2.0
212 stars 131 forks source link

[DEFECT] Genetic Algorithm crashes with Ensemble model and <functions> #2304

Closed alfoa closed 1 month ago

alfoa commented 2 months ago

Thank you for the defect report

Defect Description

Genetic Algorithm crashes with Ensemble model and .

If the GA is used with variables produced by functions with an ensemble model, the code crashes.

E.g.

--------------------------------------------------
Exception in thread 1:
Traceback (most recent call last):
  File "/Users/aalfonsi/mambaforge3/envs/raven_libraries/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Users/aalfonsi/mambaforge3/envs/raven_libraries/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "raven/ravenframework/Runners/SharedMemoryRunner.py", line 115, in <lambda>
    self.thread = InterruptibleThread(target = lambda q, *arg : q.append(self.functionToRun(*arg)),
  File "raven/ravenframework/Models/EnsembleModel.py", line 512, in evaluateSample
    Input = self.createNewInput(myInput[0], samplerType, **kwargsToKeep)
  File "raven/ravenframework/Models/EnsembleModel.py", line 425, in createNewInput
    self.raiseAnError(RuntimeError,"for sub-model "+ modelIn + " the input "+inp+" has not been found among other models' outputs and sampled variables!")
  File "raven/ravenframework/BaseClasses/MessageUser.py", line 77, in raiseAnError
    self.messageHandler.error(self, etype, msg, str(tag), verbosity, color)
  File "raven/ravenframework/MessageHandler.py", line 235, in error
    raise etype(message)
RuntimeError: for sub-model testModel the input decay_B has not been found among other models' outputs and sampled variables!

Steps to Reproduce

I will add an input file

Expected Behavior

no crash. This is a critical show stopper.

Screenshots and Input Files

input_file.inl.zip

OS

Linux

OS Version

No response

Dependency Manager

PIP

For Change Control Board: Issue Review

For Change Control Board: Issue Closure

wangcj05 commented 2 months ago

Issue closure checklist is good.