Add support for bootstrapping remote namespace based on code from Problem or Dispatcher.

This commit is contained in:
Brendan Smithyman
2015-05-07 14:01:46 -04:00
parent dc7b102550
commit d5cb4adf1f
+4 -7
View File
@@ -250,7 +250,7 @@ class SystemSolver(object):
class RemoteInterface(object):
def __init__(self, profile=None, MPI=None, nThreads=1):
def __init__(self, profile=None, MPI=None, nThreads=1, bootstrap=None):
# TODO: Add interface for namespace bootstrapping from
# the dispatcher / problem side
@@ -315,12 +315,9 @@ class RemoteInterface(object):
self.nThreads = nThreads
# Generate 'par' object for Problem to grab
self.par = {
'pclient': self.pclient,
'dview': self.dview,
'lview': self.pclient.load_balanced_view(),
}
if bootstrap is not None:
for command in bootstrap.strip().split('\n'):
dview.execute(command.strip())
@property
def nThreads(self):