parsl 2024.5.27__py3-none-any.whl → 2024.6.10__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.
Files changed (289) hide show
  1. parsl/__init__.py +9 -10
  2. parsl/addresses.py +6 -4
  3. parsl/app/app.py +3 -6
  4. parsl/app/bash.py +4 -4
  5. parsl/app/errors.py +5 -3
  6. parsl/app/futures.py +3 -3
  7. parsl/app/python.py +2 -1
  8. parsl/benchmark/perf.py +2 -1
  9. parsl/channels/__init__.py +2 -2
  10. parsl/channels/base.py +0 -1
  11. parsl/channels/errors.py +2 -1
  12. parsl/channels/oauth_ssh/oauth_ssh.py +4 -3
  13. parsl/channels/ssh/ssh.py +9 -1
  14. parsl/channels/ssh_il/ssh_il.py +1 -0
  15. parsl/concurrent/__init__.py +2 -2
  16. parsl/config.py +32 -9
  17. parsl/configs/ASPIRE1.py +3 -3
  18. parsl/configs/Azure.py +6 -7
  19. parsl/configs/ad_hoc.py +4 -3
  20. parsl/configs/bridges.py +3 -3
  21. parsl/configs/cc_in2p3.py +2 -2
  22. parsl/configs/ec2.py +1 -1
  23. parsl/configs/expanse.py +1 -2
  24. parsl/configs/frontera.py +2 -3
  25. parsl/configs/htex_local.py +1 -2
  26. parsl/configs/illinoiscluster.py +1 -1
  27. parsl/configs/kubernetes.py +1 -2
  28. parsl/configs/midway.py +3 -3
  29. parsl/configs/osg.py +1 -1
  30. parsl/configs/polaris.py +1 -1
  31. parsl/configs/stampede2.py +4 -5
  32. parsl/configs/summit.py +1 -3
  33. parsl/configs/toss3_llnl.py +1 -2
  34. parsl/configs/vineex_local.py +3 -3
  35. parsl/configs/wqex_local.py +2 -2
  36. parsl/data_provider/data_manager.py +3 -3
  37. parsl/data_provider/file_noop.py +1 -2
  38. parsl/data_provider/files.py +3 -3
  39. parsl/data_provider/ftp.py +1 -3
  40. parsl/data_provider/globus.py +7 -6
  41. parsl/data_provider/http.py +2 -2
  42. parsl/data_provider/rsync.py +1 -1
  43. parsl/data_provider/staging.py +2 -2
  44. parsl/data_provider/zip.py +4 -5
  45. parsl/dataflow/dflow.py +57 -26
  46. parsl/dataflow/errors.py +2 -1
  47. parsl/dataflow/futures.py +1 -2
  48. parsl/dataflow/memoization.py +5 -5
  49. parsl/dataflow/rundirs.py +1 -1
  50. parsl/dataflow/taskrecord.py +4 -5
  51. parsl/executors/__init__.py +3 -3
  52. parsl/executors/base.py +1 -0
  53. parsl/executors/flux/execute_parsl_task.py +2 -2
  54. parsl/executors/flux/executor.py +11 -12
  55. parsl/executors/flux/flux_instance_manager.py +3 -3
  56. parsl/executors/high_throughput/executor.py +31 -36
  57. parsl/executors/high_throughput/interchange.py +37 -38
  58. parsl/executors/high_throughput/manager_record.py +1 -0
  59. parsl/executors/high_throughput/monitoring_info.py +2 -1
  60. parsl/executors/high_throughput/mpi_executor.py +5 -2
  61. parsl/executors/high_throughput/mpi_prefix_composer.py +1 -1
  62. parsl/executors/high_throughput/mpi_resource_management.py +1 -2
  63. parsl/executors/high_throughput/probe.py +6 -4
  64. parsl/executors/high_throughput/process_worker_pool.py +31 -20
  65. parsl/executors/high_throughput/zmq_pipes.py +28 -14
  66. parsl/executors/radical/executor.py +15 -15
  67. parsl/executors/radical/rpex_master.py +1 -2
  68. parsl/executors/radical/rpex_resources.py +1 -2
  69. parsl/executors/radical/rpex_worker.py +2 -1
  70. parsl/executors/status_handling.py +5 -4
  71. parsl/executors/taskvine/__init__.py +1 -1
  72. parsl/executors/taskvine/errors.py +1 -1
  73. parsl/executors/taskvine/exec_parsl_function.py +2 -2
  74. parsl/executors/taskvine/executor.py +23 -24
  75. parsl/executors/taskvine/factory.py +1 -1
  76. parsl/executors/taskvine/manager.py +11 -13
  77. parsl/executors/threads.py +4 -5
  78. parsl/executors/workqueue/errors.py +1 -1
  79. parsl/executors/workqueue/exec_parsl_function.py +5 -4
  80. parsl/executors/workqueue/executor.py +26 -27
  81. parsl/executors/workqueue/parsl_coprocess.py +1 -1
  82. parsl/jobs/error_handlers.py +1 -1
  83. parsl/jobs/job_status_poller.py +2 -5
  84. parsl/jobs/states.py +1 -1
  85. parsl/jobs/strategy.py +2 -2
  86. parsl/launchers/__init__.py +12 -3
  87. parsl/launchers/errors.py +1 -1
  88. parsl/log_utils.py +1 -2
  89. parsl/monitoring/db_manager.py +16 -10
  90. parsl/monitoring/monitoring.py +11 -15
  91. parsl/monitoring/queries/pandas.py +1 -2
  92. parsl/monitoring/radios.py +2 -4
  93. parsl/monitoring/remote.py +13 -8
  94. parsl/monitoring/router.py +8 -11
  95. parsl/monitoring/types.py +2 -0
  96. parsl/monitoring/visualization/app.py +4 -2
  97. parsl/monitoring/visualization/models.py +0 -1
  98. parsl/monitoring/visualization/plots/default/workflow_plots.py +8 -4
  99. parsl/monitoring/visualization/plots/default/workflow_resource_plots.py +1 -0
  100. parsl/monitoring/visualization/utils.py +0 -1
  101. parsl/monitoring/visualization/views.py +16 -9
  102. parsl/multiprocessing.py +0 -1
  103. parsl/process_loggers.py +1 -2
  104. parsl/providers/__init__.py +9 -12
  105. parsl/providers/ad_hoc/ad_hoc.py +1 -1
  106. parsl/providers/aws/aws.py +2 -3
  107. parsl/providers/azure/azure.py +4 -5
  108. parsl/providers/base.py +1 -1
  109. parsl/providers/cluster_provider.py +1 -1
  110. parsl/providers/cobalt/cobalt.py +3 -3
  111. parsl/providers/condor/condor.py +4 -2
  112. parsl/providers/errors.py +2 -2
  113. parsl/providers/googlecloud/googlecloud.py +2 -1
  114. parsl/providers/grid_engine/grid_engine.py +2 -2
  115. parsl/providers/kubernetes/kube.py +24 -9
  116. parsl/providers/local/local.py +5 -1
  117. parsl/providers/lsf/lsf.py +2 -2
  118. parsl/providers/pbspro/pbspro.py +1 -1
  119. parsl/providers/slurm/slurm.py +36 -27
  120. parsl/providers/torque/torque.py +1 -1
  121. parsl/serialize/__init__.py +8 -3
  122. parsl/serialize/base.py +1 -2
  123. parsl/serialize/concretes.py +5 -4
  124. parsl/serialize/proxystore.py +3 -2
  125. parsl/tests/__init__.py +1 -1
  126. parsl/tests/configs/ad_hoc_cluster_htex.py +4 -4
  127. parsl/tests/configs/azure_single_node.py +4 -5
  128. parsl/tests/configs/bridges.py +3 -2
  129. parsl/tests/configs/cc_in2p3.py +2 -2
  130. parsl/tests/configs/comet.py +2 -1
  131. parsl/tests/configs/ec2_single_node.py +1 -2
  132. parsl/tests/configs/ec2_spot.py +1 -2
  133. parsl/tests/configs/flux_local.py +11 -0
  134. parsl/tests/configs/frontera.py +3 -2
  135. parsl/tests/configs/htex_ad_hoc_cluster.py +2 -4
  136. parsl/tests/configs/htex_local.py +2 -3
  137. parsl/tests/configs/htex_local_alternate.py +8 -11
  138. parsl/tests/configs/htex_local_intask_staging.py +5 -7
  139. parsl/tests/configs/htex_local_rsync_staging.py +4 -6
  140. parsl/tests/configs/local_adhoc.py +1 -1
  141. parsl/tests/configs/local_radical.py +1 -3
  142. parsl/tests/configs/local_radical_mpi.py +2 -2
  143. parsl/tests/configs/midway.py +2 -2
  144. parsl/tests/configs/nscc_singapore.py +3 -3
  145. parsl/tests/configs/osg_htex.py +1 -1
  146. parsl/tests/configs/petrelkube.py +3 -2
  147. parsl/tests/configs/summit.py +1 -0
  148. parsl/tests/configs/swan_htex.py +2 -2
  149. parsl/tests/configs/taskvine_ex.py +3 -5
  150. parsl/tests/configs/theta.py +2 -2
  151. parsl/tests/configs/workqueue_ex.py +3 -4
  152. parsl/tests/conftest.py +8 -4
  153. parsl/tests/integration/test_channels/test_ssh_errors.py +1 -1
  154. parsl/tests/integration/test_stress/test_python_simple.py +3 -4
  155. parsl/tests/integration/test_stress/test_python_threads.py +3 -5
  156. parsl/tests/manual_tests/htex_local.py +4 -4
  157. parsl/tests/manual_tests/test_ad_hoc_htex.py +2 -1
  158. parsl/tests/manual_tests/test_basic.py +1 -0
  159. parsl/tests/manual_tests/test_fan_in_out_htex_remote.py +4 -4
  160. parsl/tests/manual_tests/test_log_filter.py +3 -1
  161. parsl/tests/manual_tests/test_memory_limits.py +6 -6
  162. parsl/tests/manual_tests/test_regression_220.py +2 -1
  163. parsl/tests/manual_tests/test_udp_simple.py +4 -3
  164. parsl/tests/manual_tests/test_worker_count.py +3 -2
  165. parsl/tests/scaling_tests/htex_local.py +2 -2
  166. parsl/tests/scaling_tests/test_scale.py +0 -9
  167. parsl/tests/scaling_tests/vineex_condor.py +1 -2
  168. parsl/tests/scaling_tests/vineex_local.py +1 -2
  169. parsl/tests/site_tests/test_provider.py +3 -1
  170. parsl/tests/site_tests/test_site.py +2 -0
  171. parsl/tests/sites/test_affinity.py +7 -5
  172. parsl/tests/sites/test_dynamic_executor.py +3 -3
  173. parsl/tests/sites/test_ec2.py +3 -2
  174. parsl/tests/sites/test_local_adhoc.py +2 -1
  175. parsl/tests/sites/test_worker_info.py +4 -3
  176. parsl/tests/test_aalst_patterns.py +0 -1
  177. parsl/tests/test_bash_apps/test_apptimeout.py +2 -2
  178. parsl/tests/test_bash_apps/test_error_codes.py +1 -4
  179. parsl/tests/test_bash_apps/test_memoize_ignore_args.py +1 -0
  180. parsl/tests/test_bash_apps/test_memoize_ignore_args_regr.py +2 -2
  181. parsl/tests/test_bash_apps/test_pipeline.py +1 -1
  182. parsl/tests/test_bash_apps/test_std_uri.py +4 -3
  183. parsl/tests/test_bash_apps/test_stdout.py +20 -2
  184. parsl/tests/test_callables.py +2 -2
  185. parsl/tests/test_checkpointing/test_python_checkpoint_1.py +1 -0
  186. parsl/tests/test_checkpointing/test_python_checkpoint_2.py +2 -1
  187. parsl/tests/test_checkpointing/test_regression_239.py +1 -1
  188. parsl/tests/test_checkpointing/test_task_exit.py +1 -1
  189. parsl/tests/test_docs/test_from_slides.py +2 -2
  190. parsl/tests/test_docs/test_kwargs.py +1 -1
  191. parsl/tests/test_docs/test_tutorial_1.py +1 -2
  192. parsl/tests/test_docs/test_workflow1.py +2 -2
  193. parsl/tests/test_docs/test_workflow2.py +0 -1
  194. parsl/tests/test_error_handling/test_rand_fail.py +2 -2
  195. parsl/tests/test_error_handling/test_resource_spec.py +4 -2
  196. parsl/tests/test_error_handling/test_retries.py +2 -1
  197. parsl/tests/test_error_handling/test_retry_handler.py +1 -0
  198. parsl/tests/test_error_handling/test_retry_handler_failure.py +2 -1
  199. parsl/tests/test_error_handling/test_serialization_fail.py +1 -1
  200. parsl/tests/test_error_handling/test_wrap_with_logs.py +1 -0
  201. parsl/tests/test_flux.py +1 -1
  202. parsl/tests/test_htex/test_command_client_timeout.py +9 -12
  203. parsl/tests/test_htex/test_connected_blocks.py +3 -2
  204. parsl/tests/test_htex/test_cpu_affinity_explicit.py +5 -2
  205. parsl/tests/test_htex/test_disconnected_blocks.py +6 -4
  206. parsl/tests/test_htex/test_drain.py +5 -5
  207. parsl/tests/test_htex/test_htex.py +1 -2
  208. parsl/tests/test_htex/test_managers_command.py +3 -2
  209. parsl/tests/test_htex/test_multiple_disconnected_blocks.py +6 -4
  210. parsl/tests/test_htex/test_zmq_binding.py +22 -6
  211. parsl/tests/test_monitoring/test_app_names.py +3 -2
  212. parsl/tests/test_monitoring/test_basic.py +4 -4
  213. parsl/tests/test_monitoring/test_db_locks.py +6 -3
  214. parsl/tests/test_monitoring/test_fuzz_zmq.py +6 -3
  215. parsl/tests/test_monitoring/test_htex_init_blocks_vs_monitoring.py +5 -5
  216. parsl/tests/test_monitoring/test_incomplete_futures.py +5 -3
  217. parsl/tests/test_monitoring/test_memoization_representation.py +4 -1
  218. parsl/tests/test_monitoring/test_stdouterr.py +4 -4
  219. parsl/tests/test_monitoring/test_viz_colouring.py +1 -0
  220. parsl/tests/test_mpi_apps/test_bad_mpi_config.py +1 -1
  221. parsl/tests/test_mpi_apps/test_mpi_mode_disabled.py +2 -0
  222. parsl/tests/test_mpi_apps/test_mpi_mode_enabled.py +7 -5
  223. parsl/tests/test_mpi_apps/test_mpi_prefix.py +4 -4
  224. parsl/tests/test_mpi_apps/test_mpi_scheduler.py +7 -2
  225. parsl/tests/test_mpi_apps/test_mpiex.py +4 -3
  226. parsl/tests/test_mpi_apps/test_resource_spec.py +9 -10
  227. parsl/tests/test_providers/test_cobalt_deprecation_warning.py +2 -0
  228. parsl/tests/test_providers/test_local_provider.py +2 -1
  229. parsl/tests/test_providers/test_pbspro_template.py +1 -1
  230. parsl/tests/test_providers/test_slurm_template.py +1 -1
  231. parsl/tests/test_providers/test_submiterror_deprecation.py +2 -1
  232. parsl/tests/test_python_apps/test_context_manager.py +99 -3
  233. parsl/tests/test_python_apps/test_dep_standard_futures.py +2 -1
  234. parsl/tests/test_python_apps/test_dependencies_deep.py +59 -0
  235. parsl/tests/test_python_apps/test_futures.py +2 -1
  236. parsl/tests/test_python_apps/test_join.py +0 -1
  237. parsl/tests/test_python_apps/test_lifted.py +3 -3
  238. parsl/tests/test_python_apps/test_memoize_bad_id_for_memo.py +1 -0
  239. parsl/tests/test_python_apps/test_pluggable_future_resolution.py +1 -1
  240. parsl/tests/test_radical/test_mpi_funcs.py +1 -2
  241. parsl/tests/test_regression/test_1480.py +2 -1
  242. parsl/tests/test_regression/test_1653.py +2 -1
  243. parsl/tests/test_regression/test_2652.py +1 -0
  244. parsl/tests/test_regression/test_69a.py +0 -1
  245. parsl/tests/test_regression/test_854.py +4 -2
  246. parsl/tests/test_regression/test_97_parallelism_0.py +1 -2
  247. parsl/tests/test_regression/test_98.py +0 -1
  248. parsl/tests/test_scaling/test_block_error_handler.py +9 -4
  249. parsl/tests/test_scaling/test_scale_down.py +2 -3
  250. parsl/tests/test_scaling/test_scale_down_htex_auto_scale.py +4 -5
  251. parsl/tests/test_scaling/test_scale_down_htex_unregistered.py +3 -4
  252. parsl/tests/test_scaling/test_shutdown_scalein.py +1 -2
  253. parsl/tests/test_serialization/test_2555_caching_deserializer.py +1 -1
  254. parsl/tests/test_serialization/test_basic.py +2 -1
  255. parsl/tests/test_serialization/test_htex_code_cache.py +3 -4
  256. parsl/tests/test_serialization/test_pack_resource_spec.py +2 -1
  257. parsl/tests/test_serialization/test_proxystore_configured.py +10 -5
  258. parsl/tests/test_serialization/test_proxystore_impl.py +5 -3
  259. parsl/tests/test_shutdown/test_kill_monitoring.py +3 -2
  260. parsl/tests/test_staging/staging_provider.py +2 -2
  261. parsl/tests/test_staging/test_1316.py +3 -2
  262. parsl/tests/test_staging/test_docs_1.py +1 -1
  263. parsl/tests/test_staging/test_docs_2.py +2 -1
  264. parsl/tests/test_staging/test_elaborate_noop_file.py +2 -2
  265. parsl/tests/test_staging/test_staging_https.py +2 -2
  266. parsl/tests/test_staging/test_staging_stdout.py +4 -3
  267. parsl/tests/test_staging/test_zip_in.py +6 -8
  268. parsl/tests/test_staging/test_zip_out.py +7 -9
  269. parsl/tests/test_staging/test_zip_to_zip.py +6 -8
  270. parsl/tests/test_summary.py +2 -1
  271. parsl/tests/test_thread_parallelism.py +0 -1
  272. parsl/tests/test_threads/test_configs.py +1 -1
  273. parsl/tests/test_threads/test_lazy_errors.py +2 -1
  274. parsl/tests/unit/test_usage_tracking.py +45 -0
  275. parsl/usage_tracking/api.py +2 -3
  276. parsl/usage_tracking/levels.py +6 -0
  277. parsl/usage_tracking/usage.py +60 -39
  278. parsl/utils.py +13 -2
  279. parsl/version.py +1 -1
  280. {parsl-2024.5.27.data → parsl-2024.6.10.data}/scripts/exec_parsl_function.py +5 -4
  281. {parsl-2024.5.27.data → parsl-2024.6.10.data}/scripts/process_worker_pool.py +31 -20
  282. {parsl-2024.5.27.dist-info → parsl-2024.6.10.dist-info}/METADATA +2 -2
  283. parsl-2024.6.10.dist-info/RECORD +475 -0
  284. parsl-2024.5.27.dist-info/RECORD +0 -471
  285. {parsl-2024.5.27.data → parsl-2024.6.10.data}/scripts/parsl_coprocess.py +1 -1
  286. {parsl-2024.5.27.dist-info → parsl-2024.6.10.dist-info}/LICENSE +0 -0
  287. {parsl-2024.5.27.dist-info → parsl-2024.6.10.dist-info}/WHEEL +0 -0
  288. {parsl-2024.5.27.dist-info → parsl-2024.6.10.dist-info}/entry_points.txt +0 -0
  289. {parsl-2024.5.27.dist-info → parsl-2024.6.10.dist-info}/top_level.txt +0 -0
parsl/__init__.py CHANGED
@@ -15,24 +15,23 @@ AUTO_LOGNAME
15
15
 
16
16
  """
17
17
  import logging
18
+ import multiprocessing as _multiprocessing
18
19
  import os
19
20
  import platform
20
21
 
21
- from parsl.version import VERSION
22
22
  from parsl.app.app import bash_app, join_app, python_app
23
23
  from parsl.config import Config
24
- from parsl.executors import ThreadPoolExecutor
25
- from parsl.executors import HighThroughputExecutor
26
- from parsl.executors import WorkQueueExecutor
27
- from parsl.log_utils import set_stream_logger
28
- from parsl.log_utils import set_file_logger
29
- from parsl.monitoring import MonitoringHub
30
-
31
24
  from parsl.data_provider.files import File
32
-
33
25
  from parsl.dataflow.dflow import DataFlowKernel, DataFlowKernelLoader
26
+ from parsl.executors import (
27
+ HighThroughputExecutor,
28
+ ThreadPoolExecutor,
29
+ WorkQueueExecutor,
30
+ )
31
+ from parsl.log_utils import set_file_logger, set_stream_logger
32
+ from parsl.monitoring import MonitoringHub
33
+ from parsl.version import VERSION
34
34
 
35
- import multiprocessing as _multiprocessing
36
35
  if platform.system() == 'Darwin':
37
36
  _multiprocessing.set_start_method('fork', force=True)
38
37
 
parsl/addresses.py CHANGED
@@ -8,17 +8,19 @@ so some experimentation will probably be needed to choose the correct one.
8
8
 
9
9
  import logging
10
10
  import platform
11
- import requests
12
11
  import socket
12
+
13
+ import requests
14
+
13
15
  try:
14
16
  import fcntl
15
17
  except ImportError:
16
18
  fcntl = None # type: ignore[assignment]
17
19
  import struct
18
- import typeguard
19
- import psutil
20
+ from typing import Callable, List, Set
20
21
 
21
- from typing import Set, List, Callable
22
+ import psutil
23
+ import typeguard
22
24
 
23
25
  logger = logging.getLogger(__name__)
24
26
 
parsl/app/app.py CHANGED
@@ -3,19 +3,16 @@
3
3
  The App class encapsulates a generic leaf task that can be executed asynchronously.
4
4
  """
5
5
  import logging
6
- import typeguard
7
6
  from abc import ABCMeta, abstractmethod
8
7
  from inspect import signature
9
- from typing import List, Optional, Sequence, Union
8
+ from typing import Any, Callable, Dict, List, Optional, Sequence, Union
9
+
10
+ import typeguard
10
11
  from typing_extensions import Literal
11
12
 
12
13
  from parsl.dataflow.dflow import DataFlowKernel
13
-
14
- from typing import Any, Callable, Dict
15
-
16
14
  from parsl.dataflow.futures import AppFuture
17
15
 
18
-
19
16
  logger = logging.getLogger(__name__)
20
17
 
21
18
 
parsl/app/bash.py CHANGED
@@ -1,10 +1,9 @@
1
- from functools import update_wrapper
2
- from functools import partial
3
- from inspect import signature, Parameter
4
1
  import logging
2
+ from functools import partial, update_wrapper
3
+ from inspect import Parameter, signature
5
4
 
6
- from parsl.app.errors import wrap_error
7
5
  from parsl.app.app import AppBase
6
+ from parsl.app.errors import wrap_error
8
7
  from parsl.data_provider.files import File
9
8
  from parsl.dataflow.dflow import DataFlowKernelLoader
10
9
 
@@ -17,6 +16,7 @@ def remote_side_bash_executor(func, *args, **kwargs):
17
16
  """
18
17
  import os
19
18
  import subprocess
19
+
20
20
  import parsl.app.errors as pe
21
21
  from parsl.utils import get_std_fname_mode
22
22
 
parsl/app/errors.py CHANGED
@@ -1,10 +1,11 @@
1
1
  """Exceptions raised by Apps."""
2
+ import logging
2
3
  from functools import wraps
3
- from typing import Callable, List, Optional, TypeVar, Union
4
- from typing_extensions import ParamSpec
5
4
  from types import TracebackType
6
- import logging
5
+ from typing import Callable, List, Optional, TypeVar, Union
6
+
7
7
  from tblib import Traceback
8
+ from typing_extensions import ParamSpec
8
9
 
9
10
  from parsl.data_provider.files import File
10
11
  from parsl.errors import ParslError
@@ -134,6 +135,7 @@ def wrap_error(func: Callable[P, R]) -> Callable[P, Union[R, RemoteExceptionWrap
134
135
  @wraps(func)
135
136
  def wrapper(*args: P.args, **kwargs: P.kwargs) -> Union[R, RemoteExceptionWrapper]:
136
137
  import sys
138
+
137
139
  from parsl.app.errors import RemoteExceptionWrapper
138
140
  try:
139
141
  return func(*args, **kwargs)
parsl/app/futures.py CHANGED
@@ -1,12 +1,12 @@
1
1
  """This module implements DataFutures.
2
2
  """
3
3
  import logging
4
- import typeguard
5
4
  from concurrent.futures import Future
5
+ from typing import Optional
6
6
 
7
- from parsl.data_provider.files import File
7
+ import typeguard
8
8
 
9
- from typing import Optional
9
+ from parsl.data_provider.files import File
10
10
 
11
11
  logger = logging.getLogger(__name__)
12
12
 
parsl/app/python.py CHANGED
@@ -2,6 +2,7 @@ import logging
2
2
  import threading
3
3
 
4
4
  import tblib.pickling_support
5
+
5
6
  tblib.pickling_support.install()
6
7
 
7
8
  from functools import wraps
@@ -11,7 +12,6 @@ from parsl.app.errors import wrap_error
11
12
  from parsl.dataflow.dflow import DataFlowKernelLoader
12
13
  from parsl.utils import AutoCancelTimer
13
14
 
14
-
15
15
  logger = logging.getLogger(__name__)
16
16
 
17
17
 
@@ -19,6 +19,7 @@ def timeout(f, seconds: float):
19
19
  @wraps(f)
20
20
  def wrapper(*args, **kwargs):
21
21
  import ctypes
22
+
22
23
  import parsl.app.errors
23
24
 
24
25
  def inject_exception(thread):
parsl/benchmark/perf.py CHANGED
@@ -1,7 +1,8 @@
1
1
  import argparse
2
+ import concurrent.futures
2
3
  import importlib
3
4
  import time
4
- import concurrent.futures
5
+
5
6
  import parsl
6
7
 
7
8
  min_iterations = 2
@@ -1,7 +1,7 @@
1
1
  from parsl.channels.base import Channel
2
- from parsl.channels.ssh.ssh import SSHChannel
3
2
  from parsl.channels.local.local import LocalChannel
4
- from parsl.channels.ssh_il.ssh_il import SSHInteractiveLoginChannel
5
3
  from parsl.channels.oauth_ssh.oauth_ssh import OAuthSSHChannel
4
+ from parsl.channels.ssh.ssh import SSHChannel
5
+ from parsl.channels.ssh_il.ssh_il import SSHInteractiveLoginChannel
6
6
 
7
7
  __all__ = ['Channel', 'SSHChannel', 'LocalChannel', 'SSHInteractiveLoginChannel', 'OAuthSSHChannel']
parsl/channels/base.py CHANGED
@@ -1,5 +1,4 @@
1
1
  from abc import ABCMeta, abstractmethod, abstractproperty
2
-
3
2
  from typing import Dict, Tuple
4
3
 
5
4
 
parsl/channels/errors.py CHANGED
@@ -1,8 +1,9 @@
1
1
  ''' Exceptions raise by Apps.
2
2
  '''
3
- from parsl.errors import ParslError
4
3
  from typing import Optional
5
4
 
5
+ from parsl.errors import ParslError
6
+
6
7
 
7
8
  class ChannelError(ParslError):
8
9
  """ Base class for all exceptions
@@ -1,13 +1,14 @@
1
1
  import logging
2
- import paramiko
3
2
  import socket
4
3
 
5
- from parsl.errors import OptionalModuleMissing
4
+ import paramiko
5
+
6
6
  from parsl.channels.ssh.ssh import SSHChannel
7
+ from parsl.errors import OptionalModuleMissing
7
8
 
8
9
  try:
9
- from oauth_ssh.ssh_service import SSHService
10
10
  from oauth_ssh.oauth_ssh_token import find_access_token
11
+ from oauth_ssh.ssh_service import SSHService
11
12
  _oauth_ssh_enabled = True
12
13
  except (ImportError, NameError):
13
14
  _oauth_ssh_enabled = False
parsl/channels/ssh/ssh.py CHANGED
@@ -3,8 +3,16 @@ import logging
3
3
  import os
4
4
 
5
5
  import paramiko
6
+
6
7
  from parsl.channels.base import Channel
7
- from parsl.channels.errors import BadHostKeyException, AuthException, SSHException, BadScriptPath, BadPermsScriptPath, FileCopyException
8
+ from parsl.channels.errors import (
9
+ AuthException,
10
+ BadHostKeyException,
11
+ BadPermsScriptPath,
12
+ BadScriptPath,
13
+ FileCopyException,
14
+ SSHException,
15
+ )
8
16
  from parsl.utils import RepresentationMixin
9
17
 
10
18
  logger = logging.getLogger(__name__)
@@ -2,6 +2,7 @@ import getpass
2
2
  import logging
3
3
 
4
4
  import paramiko
5
+
5
6
  from parsl.channels.ssh.ssh import SSHChannel
6
7
 
7
8
  logger = logging.getLogger(__name__)
@@ -1,8 +1,8 @@
1
1
  """Interfaces modeled after Python's `concurrent library <https://docs.python.org/3/library/concurrent.html>`_"""
2
- from typing import Callable, Dict, Optional, Iterator, Iterable
2
+ import time
3
3
  from concurrent.futures import Executor
4
+ from typing import Callable, Dict, Iterable, Iterator, Optional
4
5
  from warnings import warn
5
- import time
6
6
 
7
7
  from parsl import Config, DataFlowKernel
8
8
  from parsl.app.python import PythonApp
parsl/config.py CHANGED
@@ -1,17 +1,19 @@
1
1
  import logging
2
- import typeguard
3
-
4
2
  from typing import Callable, Iterable, Optional, Sequence, Union
3
+
4
+ import typeguard
5
5
  from typing_extensions import Literal
6
6
 
7
- from parsl.utils import RepresentationMixin
8
7
  from parsl.dataflow.dependency_resolvers import DependencyResolver
8
+ from parsl.dataflow.taskrecord import TaskRecord
9
+ from parsl.errors import ConfigurationError
9
10
  from parsl.executors.base import ParslExecutor
10
11
  from parsl.executors.threads import ThreadPoolExecutor
11
- from parsl.errors import ConfigurationError
12
- from parsl.dataflow.taskrecord import TaskRecord
13
12
  from parsl.monitoring import MonitoringHub
14
13
  from parsl.usage_tracking.api import UsageInformation
14
+ from parsl.usage_tracking.levels import DISABLED as USAGE_TRACKING_DISABLED
15
+ from parsl.usage_tracking.levels import LEVEL_3 as USAGE_TRACKING_LEVEL_3
16
+ from parsl.utils import RepresentationMixin
15
17
 
16
18
  logger = logging.getLogger(__name__)
17
19
 
@@ -38,6 +40,15 @@ class Config(RepresentationMixin, UsageInformation):
38
40
  ``checkpoint_mode='periodic'``.
39
41
  dependency_resolver: plugin point for custom dependency resolvers. Default: only resolve Futures,
40
42
  using the `SHALLOW_DEPENDENCY_RESOLVER`.
43
+ exit_mode: str, optional
44
+ When Parsl is used as a context manager (using ``with parsl.load`` syntax) then this parameter
45
+ controls what will happen to running tasks and exceptions at exit. The options are:
46
+
47
+ * ``cleanup``: cleanup the DFK on exit without waiting for any tasks
48
+ * ``skip``: skip all shutdown behaviour when exiting the context manager
49
+ * ``wait``: wait for all tasks to complete when exiting normally, but exit immediately when exiting due to an exception.
50
+
51
+ Default is ``cleanup``.
41
52
  garbage_collect : bool. optional.
42
53
  Delete task records from DFK when tasks have completed. Default: True
43
54
  internal_tasks_max_threads : int, optional
@@ -66,9 +77,12 @@ class Config(RepresentationMixin, UsageInformation):
66
77
  How often the scaling strategy should be executed. Default is 5 seconds.
67
78
  max_idletime : float, optional
68
79
  The maximum idle time allowed for an executor before strategy could shut down unused blocks. Default is 120.0 seconds.
69
- usage_tracking : bool, optional
70
- Set this field to True to opt-in to Parsl's usage tracking system. Parsl only collects minimal, non personally-identifiable,
71
- information used for reporting to our funding agencies. Default is False.
80
+ usage_tracking : int, optional
81
+ Set this field to 1, 2, or 3 to opt-in to Parsl's usage tracking system.
82
+ The value represents the level of usage tracking detail to be collected.
83
+ Setting this field to 0 will disable usage tracking. Default (this field is not set): usage tracking is not enabled.
84
+ Parsl only collects minimal, non personally-identifiable,
85
+ information used for reporting to our funding agencies.
72
86
  initialize_logging : bool, optional
73
87
  Make DFK optionally not initialize any logging. Log messages
74
88
  will still be passed into the python logging system under the
@@ -92,6 +106,7 @@ class Config(RepresentationMixin, UsageInformation):
92
106
  Literal['manual']] = None,
93
107
  checkpoint_period: Optional[str] = None,
94
108
  dependency_resolver: Optional[DependencyResolver] = None,
109
+ exit_mode: Literal['cleanup', 'skip', 'wait'] = 'cleanup',
95
110
  garbage_collect: bool = True,
96
111
  internal_tasks_max_threads: int = 10,
97
112
  retries: int = 0,
@@ -102,7 +117,7 @@ class Config(RepresentationMixin, UsageInformation):
102
117
  strategy_period: Union[float, int] = 5,
103
118
  max_idletime: float = 120.0,
104
119
  monitoring: Optional[MonitoringHub] = None,
105
- usage_tracking: bool = False,
120
+ usage_tracking: int = 0,
106
121
  initialize_logging: bool = True) -> None:
107
122
 
108
123
  executors = tuple(executors or [])
@@ -128,6 +143,7 @@ class Config(RepresentationMixin, UsageInformation):
128
143
  checkpoint_period = "00:30:00"
129
144
  self.checkpoint_period = checkpoint_period
130
145
  self.dependency_resolver = dependency_resolver
146
+ self.exit_mode = exit_mode
131
147
  self.garbage_collect = garbage_collect
132
148
  self.internal_tasks_max_threads = internal_tasks_max_threads
133
149
  self.retries = retries
@@ -136,6 +152,7 @@ class Config(RepresentationMixin, UsageInformation):
136
152
  self.strategy = strategy
137
153
  self.strategy_period = strategy_period
138
154
  self.max_idletime = max_idletime
155
+ self.validate_usage_tracking(usage_tracking)
139
156
  self.usage_tracking = usage_tracking
140
157
  self.initialize_logging = initialize_logging
141
158
  self.monitoring = monitoring
@@ -156,6 +173,12 @@ class Config(RepresentationMixin, UsageInformation):
156
173
  raise ConfigurationError('Executors must have unique labels ({})'.format(
157
174
  ', '.join(['label={}'.format(repr(d)) for d in duplicates])))
158
175
 
176
+ def validate_usage_tracking(self, level: int) -> None:
177
+ if not USAGE_TRACKING_DISABLED <= level <= USAGE_TRACKING_LEVEL_3:
178
+ raise ConfigurationError(
179
+ f"Usage Tracking values must be 0, 1, 2, or 3 and not {level}"
180
+ )
181
+
159
182
  def get_usage_information(self):
160
183
  return {"executors_len": len(self.executors),
161
184
  "dependency_resolver": self.dependency_resolver is not None}
parsl/configs/ASPIRE1.py CHANGED
@@ -1,9 +1,9 @@
1
- from parsl.providers import PBSProProvider
2
- from parsl.launchers import MpiRunLauncher
1
+ from parsl.addresses import address_by_interface
3
2
  from parsl.config import Config
4
3
  from parsl.executors import HighThroughputExecutor
5
- from parsl.addresses import address_by_interface
4
+ from parsl.launchers import MpiRunLauncher
6
5
  from parsl.monitoring.monitoring import MonitoringHub
6
+ from parsl.providers import PBSProProvider
7
7
 
8
8
  config = Config(
9
9
  executors=[
parsl/configs/Azure.py CHANGED
@@ -1,14 +1,13 @@
1
1
  """Config for Azure"""
2
- from parsl.config import Config
2
+ import getpass
3
3
 
4
- from parsl.providers import AzureProvider
5
- from parsl.executors import HighThroughputExecutor
6
- from parsl.data_provider.http import HTTPInTaskStaging
4
+ from parsl.addresses import address_by_query
5
+ from parsl.config import Config
7
6
  from parsl.data_provider.ftp import FTPInTaskStaging
7
+ from parsl.data_provider.http import HTTPInTaskStaging
8
8
  from parsl.data_provider.rsync import RSyncStaging
9
- from parsl.addresses import address_by_query
10
-
11
- import getpass
9
+ from parsl.executors import HighThroughputExecutor
10
+ from parsl.providers import AzureProvider
12
11
 
13
12
  vm_reference = {
14
13
  # All fields below are required
parsl/configs/ad_hoc.py CHANGED
@@ -1,8 +1,9 @@
1
- from parsl.providers import AdHocProvider
1
+ from typing import Any, Dict
2
+
2
3
  from parsl.channels import SSHChannel
3
- from parsl.executors import HighThroughputExecutor
4
4
  from parsl.config import Config
5
- from typing import Any, Dict
5
+ from parsl.executors import HighThroughputExecutor
6
+ from parsl.providers import AdHocProvider
6
7
 
7
8
  user_opts: Dict[str, Dict[str, Any]]
8
9
  user_opts = {'adhoc':
parsl/configs/bridges.py CHANGED
@@ -1,8 +1,8 @@
1
+ from parsl.addresses import address_by_interface
1
2
  from parsl.config import Config
2
- from parsl.providers import SlurmProvider
3
- from parsl.launchers import SrunLauncher
4
3
  from parsl.executors import HighThroughputExecutor
5
- from parsl.addresses import address_by_interface
4
+ from parsl.launchers import SrunLauncher
5
+ from parsl.providers import SlurmProvider
6
6
 
7
7
  """ This config assumes that it is used to launch parsl tasks from the login nodes
8
8
  of Bridges at PSC. Each job submitted to the scheduler will request 2 nodes for 10 minutes.
parsl/configs/cc_in2p3.py CHANGED
@@ -1,7 +1,7 @@
1
- from parsl.config import Config
2
1
  from parsl.channels import LocalChannel
3
- from parsl.providers import GridEngineProvider
2
+ from parsl.config import Config
4
3
  from parsl.executors import HighThroughputExecutor
4
+ from parsl.providers import GridEngineProvider
5
5
 
6
6
  config = Config(
7
7
  executors=[
parsl/configs/ec2.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from parsl.config import Config
2
- from parsl.providers import AWSProvider
3
2
  from parsl.executors import HighThroughputExecutor
3
+ from parsl.providers import AWSProvider
4
4
 
5
5
  config = Config(
6
6
  executors=[
parsl/configs/expanse.py CHANGED
@@ -1,8 +1,7 @@
1
1
  from parsl.config import Config
2
+ from parsl.executors import HighThroughputExecutor
2
3
  from parsl.launchers import SrunLauncher
3
4
  from parsl.providers import SlurmProvider
4
- from parsl.executors import HighThroughputExecutor
5
-
6
5
 
7
6
  config = Config(
8
7
  executors=[
parsl/configs/frontera.py CHANGED
@@ -1,9 +1,8 @@
1
- from parsl.config import Config
2
1
  from parsl.channels import LocalChannel
3
- from parsl.providers import SlurmProvider
2
+ from parsl.config import Config
4
3
  from parsl.executors import HighThroughputExecutor
5
4
  from parsl.launchers import SrunLauncher
6
-
5
+ from parsl.providers import SlurmProvider
7
6
 
8
7
  """ This config assumes that it is used to launch parsl tasks from the login nodes
9
8
  of Frontera at TACC. Each job submitted to the scheduler will request 2 nodes for 10 minutes.
@@ -1,8 +1,7 @@
1
- from parsl.providers import LocalProvider
2
1
  from parsl.channels import LocalChannel
3
-
4
2
  from parsl.config import Config
5
3
  from parsl.executors import HighThroughputExecutor
4
+ from parsl.providers import LocalProvider
6
5
 
7
6
  config = Config(
8
7
  executors=[
@@ -1,7 +1,7 @@
1
1
  from parsl.config import Config
2
- from parsl.providers import SlurmProvider
3
2
  from parsl.executors import HighThroughputExecutor
4
3
  from parsl.launchers import SrunLauncher
4
+ from parsl.providers import SlurmProvider
5
5
 
6
6
  """ This config assumes that it is used to launch parsl tasks from the login nodes
7
7
  of the Campus Cluster at UIUC. Each job submitted to the scheduler will request 2 nodes for 10 minutes.
@@ -1,8 +1,7 @@
1
+ from parsl.addresses import address_by_route
1
2
  from parsl.config import Config
2
3
  from parsl.executors import HighThroughputExecutor
3
4
  from parsl.providers import KubernetesProvider
4
- from parsl.addresses import address_by_route
5
-
6
5
 
7
6
  config = Config(
8
7
  executors=[
parsl/configs/midway.py CHANGED
@@ -1,8 +1,8 @@
1
+ from parsl.addresses import address_by_interface
1
2
  from parsl.config import Config
2
- from parsl.providers import SlurmProvider
3
- from parsl.launchers import SrunLauncher
4
3
  from parsl.executors import HighThroughputExecutor
5
- from parsl.addresses import address_by_interface
4
+ from parsl.launchers import SrunLauncher
5
+ from parsl.providers import SlurmProvider
6
6
 
7
7
  config = Config(
8
8
  executors=[
parsl/configs/osg.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from parsl.config import Config
2
- from parsl.providers import CondorProvider
3
2
  from parsl.executors import HighThroughputExecutor
3
+ from parsl.providers import CondorProvider
4
4
 
5
5
  config = Config(
6
6
  executors=[
parsl/configs/polaris.py CHANGED
@@ -1,8 +1,8 @@
1
1
  from parsl.addresses import address_by_interface
2
+ from parsl.config import Config
2
3
  from parsl.executors import HighThroughputExecutor
3
4
  from parsl.launchers import MpiExecLauncher
4
5
  from parsl.providers import PBSProProvider
5
- from parsl.config import Config
6
6
 
7
7
  # There are three user parameters to change for the PBSProProvider:
8
8
  # YOUR_ACCOUNT: Account to charge usage
@@ -1,10 +1,9 @@
1
+ from parsl.addresses import address_by_interface
1
2
  from parsl.config import Config
2
- from parsl.providers import SlurmProvider
3
- from parsl.launchers import SrunLauncher
4
- from parsl.executors import HighThroughputExecutor
5
3
  from parsl.data_provider.globus import GlobusStaging
6
- from parsl.addresses import address_by_interface
7
-
4
+ from parsl.executors import HighThroughputExecutor
5
+ from parsl.launchers import SrunLauncher
6
+ from parsl.providers import SlurmProvider
8
7
 
9
8
  config = Config(
10
9
  executors=[
parsl/configs/summit.py CHANGED
@@ -1,11 +1,9 @@
1
+ from parsl.addresses import address_by_interface
1
2
  from parsl.config import Config
2
3
  from parsl.executors import HighThroughputExecutor
3
-
4
4
  from parsl.launchers import JsrunLauncher
5
5
  from parsl.providers import LSFProvider
6
6
 
7
- from parsl.addresses import address_by_interface
8
-
9
7
  config = Config(
10
8
  executors=[
11
9
  HighThroughputExecutor(
@@ -1,8 +1,7 @@
1
1
  from parsl.config import Config
2
2
  from parsl.executors import FluxExecutor
3
- from parsl.providers import SlurmProvider
4
3
  from parsl.launchers import SrunLauncher
5
-
4
+ from parsl.providers import SlurmProvider
6
5
 
7
6
  config = Config(
8
7
  executors=[
@@ -1,8 +1,8 @@
1
- from parsl.config import Config
2
- from parsl.executors.taskvine import TaskVineExecutor
3
- from parsl.executors.taskvine import TaskVineManagerConfig
4
1
  import uuid
5
2
 
3
+ from parsl.config import Config
4
+ from parsl.executors.taskvine import TaskVineExecutor, TaskVineManagerConfig
5
+
6
6
  config = Config(
7
7
  executors=[
8
8
  TaskVineExecutor(
@@ -1,8 +1,8 @@
1
+ import uuid
2
+
1
3
  from parsl.config import Config
2
4
  from parsl.executors import WorkQueueExecutor
3
5
 
4
- import uuid
5
-
6
6
  config = Config(
7
7
  executors=[
8
8
  WorkQueueExecutor(
@@ -1,14 +1,14 @@
1
1
  import logging
2
2
  from concurrent.futures import Future
3
- from typing import Any, Callable, List, Optional, TYPE_CHECKING
3
+ from typing import TYPE_CHECKING, Any, Callable, List, Optional
4
4
 
5
5
  from parsl.app.futures import DataFuture
6
- from parsl.data_provider.files import File
7
6
  from parsl.data_provider.file_noop import NoOpFileStaging
7
+ from parsl.data_provider.files import File
8
8
  from parsl.data_provider.ftp import FTPSeparateTaskStaging
9
9
  from parsl.data_provider.http import HTTPSeparateTaskStaging
10
- from parsl.data_provider.zip import ZipFileStaging
11
10
  from parsl.data_provider.staging import Staging
11
+ from parsl.data_provider.zip import ZipFileStaging
12
12
 
13
13
  if TYPE_CHECKING:
14
14
  from parsl.dataflow.dflow import DataFlowKernel
@@ -1,8 +1,7 @@
1
1
  import logging
2
2
 
3
- from parsl.utils import RepresentationMixin
4
3
  from parsl.data_provider.staging import Staging
5
-
4
+ from parsl.utils import RepresentationMixin
6
5
 
7
6
  logger = logging.getLogger(__name__)
8
7
 
@@ -5,13 +5,13 @@ to transfer the file as well as to give the appropriate filepath depending
5
5
  on where (client-side, remote-side, intermediary-side) the File.filepath is
6
6
  being called from.
7
7
  """
8
- import os
9
-
10
- import typeguard
11
8
  import logging
9
+ import os
12
10
  from typing import Optional, Union
13
11
  from urllib.parse import urlparse
14
12
 
13
+ import typeguard
14
+
15
15
  logger = logging.getLogger(__name__)
16
16
 
17
17