parsl 2025.9.1__py3-none-any.whl → 2025.9.15__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.

Potentially problematic release.


This version of parsl might be problematic. Click here for more details.

Files changed (36) hide show
  1. parsl/__init__.py +0 -4
  2. parsl/curvezmq.py +0 -16
  3. parsl/dataflow/dflow.py +1 -3
  4. parsl/dataflow/memoization.py +0 -14
  5. parsl/executors/high_throughput/executor.py +8 -0
  6. parsl/executors/high_throughput/interchange.py +26 -23
  7. parsl/executors/high_throughput/zmq_pipes.py +29 -43
  8. parsl/monitoring/db_manager.py +8 -8
  9. parsl/monitoring/monitoring.py +2 -2
  10. parsl/monitoring/radios/udp_router.py +2 -2
  11. parsl/monitoring/radios/zmq_router.py +2 -2
  12. parsl/multiprocessing.py +0 -49
  13. parsl/tests/test_checkpointing/test_python_checkpoint_1.py +6 -3
  14. parsl/tests/test_curvezmq.py +0 -42
  15. parsl/tests/test_htex/test_command_concurrency_regression_1321.py +54 -0
  16. parsl/tests/test_htex/test_interchange_exit_bad_registration.py +2 -1
  17. parsl/tests/test_htex/test_priority_queue.py +1 -0
  18. parsl/tests/test_htex/test_zmq_binding.py +2 -1
  19. parsl/tests/test_python_apps/test_memoize_exception.py +41 -0
  20. parsl/version.py +1 -1
  21. {parsl-2025.9.1.data → parsl-2025.9.15.data}/scripts/interchange.py +26 -23
  22. {parsl-2025.9.1.dist-info → parsl-2025.9.15.dist-info}/METADATA +2 -2
  23. {parsl-2025.9.1.dist-info → parsl-2025.9.15.dist-info}/RECORD +30 -34
  24. parsl/tests/site_tests/test_provider.py +0 -88
  25. parsl/tests/site_tests/test_site.py +0 -70
  26. parsl/tests/test_aalst_patterns.py +0 -474
  27. parsl/tests/test_docs/test_workflow2.py +0 -42
  28. parsl/tests/test_error_handling/test_rand_fail.py +0 -171
  29. parsl/tests/test_regression/test_854.py +0 -62
  30. {parsl-2025.9.1.data → parsl-2025.9.15.data}/scripts/exec_parsl_function.py +0 -0
  31. {parsl-2025.9.1.data → parsl-2025.9.15.data}/scripts/parsl_coprocess.py +0 -0
  32. {parsl-2025.9.1.data → parsl-2025.9.15.data}/scripts/process_worker_pool.py +0 -0
  33. {parsl-2025.9.1.dist-info → parsl-2025.9.15.dist-info}/LICENSE +0 -0
  34. {parsl-2025.9.1.dist-info → parsl-2025.9.15.dist-info}/WHEEL +0 -0
  35. {parsl-2025.9.1.dist-info → parsl-2025.9.15.dist-info}/entry_points.txt +0 -0
  36. {parsl-2025.9.1.dist-info → parsl-2025.9.15.dist-info}/top_level.txt +0 -0
@@ -1,474 +0,0 @@
1
- import random
2
- import time
3
-
4
- import pytest
5
-
6
- from parsl.app.app import python_app
7
- from parsl.tests.configs.local_threads import config
8
-
9
- pytestmark = pytest.mark.skip('not asserting anything')
10
-
11
-
12
- local_config = config
13
-
14
-
15
- @python_app
16
- def multiply_rand(x):
17
- return x * random.randint(1, 10)
18
-
19
-
20
- @python_app
21
- def square_sum(x, y):
22
- return (x + y) ** 2
23
-
24
-
25
- @python_app
26
- def double_sum(x, y):
27
- return 2 * (x + y)
28
-
29
-
30
- @python_app
31
- def subtract(x, y):
32
- return y - x
33
-
34
-
35
- @python_app
36
- def add_two(x):
37
- return x + 2
38
-
39
-
40
- @python_app
41
- def rand():
42
- x = random.randint(1, 100)
43
- return x
44
-
45
-
46
- @python_app
47
- def square(x):
48
- z = x ** 2
49
- return z
50
-
51
-
52
- @python_app
53
- def cubed(x):
54
- return x ** 3
55
-
56
-
57
- @python_app
58
- def sleep_cubed(x):
59
- if x < 5:
60
- time.sleep(7)
61
- return x ** 3
62
- else:
63
- return x ** 3
64
-
65
-
66
- @python_app
67
- def increment(x):
68
- return x + 1
69
-
70
-
71
- @python_app
72
- def slow_increment(x, dur=1):
73
- import time
74
- time.sleep(dur)
75
- return x + 1
76
-
77
-
78
- @python_app
79
- def join(inputs=[]):
80
- return sum(inputs)
81
-
82
-
83
- @python_app
84
- def join_three(x, y, z):
85
- return x + y + z
86
-
87
-
88
- @python_app
89
- def sleep_square(x):
90
- if x > 5:
91
- return x ** 2
92
- else:
93
- time.sleep(5)
94
- return x ** 2
95
-
96
-
97
- @python_app
98
- def sum_results(x=[]):
99
- total = 0
100
- for r in x:
101
- total += r.result()
102
- return total
103
-
104
-
105
- @python_app
106
- def add(x, y):
107
- return x + y
108
-
109
-
110
- @python_app
111
- def sum_list(x=[]):
112
- return sum(x)
113
-
114
-
115
- @python_app
116
- def sum_lists(x=[], y=[], z=[]):
117
- total = 0
118
- for i in range(len(x)):
119
- total += x[i].result()
120
- for j in range(len(y)):
121
- total += y[j].result()
122
- for k in range(len(z)):
123
- total += z[k].result()
124
- return total
125
-
126
-
127
- @python_app
128
- def sum_elements(x=[], y=[], z=[]):
129
- total = 0
130
- for i in range(len(x)):
131
- total += x[i].result()
132
- for j in range(len(y)):
133
- if y[j] is not None:
134
- total += y[j].result()
135
- for k in range(len(z)):
136
- total += z[k].result()
137
- return total
138
-
139
-
140
- @python_app
141
- def simple_sum_elements(x, y, z):
142
- return x + y + z
143
-
144
-
145
- @python_app
146
- def eval_number(x):
147
- if x > 5:
148
- print("Larger than 5")
149
- return return_one().result()
150
- else:
151
- print("Less than or equal to 5")
152
- return return_zero().result()
153
-
154
-
155
- @python_app
156
- def return_one():
157
- return 1
158
-
159
-
160
- @python_app
161
- def return_zero():
162
- return 0
163
-
164
-
165
- @python_app
166
- def xor_split():
167
- """Test XOR split. Do A if x else B
168
- """
169
- x = rand()
170
-
171
- if x.result() > 5:
172
- print("Result > 5")
173
- return 0
174
- else:
175
- print("Result < 5")
176
- return 1
177
-
178
-
179
- @python_app
180
- def arb_rand():
181
- x = random.randint(2, 10)
182
- print(x)
183
- print("random")
184
- return arb_square(x).result()
185
-
186
-
187
- @python_app
188
- def arb_square(x):
189
- y = x ** 2
190
- if y > 25:
191
- return increment(y).result()
192
- else:
193
- return arb_cubed(x).result()
194
-
195
-
196
- @python_app
197
- def arb_cubed(x):
198
- y = x ** 3
199
- return arb_square(y).result()
200
-
201
-
202
- def test_increment_p1a(depth=5):
203
- """Test simple pipeline A->B...->N
204
- """
205
- futs = {0: 0}
206
- for i in range(1, depth):
207
- futs[i] = increment(futs[i - 1])
208
-
209
- print([futs[i].result() for i in futs if not isinstance(futs[i], int)])
210
-
211
-
212
- def test_increment_slow_p1b(depth=4):
213
- """Test simple pipeline A->B...->N with delay
214
- """
215
- futs = {0: 0}
216
- for i in range(1, depth):
217
- futs[i] = slow_increment(futs[i - 1], 0.5)
218
-
219
- print(futs[i])
220
- print([futs[i].result() for i in futs if not isinstance(futs[i], int)])
221
-
222
-
223
- def test_sequence_p1c(x=5):
224
- flights = []
225
- miles = []
226
- for i in range(x):
227
- flights.append(rand())
228
- for j in range(len(flights)):
229
- miles.append(multiply_rand(flights[j].result()))
230
- for k in range(len(miles)):
231
- print(miles[k].result())
232
-
233
-
234
- def test_and_split_p2a(depth=5):
235
- """Test simple pipeline A->B...->N
236
- """
237
- futs = {}
238
- for i in range(depth):
239
- futs[i] = increment(i)
240
-
241
- print([futs[i].result() for i in futs])
242
-
243
-
244
- def test_parallel_split_p2b(x=4):
245
- for i in range(x):
246
- num = rand().result()
247
- y = square(num).result()
248
- z = cubed(num).result()
249
- print(y)
250
- print(z)
251
-
252
-
253
- def test_and_join_p3a(depth=5):
254
- """Test simple pipeline A->B...->N
255
- """
256
- futs = {}
257
- for i in range(depth):
258
- futs[i] = increment(i)
259
-
260
- x = join(inputs=futs.values())
261
- print("Final sum: ", x.result())
262
- assert x.result() == sum([i + 1 for i in range(depth)])
263
-
264
-
265
- def test_synchronization_p3b(x=5):
266
- i = []
267
- for j in range(x):
268
- a = increment(j).result()
269
- b = square(j).result()
270
- i.append(add(a, b).result())
271
- total = sum(i)
272
- print(total)
273
-
274
-
275
- def test_xor_split_p4a():
276
- """Test XOR split. Do A if x else B
277
- """
278
- x = rand()
279
-
280
- if x.result() > 5:
281
- print("Result > 5")
282
- else:
283
- print("Result < 5")
284
-
285
-
286
- def test_xor_split_p4b(x=4):
287
- num = []
288
- for i in range(x):
289
- num.append(eval_number(rand().result()))
290
- for i in range(len(num)):
291
- print(num[i].result())
292
-
293
-
294
- def test_xor_join_p5(x=2):
295
- print(join_three(square(x).result(), increment(
296
- x).result(), cubed(x).result()).result())
297
-
298
-
299
- def test_or_split_p6(x=4, y=5):
300
- if x < 5:
301
- print(add(x, y).result())
302
- if y > 7:
303
- print(subtract(x, y).result())
304
- if x >= 5:
305
- print(square_sum(x, y).result())
306
- if y <= 7:
307
- print(double_sum(x, y).result())
308
-
309
-
310
- def test_synchronizing_merge_p7(x=4, y=5):
311
- num = []
312
- if x < 5:
313
- num.append(add(x, y).result())
314
- if y > 7:
315
- num.append(subtract(x, y).result())
316
- if x >= 5:
317
- num.append(square_sum(x, y).result())
318
- if y <= 7:
319
- num.append(double_sum(x, y).result())
320
- print(sum_list(num).result())
321
-
322
-
323
- def test_multi_merge_p8():
324
- r = rand().result()
325
- num1 = cubed(add_two(square(r).result()).result())
326
- num2 = cubed(add_two(increment(r).result()).result())
327
- print(add(num1.result(), num2.result()).result())
328
-
329
-
330
- def test_discriminator_p9(x=4):
331
- squares = []
332
- cubes = []
333
- total = []
334
- for i in range(x):
335
- squares.append(square(rand().result()))
336
- cubes.append(cubed(rand().result()))
337
- while squares[i].done() is False and cubes[i].done() is False:
338
- pass
339
- total.append(squares[i].result() + cubes[i].result())
340
- for i in range(x):
341
- print(total[i])
342
-
343
-
344
- def test_arbitrary_cycles_p10(x=2):
345
- numbers = []
346
- for i in range(x):
347
- numbers.append(arb_rand())
348
- for i in range(x):
349
- print(numbers[i].result())
350
-
351
-
352
- def test_implicit_termination_p11(x=5):
353
- numbers = []
354
- numbers.append(slow_increment(rand().result()))
355
- for i in range(x):
356
- y = rand().result()
357
- numbers.append(square(increment(y).result()).result())
358
- print(numbers[0].result())
359
- return
360
-
361
-
362
- def test_multi_instances_p12(x=5):
363
- numbers = []
364
- for i in range(x):
365
- numbers.append(square(rand().result()))
366
- print(numbers[i])
367
- print([numbers[i].result() for i in range(len(numbers))])
368
-
369
-
370
- def test_multi_instances_priori_p13():
371
- x = increment(square(rand().result()).result()).result()
372
- y = increment(square(rand().result()).result()).result()
373
- z = increment(square(rand().result()).result()).result()
374
- total = simple_sum_elements(x, y, z).result()
375
- print(total)
376
-
377
-
378
- def test_multi_instances_without_runtime_p15():
379
- numbers = []
380
- while sum_list(numbers).result() < 20:
381
- numbers.append(increment(rand().result()).result())
382
- print(sum_list(numbers).result())
383
-
384
-
385
- def test_multi_instances_runtime_p14(x=5):
386
- numbers = []
387
- [numbers.append(increment(square(rand().result()).result()))
388
- for i in range(x)]
389
- total = sum_results(numbers)
390
- print(total.result())
391
-
392
-
393
- def test_deferred_choice_p16():
394
- r = rand().result()
395
- s = sleep_square(r)
396
- i = slow_increment(r)
397
- print(s.done())
398
- while s.done() is not True and i.done() is not True:
399
- pass
400
- if s.done() is True:
401
- print(s.result())
402
- elif i.done() is True:
403
- print(i.result())
404
-
405
-
406
- def test_unordered_sequence_p17():
407
- r = rand().result()
408
- s = sleep_square(r)
409
- i = slow_increment(r)
410
- print(s.done())
411
- while s.done() is not True and i.done() is not True:
412
- pass
413
- if i.done() is True:
414
- print(i.result())
415
- print(sleep_square(i.result()).result())
416
- elif s.done() is True:
417
- print(s.result())
418
- print(slow_increment(s.result()).result())
419
-
420
-
421
- def test_milestone_p18():
422
- r = rand().result()
423
- i = increment(r)
424
- s = sleep_square(r)
425
- while s.done() is not True:
426
- if i.done() is True:
427
- print(cubed(r).result())
428
- return
429
-
430
-
431
- def test_withdraw_activity_p19(x=3):
432
- cubes = []
433
- squares = []
434
- increments = []
435
- for i in range(x):
436
- r = rand().result()
437
- cubes.append(sleep_cubed(r))
438
- squares.append(square(r))
439
- if cubes[i].done() is True:
440
- print(True)
441
- squares[i] = None
442
- else:
443
- print(False)
444
- increments.append(increment(r))
445
- print(sum_elements(cubes, squares, increments).result())
446
-
447
-
448
- def test_cancel_case_p20(x=3):
449
- cubes = []
450
- squares = []
451
- increments = []
452
- for i in range(x):
453
- r = rand().result()
454
- cubes.append(cubed(r))
455
- squares.append(square(r))
456
- increments.append(increment(r))
457
- r = random.randint(1, 30)
458
- print(r)
459
- if r > 20:
460
- del cubes[:]
461
- if r < 20 and r > 10:
462
- del squares[:]
463
- if r < 10:
464
- del increments[:]
465
- print(sum_lists(cubes, squares, increments).result())
466
-
467
-
468
- def test_xor_parallel_split(width=2):
469
- futures = {}
470
-
471
- for i in range(width):
472
- futures[i] = xor_split()
473
-
474
- print([futures[key].result() for key in futures])
@@ -1,42 +0,0 @@
1
- import time
2
-
3
- import pytest
4
-
5
- from parsl.app.app import python_app
6
- from parsl.tests.configs.local_threads import config
7
-
8
- local_config = config
9
-
10
-
11
- @python_app
12
- def wait_sleep_double(x, fu_1, fu_2):
13
- import time
14
- time.sleep(2) # Sleep for 2 seconds
15
- return x * 2
16
-
17
-
18
- @pytest.mark.skip('fails with pytest+xdist')
19
- def test_parallel(N=2):
20
- """Parallel workflow example from docs on composing a workflow
21
- """
22
-
23
- # Launch two apps, which will execute in parallel, since they don't have to
24
- # wait on any futures
25
- start = time.time()
26
- doubled_x = wait_sleep_double(N, None, None)
27
- doubled_y = wait_sleep_double(N, None, None)
28
-
29
- # The third depends on the first two :
30
- # doubled_x doubled_y (2 s)
31
- # \ /
32
- # doublex_z (2 s)
33
- doubled_z = wait_sleep_double(N, doubled_x, doubled_y)
34
-
35
- # doubled_z will be done in ~4s
36
- print(doubled_z.result())
37
- time.time()
38
- delta = time.time() - start
39
-
40
- assert doubled_z.result() == N * \
41
- 2, "Expected doubled_z = N*2 = {0}".format(N * 2)
42
- assert delta > 4 and delta < 5, "Time delta exceeded expected 4 < duration < 5"
@@ -1,171 +0,0 @@
1
- import argparse
2
-
3
- import pytest
4
-
5
- import parsl
6
- from parsl.app.app import python_app
7
- from parsl.tests.configs.local_threads import fresh_config
8
-
9
-
10
- def local_config():
11
- c = fresh_config()
12
- c.retries = 2
13
- return c
14
-
15
-
16
- @python_app
17
- def sleep_fail(sleep_dur, sleep_rand_max, fail_prob, inputs=[]):
18
- import random
19
- import time
20
-
21
- s = sleep_dur + random.randint(-sleep_rand_max, sleep_rand_max)
22
-
23
- time.sleep(s)
24
- x = float(random.randint(0, 100)) / 100
25
- if x <= fail_prob:
26
- # print("Fail")
27
- raise Exception("App failure")
28
- else:
29
- pass
30
- # print("Succeed")
31
-
32
-
33
- @python_app
34
- def double(x):
35
- return x * 2
36
-
37
-
38
- @pytest.mark.local
39
- def test_simple(n=10):
40
- import time
41
- start = time.time()
42
- x = double(n)
43
- print("Result : ", x.result())
44
- assert x.result() == n * \
45
- 2, "Expected double to return:{0} instead got:{1}".format(
46
- n * 2, x.result())
47
- print("Duration : {0}s".format(time.time() - start))
48
- print("[TEST STATUS] test_parallel_for [SUCCESS]")
49
- return True
50
-
51
-
52
- @pytest.mark.skip('broken')
53
- def test_no_deps(numtasks=10):
54
- """Test basic error handling, with no dependent failures
55
- """
56
-
57
- fus = []
58
- for i in range(0, 10):
59
-
60
- fu = sleep_fail(0.1, 0, .8)
61
- fus.extend([fu])
62
-
63
- count = 0
64
- for fu in fus:
65
- try:
66
- fu.result()
67
- except Exception as e:
68
- print("Caught exception : ", "*" * 20)
69
- print(e)
70
- print("*" * 20)
71
- count += 1
72
-
73
- print("Caught failures of {0}/{1}".format(count, len(fus)))
74
-
75
-
76
- @pytest.mark.skip('broken')
77
- def test_fail_sequence(numtasks=10):
78
- """Test failure in a sequence of dependencies
79
-
80
- App1 -> App2 ... -> AppN
81
- """
82
-
83
- sleep_dur = 0.1
84
- fail_prob = 0.4
85
-
86
- fus = {0: None}
87
- for i in range(0, numtasks):
88
- print("Chaining {0} to {1}".format(i + 1, fus[i]))
89
- fus[i + 1] = sleep_fail(sleep_dur, 0, fail_prob, inputs=[fus[i]])
90
-
91
- # time.sleep(numtasks*sleep_dur)
92
- for k in sorted(fus.keys()):
93
- try:
94
- x = fus[i].result()
95
- print("{0} : {1}".format(k, x))
96
- except Exception as e:
97
- print("{0} : {1}".format(k, e))
98
-
99
- return
100
-
101
-
102
- @pytest.mark.skip('broken')
103
- def test_deps(numtasks=10):
104
- """Random failures in branches of Map -> Map -> reduce
105
-
106
- App1 App2 ... AppN
107
- """
108
-
109
- fus = []
110
- for i in range(0, numtasks):
111
- fu = sleep_fail(0.2, 0, .4)
112
- fus.extend([fu])
113
-
114
- # App1 App2 ... AppN
115
- # | | |
116
- # V V V
117
- # App1 App2 ... AppN
118
-
119
- fus_2 = []
120
- for fu in fus:
121
- fu = sleep_fail(0, 0, .8, inputs=[fu])
122
- fus_2.extend([fu])
123
-
124
- # App1 App2 ... AppN
125
- # | | |
126
- # V V V
127
- # App1 App2 ... AppN
128
- # \ | /
129
- # \ | /
130
- # App_Final
131
-
132
- fu_final = sleep_fail(1, 0, 0, inputs=fus_2)
133
-
134
- try:
135
- print("Final status : ", fu_final.result())
136
- except parsl.dataflow.errors.DependencyError as e:
137
- print("Caught the right exception")
138
- print("Exception : ", e)
139
- except Exception as e:
140
- assert 5 == 1, "Expected DependencyError got : %s" % e
141
- else:
142
- print("Shoot! no errors ")
143
-
144
-
145
- @python_app
146
- def sleep_then_fail(sleep_dur=0.1):
147
- import math
148
- import time
149
- time.sleep(sleep_dur)
150
- math.ceil("Trigger TypeError")
151
- return 0
152
-
153
-
154
- @pytest.mark.skip('broken')
155
- def test_fail_nowait(numtasks=10):
156
- """Test basic error handling, with no dependent failures
157
- """
158
- import time
159
- fus = []
160
- for i in range(0, numtasks):
161
- fu = sleep_then_fail(sleep_dur=0.1)
162
- fus.extend([fu])
163
-
164
- try:
165
- [x.result() for x in fus]
166
- except Exception as e:
167
- assert isinstance(e, TypeError), "Expected a TypeError, got {}".format(e)
168
-
169
- # fus[0].result()
170
- time.sleep(1)
171
- print("Done")