From d5cb4adf1fdba88dd1845b6c7851fe28fa5bf2dc Mon Sep 17 00:00:00 2001 From: Brendan Smithyman Date: Thu, 7 May 2015 14:01:46 -0400 Subject: [PATCH] Add support for bootstrapping remote namespace based on code from Problem or Dispatcher. --- SimPEG/Parallel.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/SimPEG/Parallel.py b/SimPEG/Parallel.py index 87f4be48..e0c9352c 100644 --- a/SimPEG/Parallel.py +++ b/SimPEG/Parallel.py @@ -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):