Skip to content

Commit 796f1c4

Browse files
authored
Merge branch 'main' into ilgar
2 parents 98cb58c + 65f1ef3 commit 796f1c4

14 files changed

Lines changed: 63 additions & 357 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ name: Pipeline
33
on:
44
push:
55
branches: [ main ]
6+
paths-ignore:
7+
- 'docs/**'
68
pull_request:
9+
paths-ignore:
10+
- 'docs/**'
711

812
jobs:
913
black:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ executorlib is the lightest path to take *existing* Python functions and scale t
2626
library [Executor interface](https://docs.python.org/3/library/concurrent.futures.html#executor-objects) you already
2727
know, rather than asking you to adopt a new data, actor, or workflow model.
2828

29-
| | executorlib | [Concurrent futures](https://docs.python.org/3/library/concurrent.futures.html) | [Dask](https://www.dask.org) | [Parsl](https://parsl-project.org) | [Ray](https://www.ray.io) |
29+
| | executorlib | [Futures](https://docs.python.org/3/library/concurrent.futures.html) | [Dask](https://www.dask.org) | [Parsl](https://parsl-project.org) | [Ray](https://www.ray.io) |
3030
|---|---|---|---|---|---|
3131
| Drop-in `Executor` API ||| ⚠️ | ⚠️ ||
3232
| Per-call resource assignment ||| ⚠️ |||

docs/comparison.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ alternative is the better choice.
1111

1212
## At a glance
1313

14-
| | executorlib | Concurrent futures | Dask | Parsl | Ray |
14+
| | executorlib | Futures | Dask | Parsl | Ray |
1515
|---|---|---|---|---|---|
1616
| Drop-in `Executor` API ||| ⚠️ | ⚠️ ||
1717
| Per-call resource assignment ||| ⚠️ |||
@@ -22,7 +22,7 @@ alternative is the better choice.
2222

2323
✅ first-class · ⚠️ possible via an add-on or extra configuration · ❌ not supported.
2424

25-
## [Concurrent futures](https://docs.python.org/3/library/concurrent.futures.html)
25+
## [Futures](https://docs.python.org/3/library/concurrent.futures.html)
2626

2727
The [`concurrent.futures`](https://docs.python.org/3/library/concurrent.futures.html) module is where most parallel
2828
Python starts: `ProcessPoolExecutor` and `ThreadPoolExecutor` run functions in parallel on a single machine. executorlib

notebooks/2-hpc-cluster.ipynb

Lines changed: 1 addition & 305 deletions
Large diffs are not rendered by default.

src/executorlib/standalone/batched.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
_logged_failed_ids: set = set()
66

77

8-
def batched_futures(lst: list[Future], skip_lst: list[list], n: int) -> list[list]:
8+
def batched_futures(
9+
lst: list[Future], nested_skip_lst: list[Future[list]], n: int
10+
) -> list[list]:
911
"""
1012
Batch n completed future objects. If the number of completed futures is smaller than n and the end of the batch is
11-
not reached yet, then an empty list is returned. If n future objects are done, which are not included in the skip_lst
13+
not reached yet, then an empty list is returned. If n future objects are done, which are not included in the skip_set
1214
then they are returned as batch.
1315
1416
Futures that completed with an EXCEPTION (e.g. a labeling job that failed on a degenerate config, or a dead worker)
@@ -21,7 +23,7 @@ def batched_futures(lst: list[Future], skip_lst: list[list], n: int) -> list[lis
2123
2224
Args:
2325
lst (list): list of all future objects
24-
skip_lst (list): list of previous batches of future objects
26+
nested_skip_lst (list): nest list of individual results already assigned to previous batches
2527
n (int): batch size
2628
2729
Returns:

tests/benchmark/test_results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class TestResults(unittest.TestCase):
5-
def test_result(self):
5+
def test_timing_benchmarks(self):
66
with open("timing.log") as f:
77
content = f.readlines()
88
timing_dict = {l.split()[0]: float(l.split()[1]) for l in content}

tests/unit/executor/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_get_future_from_cache(self):
110110
cache_key="error",
111111
)
112112

113-
def test_empty(self):
113+
def test_submit_single_task_and_verify_cache(self):
114114
with TestClusterExecutor(cache_directory="rather_this_dir") as exe:
115115
cloudpickle_register(ind=1)
116116
future = exe.submit(foo,1)

tests/unit/executor/test_single_dependencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ def raise_error(parameter):
5252

5353

5454
class TestExecutorWithDependencies(unittest.TestCase):
55-
def test_executor(self):
55+
def test_future_chaining_resolves_dependency(self):
5656
with SingleNodeExecutor(max_cores=1) as exe:
5757
cloudpickle_register(ind=1)
5858
future_1 = exe.submit(add_function, 1, parameter_2=2)
5959
future_2 = exe.submit(add_function, 1, parameter_2=future_1)
6060
self.assertEqual(future_2.result(), 4)
6161

62-
def test_executor_no_wait(self):
62+
def test_shutdown_no_wait_still_resolves_futures(self):
6363
exe = SingleNodeExecutor(max_cores=1)
6464
cloudpickle_register(ind=1)
6565
future_1 = exe.submit(add_function, 1, parameter_2=2)

tests/unit/executor/test_single_mpi.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def mpi_funct_sleep(i):
3333

3434

3535
class TestExecutorBackend(unittest.TestCase):
36-
def test_meta_executor_serial(self):
36+
def test_block_allocation_serial_two_cores(self):
3737
with SingleNodeExecutor(max_cores=2, block_allocation=True) as exe:
3838
cloudpickle_register(ind=1)
3939
fs_1 = exe.submit(calc, 1)
@@ -43,7 +43,7 @@ def test_meta_executor_serial(self):
4343
self.assertTrue(fs_1.done())
4444
self.assertTrue(fs_2.done())
4545

46-
def test_meta_executor_single(self):
46+
def test_block_allocation_serial_one_core(self):
4747
with SingleNodeExecutor(max_cores=1, block_allocation=True) as exe:
4848
cloudpickle_register(ind=1)
4949
fs_1 = exe.submit(calc, 1)
@@ -62,7 +62,7 @@ def test_oversubscribe(self):
6262
@unittest.skipIf(
6363
skip_mpi4py_test, "mpi4py is not installed, so the mpi4py tests are skipped."
6464
)
65-
def test_meta_executor_parallel(self):
65+
def test_block_allocation_mpi_two_cores(self):
6666
with SingleNodeExecutor(
6767
max_workers=2,
6868
resource_dict={"cores": 2},
@@ -73,7 +73,7 @@ def test_meta_executor_parallel(self):
7373
self.assertEqual(fs_1.result(), [(1, 2, 0), (1, 2, 1)])
7474
self.assertTrue(fs_1.done())
7575

76-
def test_errors(self):
76+
def test_invalid_constructor_arguments_raise_errors(self):
7777
with self.assertRaises(TypeError):
7878
SingleNodeExecutor(
7979
max_cores=1,
@@ -88,7 +88,7 @@ def tearDown(self):
8888
@unittest.skipIf(
8989
skip_mpi4py_test, "mpi4py is not installed, so the mpi4py tests are skipped."
9090
)
91-
def test_meta_executor_parallel_cache(self):
91+
def test_block_allocation_mpi_two_cores_with_cache(self):
9292
with SingleNodeExecutor(
9393
max_workers=2,
9494
resource_dict={"cores": 2},

tests/unit/executor/test_single_noblock.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def exit_funct():
2929

3030

3131
class TestExecutorBackend(unittest.TestCase):
32-
def test_meta_executor_serial_with_dependencies(self):
32+
def test_no_block_allocation_disable_dependencies(self):
3333
with SingleNodeExecutor(
3434
max_cores=2,
3535
block_allocation=False,
@@ -43,7 +43,7 @@ def test_meta_executor_serial_with_dependencies(self):
4343
self.assertTrue(fs_1.done())
4444
self.assertTrue(fs_2.done())
4545

46-
def test_meta_executor_serial_without_dependencies(self):
46+
def test_no_block_allocation_with_dependencies(self):
4747
with SingleNodeExecutor(
4848
max_cores=2,
4949
block_allocation=False,
@@ -57,7 +57,7 @@ def test_meta_executor_serial_without_dependencies(self):
5757
self.assertTrue(fs_1.done())
5858
self.assertTrue(fs_2.done())
5959

60-
def test_meta_executor_single(self):
60+
def test_no_block_allocation_single_core(self):
6161
with SingleNodeExecutor(
6262
max_cores=1,
6363
block_allocation=False,
@@ -70,7 +70,7 @@ def test_meta_executor_single(self):
7070
self.assertTrue(fs_1.done())
7171
self.assertTrue(fs_2.done())
7272

73-
def test_errors(self):
73+
def test_invalid_constructor_arguments_raise_errors(self):
7474
with self.assertRaises(TypeError):
7575
SingleNodeExecutor(
7676
max_cores=1,

0 commit comments

Comments
 (0)