parsl 2024.4.1__py3-none-any.whl → 2024.4.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
parsl/dataflow/dflow.py CHANGED
@@ -714,14 +714,18 @@ class DataFlowKernel:
714
714
 
715
715
  if self.monitoring is not None and self.monitoring.resource_monitoring_enabled:
716
716
  wrapper_logging_level = logging.DEBUG if self.monitoring.monitoring_debug else logging.INFO
717
- (function, args, kwargs) = monitor_wrapper(function, args, kwargs, try_id, task_id,
718
- self.monitoring.monitoring_hub_url,
719
- self.run_id,
720
- wrapper_logging_level,
721
- self.monitoring.resource_monitoring_interval,
722
- executor.radio_mode,
723
- executor.monitor_resources(),
724
- self.run_dir)
717
+ (function, args, kwargs) = monitor_wrapper(f=function,
718
+ args=args,
719
+ kwargs=kwargs,
720
+ x_try_id=try_id,
721
+ x_task_id=task_id,
722
+ monitoring_hub_url=self.monitoring.monitoring_hub_url,
723
+ run_id=self.run_id,
724
+ logging_level=wrapper_logging_level,
725
+ sleep_dur=self.monitoring.resource_monitoring_interval,
726
+ radio_mode=executor.radio_mode,
727
+ monitor_resources=executor.monitor_resources(),
728
+ run_dir=self.run_dir)
725
729
 
726
730
  with self.submitter_lock:
727
731
  exec_fu = executor.submit(function, task_record['resource_specification'], *args, **kwargs)
@@ -1214,21 +1218,7 @@ class DataFlowKernel:
1214
1218
  self.job_status_poller.close()
1215
1219
  logger.info("Terminated job status poller")
1216
1220
 
1217
- logger.info("Scaling in and shutting down executors")
1218
-
1219
- for ef in self.job_status_poller._executor_facades:
1220
- if not ef.executor.bad_state_is_set:
1221
- logger.info(f"Scaling in executor {ef.executor.label}")
1222
-
1223
- # this code needs to be at least as many blocks as need
1224
- # cancelling, but it is safe to be more, as the scaling
1225
- # code will cope with being asked to cancel more blocks
1226
- # than exist.
1227
- block_count = len(ef.status)
1228
- ef.scale_in(block_count)
1229
-
1230
- else: # and bad_state_is_set
1231
- logger.warning(f"Not scaling in executor {ef.executor.label} because it is in bad state")
1221
+ logger.info("Shutting down executors")
1232
1222
 
1233
1223
  for executor in self.executors.values():
1234
1224
  logger.info(f"Shutting down executor {executor.label}")
@@ -102,12 +102,6 @@ class BlockProviderExecutor(ParslExecutor):
102
102
  else:
103
103
  return self._provider.status_polling_interval
104
104
 
105
- def _fail_job_async(self, block_id: str, message: str):
106
- """Marks a job that has failed to start but would not otherwise be included in status()
107
- as failed and report it in status()
108
- """
109
- self._simulated_status[block_id] = JobStatus(JobState.FAILED, message)
110
-
111
105
  @abstractproperty
112
106
  def outstanding(self) -> int:
113
107
  """This should return the number of tasks that the executor has been given to run (waiting to run, and running now)"""
@@ -198,8 +192,7 @@ class BlockProviderExecutor(ParslExecutor):
198
192
  self.job_ids_to_block[job_id] = block_id
199
193
  block_ids.append(block_id)
200
194
  except Exception as ex:
201
- self._fail_job_async(block_id,
202
- "Failed to start block {}: {}".format(block_id, ex))
195
+ self._simulated_status[block_id] = JobStatus(JobState.FAILED, "Failed to start block {}: {}".format(block_id, ex))
203
196
  return block_ids
204
197
 
205
198
  @abstractmethod
@@ -19,18 +19,16 @@ logger = logging.getLogger(__name__)
19
19
  class PolledExecutorFacade:
20
20
  def __init__(self, executor: BlockProviderExecutor, dfk: Optional["parsl.dataflow.dflow.DataFlowKernel"] = None):
21
21
  self._executor = executor
22
- self._dfk = dfk
23
22
  self._interval = executor.status_polling_interval
24
23
  self._last_poll_time = 0.0
25
24
  self._status = {} # type: Dict[str, JobStatus]
26
- self.first = True
27
25
 
28
26
  # Create a ZMQ channel to send poll status to monitoring
29
27
  self.monitoring_enabled = False
30
- if self._dfk and self._dfk.monitoring is not None:
28
+ if dfk and dfk.monitoring is not None:
31
29
  self.monitoring_enabled = True
32
- hub_address = self._dfk.hub_address
33
- hub_port = self._dfk.hub_zmq_port
30
+ hub_address = dfk.hub_address
31
+ hub_port = dfk.hub_zmq_port
34
32
  context = zmq.Context()
35
33
  self.hub_channel = context.socket(zmq.DEALER)
36
34
  self.hub_channel.set_hwm(0)
@@ -136,3 +134,19 @@ class JobStatusPoller(Timer):
136
134
  logger.debug("Adding executor {}".format(executor.label))
137
135
  self._executor_facades.append(PolledExecutorFacade(executor, self.dfk))
138
136
  self._strategy.add_executors(executors)
137
+
138
+ def close(self):
139
+ super().close()
140
+ for ef in self._executor_facades:
141
+ if not ef.executor.bad_state_is_set:
142
+ logger.info(f"Scaling in executor {ef.executor.label}")
143
+
144
+ # this code needs to be at least as many blocks as need
145
+ # cancelling, but it is safe to be more, as the scaling
146
+ # code will cope with being asked to cancel more blocks
147
+ # than exist.
148
+ block_count = len(ef.status)
149
+ ef.scale_in(block_count)
150
+
151
+ else: # and bad_state_is_set
152
+ logger.warning(f"Not scaling in executor {ef.executor.label} because it is in bad state")
parsl/jobs/strategy.py CHANGED
@@ -26,6 +26,10 @@ class ExecutorState(TypedDict):
26
26
  If the executor is not idle, then None.
27
27
  """
28
28
 
29
+ first: bool
30
+ """True if this executor has not yet had a strategy poll.
31
+ """
32
+
29
33
 
30
34
  class Strategy:
31
35
  """Scaling strategy.
@@ -144,17 +148,17 @@ class Strategy:
144
148
 
145
149
  def add_executors(self, executors: Sequence[ParslExecutor]) -> None:
146
150
  for executor in executors:
147
- self.executors[executor.label] = {'idle_since': None}
151
+ self.executors[executor.label] = {'idle_since': None, 'first': True}
148
152
 
149
153
  def _strategy_init_only(self, executor_facades: List[jsp.PolledExecutorFacade]) -> None:
150
154
  """Scale up to init_blocks at the start, then nothing more.
151
155
  """
152
156
  for ef in executor_facades:
153
- if ef.first:
154
- executor = ef.executor
157
+ executor = ef.executor
158
+ if self.executors[executor.label]['first']:
155
159
  logger.debug(f"strategy_init_only: scaling out {executor.provider.init_blocks} initial blocks for {executor.label}")
156
160
  ef.scale_out(executor.provider.init_blocks)
157
- ef.first = False
161
+ self.executors[executor.label]['first'] = False
158
162
  else:
159
163
  logger.debug("strategy_init_only: doing nothing")
160
164
 
@@ -190,11 +194,11 @@ class Strategy:
190
194
  continue
191
195
  logger.debug(f"Strategizing for executor {label}")
192
196
 
193
- if ef.first:
197
+ if self.executors[label]['first']:
194
198
  executor = ef.executor
195
199
  logger.debug(f"Scaling out {executor.provider.init_blocks} initial blocks for {label}")
196
200
  ef.scale_out(executor.provider.init_blocks)
197
- ef.first = False
201
+ self.executors[label]['first'] = False
198
202
 
199
203
  # Tasks that are either pending completion
200
204
  active_tasks = executor.outstanding
@@ -15,7 +15,8 @@ from typing import Any, Callable, Dict, List, Sequence, Tuple
15
15
  logger = logging.getLogger(__name__)
16
16
 
17
17
 
18
- def monitor_wrapper(f: Any, # per app
18
+ def monitor_wrapper(*,
19
+ f: Any, # per app
19
20
  args: Sequence, # per invocation
20
21
  kwargs: Dict, # per invocation
21
22
  x_try_id: int, # per invocation
parsl/version.py CHANGED
@@ -3,4 +3,4 @@
3
3
  Year.Month.Day[alpha/beta/..]
4
4
  Alphas will be numbered like this -> 2024.12.10a0
5
5
  """
6
- VERSION = '2024.04.01'
6
+ VERSION = '2024.04.08'
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: parsl
3
- Version: 2024.4.1
3
+ Version: 2024.4.8
4
4
  Summary: Simple data dependent workflows in Python
5
5
  Home-page: https://github.com/Parsl/parsl
6
- Download-URL: https://github.com/Parsl/parsl/archive/2024.04.01.tar.gz
6
+ Download-URL: https://github.com/Parsl/parsl/archive/2024.04.08.tar.gz
7
7
  Author: The Parsl Team
8
8
  Author-email: parsl@googlegroups.com
9
9
  License: Apache 2.0
@@ -8,7 +8,7 @@ parsl/multiprocessing.py,sha256=hakfdg-sgxEjwloZeDrt6EhzwdzecvjJhkPHHxh8lII,1938
8
8
  parsl/process_loggers.py,sha256=1G3Rfrh5wuZNo2X03grG4kTYPGOxz7hHCyG6L_A3b0A,1137
9
9
  parsl/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  parsl/utils.py,sha256=A3WDMGaNB4ajVx_jCuc-74W6PFy4zswJy-pLE7u8Dz0,10979
11
- parsl/version.py,sha256=2xAmun0db7lx3hTmt30wYML-vGWWFXBqeVr7_i8j3Ac,131
11
+ parsl/version.py,sha256=ahe277o-2uHeGXWS6lLdiHiTpTRqrLfBk6sTJtXZeNQ,131
12
12
  parsl/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  parsl/app/app.py,sha256=wAHchJetgnicT1pn0NJKDeDX0lV3vDFlG8cQd_Ciax4,8522
14
14
  parsl/app/bash.py,sha256=bx9x1XFwkOTpZZD3CPwnVL9SyNRDjbUGtOnuGLvxN_8,5396
@@ -60,7 +60,7 @@ parsl/data_provider/http.py,sha256=nDHTW7XmJqAukWJjPRQjyhUXt8r6GsQ36mX9mv_wOig,2
60
60
  parsl/data_provider/rsync.py,sha256=2-ZxqrT-hBj39x082NusJaBqsGW4Jd2qCW6JkVPpEl0,4254
61
61
  parsl/data_provider/staging.py,sha256=l-mAXFburs3BWPjkSmiQKuAgJpsxCG62yATPDbrafYI,4523
62
62
  parsl/dataflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
- parsl/dataflow/dflow.py,sha256=N72pg1yxgICjOAQVsTN_n3PwTaE2MYfPcc8MUTc8oMA,63593
63
+ parsl/dataflow/dflow.py,sha256=FRsenqapR1uRR_6YU8bjqsENyTDMF7I9PftzLopOVzY,63254
64
64
  parsl/dataflow/errors.py,sha256=w2vOt_ymzG2dOqJUO4IDcmTlrCIHlMZL8nBVyVq0O_8,2176
65
65
  parsl/dataflow/futures.py,sha256=aVfEUTzp4-EdunDAtNcqVQf8l_A7ArDi2c82KZMwxfY,5256
66
66
  parsl/dataflow/memoization.py,sha256=AsJO6c6cRp2ac6H8uGn2USlEi78_nX3QWvpxYt4XdYE,9583
@@ -70,7 +70,7 @@ parsl/dataflow/taskrecord.py,sha256=bzIBmlDTsRrELtB9PUQwxTWcwrCd8aMsUAzvijle1eo,
70
70
  parsl/executors/__init__.py,sha256=J50N97Nm9YRjz6K0oNXDxUYIsDjL43_tp3LVb2w7n-M,381
71
71
  parsl/executors/base.py,sha256=AFX7AlMbOoXaImrttO74vhNWhbJwu41JFS5EaWPl8fg,4559
72
72
  parsl/executors/errors.py,sha256=xVswxgi7vmJcUMCeYDAPK8sQT2kHFFROVoOr0dnmcWE,2098
73
- parsl/executors/status_handling.py,sha256=RRPDFOCxrQT8_5XTpF5-keml4pttxX1rxztZGaJ1Wzw,10620
73
+ parsl/executors/status_handling.py,sha256=8G0QBkcB271bR_UMTUh9lHE3EguMKQNdcQ8BrSR8Cwg,10322
74
74
  parsl/executors/threads.py,sha256=bMU3JFghm17Lpcua13pr3NgQhkUDDc2mqvF2yJBrVNQ,3353
75
75
  parsl/executors/flux/__init__.py,sha256=P9grTTeRPXfqXurFhlSS7XhmE6tTbnCnyQ1f9b-oYHE,136
76
76
  parsl/executors/flux/execute_parsl_task.py,sha256=yUG_WjZLcX8LrgPl26mpEBWZhQMlVNbRLGu08yIjdf4,1553
@@ -110,9 +110,9 @@ parsl/executors/workqueue/parsl_coprocess_stub.py,sha256=_bJmpPIgL42qM6bVzeEKt1M
110
110
  parsl/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
111
111
  parsl/jobs/error_handlers.py,sha256=WcWZUA7KyE1ocX5zrMf_EwqOob8Jb7uHMjD3nlb_BUo,2319
112
112
  parsl/jobs/errors.py,sha256=cpSQXCrlKtuHsQf7usjF-lX8XsDkFnE5kWpmFjiN6OU,178
113
- parsl/jobs/job_status_poller.py,sha256=owi712XlFEBLNEb-uSXq0hoCWm1Qgbq2cFMScc98w9I,5526
113
+ parsl/jobs/job_status_poller.py,sha256=4aWn_IO1A7NHxzbFT2Mm9Cvk0V1f2mzNxCEXJBQDtS8,6143
114
114
  parsl/jobs/states.py,sha256=rPBoAEEudKngWFijlwvXXhAagDs_9DCXvQP9rwzVgCM,4855
115
- parsl/jobs/strategy.py,sha256=Jgz5H0sFLhAhFxqp6UCTihpDgG-HGp7NGz0ynXOmDSo,13656
115
+ parsl/jobs/strategy.py,sha256=-rumnV3-p_SSGR9532nh-KZK5P2yxEZs2FhCqxvIIPo,13860
116
116
  parsl/launchers/__init__.py,sha256=k8zAB3IBP-brfqXUptKwGkvsIRaXjAJZNBJa2XVtY1A,546
117
117
  parsl/launchers/base.py,sha256=CblcvPTJiu-MNLWaRtFe29SZQ0BpTOlaY8CGcHdlHIE,538
118
118
  parsl/launchers/errors.py,sha256=v5i460H_rovzukSccQetxQBVtd92jLQz-NbuDe2TdGI,467
@@ -122,7 +122,7 @@ parsl/monitoring/db_manager.py,sha256=hdmmXSTXp8Wwhr7vLpQalD_ahRl3SNxKYVsplnThRk
122
122
  parsl/monitoring/message_type.py,sha256=Khn88afNxcOIciKiCK4GLnn90I5BlRTiOL3zK-P07yQ,401
123
123
  parsl/monitoring/monitoring.py,sha256=5R3-T4vtxedwQnde5aK6MVssKvjf_VU17S0gcft6oAc,13422
124
124
  parsl/monitoring/radios.py,sha256=T2_6QuUjC-dd_7qMnIk6WHQead1iWz7m_P6ZC4QAqdA,5265
125
- parsl/monitoring/remote.py,sha256=OcIgudujtPO_DsY-YV36x92skeiNdGt-6aEOqaCU8T0,13900
125
+ parsl/monitoring/remote.py,sha256=0wqANMcuvq3dpja3agdbOzD72n5oUYp7PcNKyLCC35E,13923
126
126
  parsl/monitoring/router.py,sha256=Y_PJjffS23HwfTJClhg5W4gUXnkAI_3crjjZMoyzxVA,9592
127
127
  parsl/monitoring/types.py,sha256=SO6Fjjbb83sv_MtbutoxGssiWh6oXKkEEsD4EvwOnZ4,629
128
128
  parsl/monitoring/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -443,12 +443,12 @@ parsl/tests/test_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
443
443
  parsl/tests/test_utils/test_representation_mixin.py,sha256=kUZeIDwA2rlbJ3-beGzLLwf3dOplTMCrWJN87etHcyY,1633
444
444
  parsl/usage_tracking/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
445
445
  parsl/usage_tracking/usage.py,sha256=pSADeogWqvkYI_n2pojv4IWDEFAQ3KwXNx6LDTohMHQ,6684
446
- parsl-2024.4.1.data/scripts/exec_parsl_function.py,sha256=NtWNeBvRqksej38eRPw8zPBJ1CeW6vgaitve0tfz_qc,7801
447
- parsl-2024.4.1.data/scripts/parsl_coprocess.py,sha256=Y7Tc-h9WGui-YDe3w_h91w2Sm1JNL1gJ9kAV4PE_gw8,5722
448
- parsl-2024.4.1.data/scripts/process_worker_pool.py,sha256=V3K4admJ7QvwR9sN0GH-c6uOTgNU8zVb76q872WtYCo,41207
449
- parsl-2024.4.1.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
450
- parsl-2024.4.1.dist-info/METADATA,sha256=kM9BKd2VQ5ij6tV9au1Z1GvCH9MZcB7UWNo_YJVbqTA,3973
451
- parsl-2024.4.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
452
- parsl-2024.4.1.dist-info/entry_points.txt,sha256=XqnsWDYoEcLbsMcpnYGKLEnSBmaIe1YoM5YsBdJG2tI,176
453
- parsl-2024.4.1.dist-info/top_level.txt,sha256=PIheYoUFQtF2icLsgOykgU-Cjuwr2Oi6On2jo5RYgRM,6
454
- parsl-2024.4.1.dist-info/RECORD,,
446
+ parsl-2024.4.8.data/scripts/exec_parsl_function.py,sha256=NtWNeBvRqksej38eRPw8zPBJ1CeW6vgaitve0tfz_qc,7801
447
+ parsl-2024.4.8.data/scripts/parsl_coprocess.py,sha256=Y7Tc-h9WGui-YDe3w_h91w2Sm1JNL1gJ9kAV4PE_gw8,5722
448
+ parsl-2024.4.8.data/scripts/process_worker_pool.py,sha256=V3K4admJ7QvwR9sN0GH-c6uOTgNU8zVb76q872WtYCo,41207
449
+ parsl-2024.4.8.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
450
+ parsl-2024.4.8.dist-info/METADATA,sha256=iCcfSeM8LvJdXuanu5jEEGo_H-wXXz56VWD0iCzUYfg,3973
451
+ parsl-2024.4.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
452
+ parsl-2024.4.8.dist-info/entry_points.txt,sha256=XqnsWDYoEcLbsMcpnYGKLEnSBmaIe1YoM5YsBdJG2tI,176
453
+ parsl-2024.4.8.dist-info/top_level.txt,sha256=PIheYoUFQtF2icLsgOykgU-Cjuwr2Oi6On2jo5RYgRM,6
454
+ parsl-2024.4.8.dist-info/RECORD,,