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

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

Closed
13 tasks done
alfoa opened this issue Apr 22, 2024 · 1 comment · Fixed by #2317
Closed
13 tasks done

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

alfoa opened this issue Apr 22, 2024 · 1 comment · Fixed by #2317

Comments

@alfoa
Copy link
Collaborator

alfoa commented Apr 22, 2024

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

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

For Change Control Board: Issue Closure

  • If the issue is a defect, is the defect fixed?
  • If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.)
  • 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)?
  • 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)?
  • If the issue is being closed without a pull request, has an explanation of why it is being closed been provided?
alfoa added a commit that referenced this issue May 8, 2024
@alfoa alfoa self-assigned this May 8, 2024
@mandd mandd self-assigned this May 8, 2024
@wangcj05
Copy link
Collaborator

wangcj05 commented May 9, 2024

Issue closure checklist is good.

wangcj05 pushed a commit that referenced this issue May 16, 2024
* Closes #2304

* added test

* Update tests/framework/Optimizers/GeneticAlgorithms/continuous/unconstrained/test_ensembleModel_withGA_Code_and_Functions.xml

* removed trailing

* added missing input file

* Update tests/framework/Optimizers/GeneticAlgorithms/continuous/unconstrained/metaModelWithCodeAndFunctionsAndGenetic/decayConstantB.py

* isinstance

* fixed parallel execution

* readded heron and baycal?

* removed trailing spaces

* some cleaning

* fixed test name and rook error message

* module ensemble doc

* Apply suggestions from code review

* removed trailing whitespaces

* fix for 'cvxpy'...this is not a very maintainable way to handle such exceptions

* changed approach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants