File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -293,11 +293,26 @@ def _profile_config_default(self):
293
293
294
294
from .app import BaseParallelApplication , IPClusterStart
295
295
296
+ # look up if we are descended from an 'ipcluster' app
297
+ # avoids repeated load of the current profile dir
298
+ parents = []
299
+ parent = self .parent
300
+ while parent is not None :
301
+ parents .append (parent )
302
+ parent = parent .parent
303
+
304
+ app_parents = list (
305
+ filter (lambda p : isinstance (p , BaseParallelApplication ), parents )
306
+ )
307
+ if app_parents :
308
+ app_parent = app_parents [0 ]
309
+ else :
310
+ app_parent = None
311
+
296
312
if (
297
- self .parent
298
- and isinstance (self .parent , BaseParallelApplication )
299
- and self .parent .name == 'ipcluster'
300
- and self .parent .profile_dir .location == self .profile_dir
313
+ app_parent
314
+ and app_parent .name == 'ipcluster'
315
+ and app_parent .profile_dir .location == self .profile_dir
301
316
):
302
317
# profile config already loaded by parent, nothing new to load
303
318
return Config ()
@@ -308,7 +323,7 @@ def _profile_config_default(self):
308
323
config .ProfileDir .location = self .profile_dir
309
324
310
325
# load profile config via IPCluster
311
- app = IPClusterStart (config = config , log = self .log , log_level = 10 )
326
+ app = IPClusterStart (config = config , log = self .log )
312
327
# adds profile dir to config_files_path
313
328
app .init_profile_dir ()
314
329
# adds system to config_files_path
You can’t perform that action at this time.
0 commit comments