4949from parsl .monitoring .remote import monitor_wrapper
5050from parsl .process_loggers import wrap_with_logs
5151from parsl .usage_tracking .usage import UsageTracker
52- from parsl .utils import Timer , get_std_fname_mode , get_version
52+ from parsl .utils import get_std_fname_mode , get_version
5353
5454logger = logging .getLogger (__name__ )
5555
@@ -167,13 +167,13 @@ def __init__(self, config: Config) -> None:
167167
168168 # TODO: the parameters that remain here should be parameters that are going to be configured by
169169 # the user as part of checkpoint/memo configuration object.
170- self .memoizer = Memoizer (memoize = config .app_cache , checkpoint_mode = config .checkpoint_mode , checkpoint_files = config .checkpoint_files )
170+ self .memoizer = Memoizer (memoize = config .app_cache ,
171+ checkpoint_mode = config .checkpoint_mode ,
172+ checkpoint_files = config .checkpoint_files ,
173+ checkpoint_period = config .checkpoint_period )
171174 self .memoizer .run_dir = self .run_dir
172175 self .memoizer .start ()
173176
174- # TODO: this block needs to move too
175- self ._checkpoint_timer = None
176- self .checkpoint_mode = config .checkpoint_mode
177177 self ._modify_checkpointable_tasks_lock = threading .Lock ()
178178
179179 # this must be set before executors are added since add_executors calls
@@ -190,17 +190,6 @@ def __init__(self, config: Config) -> None:
190190 self .add_executors (config .executors )
191191 self .add_executors ([parsl_internal_executor ])
192192
193- if self .checkpoint_mode == "periodic" :
194- if config .checkpoint_period is None :
195- raise ConfigurationError ("Checkpoint period must be specified with periodic checkpoint mode" )
196- else :
197- try :
198- h , m , s = map (int , config .checkpoint_period .split (':' ))
199- except Exception :
200- raise ConfigurationError ("invalid checkpoint_period provided: {0} expected HH:MM:SS" .format (config .checkpoint_period ))
201- checkpoint_period = (h * 3600 ) + (m * 60 ) + s
202- self ._checkpoint_timer = Timer (self .checkpoint , interval = checkpoint_period , name = "Checkpoint" )
203-
204193 self .task_count = 0
205194 self .tasks : Dict [int , TaskRecord ] = {}
206195 self .submitter_lock = threading .Lock ()
@@ -1187,16 +1176,7 @@ def cleanup(self) -> None:
11871176
11881177 self .log_task_states ()
11891178
1190- # checkpoint if any valid checkpoint method is specified
1191- if self .checkpoint_mode is not None :
1192-
1193- # TODO: accesses to self.checkpointable_tasks should happen
1194- # under a lock?
1195- self .memoizer .checkpoint ()
1196-
1197- if self ._checkpoint_timer :
1198- logger .info ("Stopping checkpoint timer" )
1199- self ._checkpoint_timer .close ()
1179+ self .memoizer .close ()
12001180
12011181 # Send final stats
12021182 self .usage_tracker .send_end_message ()
0 commit comments