-
Notifications
You must be signed in to change notification settings - Fork 27
Refactor/user function handling modules + Manager can run additional worker on thread #1216
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
Conversation
…n-place launches, but based on the contents of passed-in specs, instantiates the relevant subclass
…ly. update unit test
… user function. corresponding unit test
…" management routines from manager.py into pipelines.py
…ng utils.pipelines
…start a temporary, local Worker for handling work
… gen work to local worker thread
…_gen, add in Worker wrapper class to manager, but not used yet
…ption to libE_specs
…of a split stats line if the line is a Manager: starting or Manager: exiting line
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1216 +/- ##
============================================
+ Coverage 72.59% 93.50% +20.91%
============================================
Files 90 90
Lines 8153 8212 +59
Branches 1457 1469 +12
============================================
+ Hits 5919 7679 +1760
+ Misses 1998 323 -1675
+ Partials 236 210 -26 ☔ View full report in Codecov by Sentry. |
libensemble/manager.py
Outdated
"""Wrapper class for Worker array and worker comms""" | ||
|
||
def __init__(self, W: npt.NDArray, wid: int, wcomms: list = []): | ||
self.__dict__["_W"] = W |
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.
How different from self._W = W
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 overloaded __getattr__
, which is called for .attribute
access even in the constructor. This is a workaround.
From a quick look, I don't understand the number of calls to the _Worker constructor. Dont we just need to create one wrapper object? This could use the class _Worker:
def __init__(self, W, manager_as_worker=False):
self.W = W
self.manager_as_worker = manager_as_worker
def __getitem__(self, key):
if self.manager_as_worker:
return self.W[key]
else:
return self.W[key - 1] This object can be an attribute of manager class, dont need to pass around. |
…t". So for updating purposes for libE_specs, we want to exclude fields that are still set to their defaults
…convert LibeSpecs to dict, so lets save it and reinsert
…ctor/user_function_handling_modules
…_uniform_sampling_cancel
… multiple gen work orders aren't given out at once
|
…sim work on non-gen-workers
Addresses #1166
User - Manager runs local worker on thread - Gen Worker 0
The manager can start an additional worker thread with the worker ID 0.
This worker is, via
W["gen_worker"] = True
, and filtering options, made to run gens only.Tentative interface:
libE_specs["gen_on_manager"] = True
Internal - Refactor runners.py
Largely refactors utils/runners.py so additional "Runners" for user functions can be more easily developed/extended.
GlobusComputeRunner and ThreadRunner inherit from Runner.
Runner inspects the contents of the input sim/gen specs and instantiates the correct subclass on the left-hand-side:
Internal - _WorkerIndexer class for indexing into worker arrays
Internal - Workers can be assigned gen_worker.