File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1- import parsl
1+ # def wait():
2+ # print('asdlfkjaslkdf')
3+ # import time
4+ # time.sleep(3)
5+ # #import parsl
6+ # #parsl.wait_for_current_tasks()
7+ #
8+ # import atexit
9+ # atexit.register(wait)
210
311from .execution import ExecutionContextLoader , load_from_yaml # noqa: F401
412
513load = ExecutionContextLoader .load
614parse_config = ExecutionContextLoader .parse_config
715context = ExecutionContextLoader .context
8- wait = parsl . wait_for_current_tasks
16+ wait = ExecutionContextLoader . wait
Original file line number Diff line number Diff line change 11from __future__ import annotations # necessary for type-guarding class methods
22
3- import atexit
43import copy
54import logging
65import math
@@ -447,7 +446,6 @@ def load(
447446 )
448447 path_context = path / "context_dir"
449448 cls ._context = ExecutionContext (config , definitions , path_context )
450- atexit .register (parsl .wait_for_current_tasks )
451449 return cls ._context
452450
453451 @classmethod
@@ -456,6 +454,10 @@ def context(cls):
456454 raise RuntimeError ("No ExecutionContext is currently loaded" )
457455 return cls ._context
458456
457+ @classmethod
458+ def wait (cls ):
459+ parsl .wait_for_current_tasks ()
460+
459461
460462def load_from_yaml (path : Union [str , Path ]) -> ExecutionContext :
461463 assert ExecutionContextLoader ._context is None # no previously loaded context
You can’t perform that action at this time.
0 commit comments