-
Notifications
You must be signed in to change notification settings - Fork 135
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
fix optimizer writeStep final (if optimization ends for reaching the limit number of iterations) #2387
fix optimizer writeStep final (if optimization ends for reaching the limit number of iterations) #2387
Changes from 6 commits
d2f4ec3
254f49a
90536b0
2b68e5c
ff47a1a
39c5a39
e8b15fd
5fe5932
c1bdd2f
d9c9dcc
57d648c
50828f1
e63c1e2
3164cbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,6 +267,11 @@ def _localTakeAstepRun(self, inDictionary): | |
# END while loop that runs the step iterations (collection and submission-for-DET) | ||
# if any collected runs failed, let the sampler treat them appropriately, and any other closing-out actions | ||
sampler.finalizeSampler(self.failedRuns) | ||
for myLambda, outIndex in self._outputCollectionLambda: | ||
if isinstance(outputs[outIndex], OutStreamEntity): | ||
myLambda([None,outputs[outIndex]]) | ||
self.raiseAMessage(f'Finalized output "{inDictionary["Output"][outIndex].name}"') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alfoa The proposed changes can resolve the issue. However, it can be confusing since these lines are almost similar to collection part in the same function. Could you provide more details why previous collection can not collect the final solution? Is it possible to make some modifications inside the optimizer to enable it? I have two concerns for the proposed approach:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The lines in the FilePrint are not unnecessary. They are required when the collection in triggered on data objects that are not "collected/created" by the Optimizers. Basically, the "SolutionExport" in the Optimizers is "updated" with the final solution after the collection is triggered (at the begin of the processing of the "last job"). So the Outstream is not invoked before exiting the Multirun loop. This modification was the "minimal viable" solution to trigger an out stream call at the end of the multi run. Maybe another approach could be to split the calls to the output collection:
|
||
|
||
alfoa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
def _addNewRuns(self, sampler, model, inputs, outputs, jobHandler, inDictionary, verbose=True): | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if these two lines are needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is needed when the printing of the dataset is not finished (e.g. point set) and this is triggered in the multi run step (right before exiting the step). We check here the index and the length in case the printing is finished before reaching the ned of the step