Page MenuHomePhabricator

MPISolverWrapper's direct call of blackbox internal seems wrong
Closed, ResolvedPublic

Description

Currently the MPISolverWrappercalls directly the loss function in the blackbox. (https://phabricator.mitk.org/source/observed-hyppopy/browse/master/hyppopy/solvers/MPISolverWrapper.py$111-114)

try:
  loss = self._solver.blackbox.blackbox_func(params)
except:
  loss = self._solver.blackbox.blackbox_func(**params)

It is unclear to me why id did it that way, and not just called blackbox.call() aka blackbox().
The direct call of the blackbox_func misses i.a. the passing of data if set in the blackbox. Further it is redundant code, as the blackbox.call() also checks for several blackbox_func signatures.

We should discuss and check if it does make sense like it is now. I have the feeling changing it would make much sense. (At least I currently see now argument against it.)

Event Timeline

floca triaged this task as High priority.Thu, Mar 25, 11:04 PM
floca created this task.
floca renamed this task from MPISolverWrapperdirect call of blackbox internal seems wrong to MPISolverWrapper's direct call of blackbox internal seems wrong.Thu, Mar 25, 11:14 PM
kleina added a project: Hyppopy.
kleina moved this task from Backlog to In Progress on the Hyppopy board.

I agree with the raised point. I checked the classes again and do not see a valid reason behind the blackbox_func call. I will fix this.