Skip to content

Commit d7b20a3

Browse files
authored
Turn off pipe be default (#861)
2 parents 78e7505 + c1b0985 commit d7b20a3

3 files changed

Lines changed: 46 additions & 2 deletions

File tree

arc/job/pipe/pipe_coordinator_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@
2323
from arc.species import ARCSpecies
2424

2525

26+
_pipe_patches = []
27+
28+
29+
def setUpModule():
30+
"""Enable pipe mode for all tests in this module."""
31+
global _pipe_patches
32+
pipe_vals = {'enabled': True, 'min_tasks': 10, 'max_workers': 100,
33+
'max_attempts': 3, 'lease_duration_s': 86400}
34+
p = patch.dict('arc.job.pipe.pipe_coordinator.pipe_settings', pipe_vals)
35+
p.start()
36+
_pipe_patches.append(p)
37+
38+
39+
def tearDownModule():
40+
"""Restore pipe settings."""
41+
global _pipe_patches
42+
for p in _pipe_patches:
43+
p.stop()
44+
_pipe_patches.clear()
45+
46+
2647
def _make_spec(task_id, task_family='conf_opt', engine='mockter', level=None,
2748
species_label='H2O', conformer_index=0, cores=4, mem=2048):
2849
"""Helper to create a TaskSpec for testing."""

arc/job/pipe/pipe_planner_test.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,37 @@
88
import shutil
99
import tempfile
1010
import unittest
11-
from unittest.mock import MagicMock
11+
from unittest.mock import MagicMock, patch
1212

1313
from arc.job.pipe.pipe_coordinator import PipeCoordinator
1414
from arc.job.pipe.pipe_planner import PipePlanner
1515
from arc.level import Level
1616
from arc.species import ARCSpecies
1717

1818

19+
_pipe_patches = []
20+
21+
22+
def setUpModule():
23+
"""Enable pipe mode for all tests in this module."""
24+
global _pipe_patches
25+
pipe_vals = {'enabled': True, 'min_tasks': 10, 'max_workers': 100,
26+
'max_attempts': 3, 'lease_duration_s': 86400}
27+
for target in ('arc.job.pipe.pipe_coordinator.pipe_settings',
28+
'arc.job.pipe.pipe_planner.pipe_settings'):
29+
p = patch.dict(target, pipe_vals)
30+
p.start()
31+
_pipe_patches.append(p)
32+
33+
34+
def tearDownModule():
35+
"""Restore pipe settings."""
36+
global _pipe_patches
37+
for p in _pipe_patches:
38+
p.stop()
39+
_pipe_patches.clear()
40+
41+
1942
def _make_mock_sched(project_directory):
2043
"""Create a mock Scheduler with attributes the planner needs."""
2144
sched = MagicMock()

arc/settings/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
# Pipe mode settings: distributed HPC execution via job arrays.
303303
# These can be overridden in ~/.arc/settings.py.
304304
pipe_settings = {
305-
'enabled': True, # Set to False to disable pipe mode entirely.
305+
'enabled': False, # Set to True to enable pipe mode (it is off by default, use it for large compute campaigns).
306306
'min_tasks': 10, # Minimum batch size to trigger pipe mode.
307307
'max_workers': 100, # Upper bound on array worker slots per PipeRun.
308308
'max_attempts': 3, # Retry budget per task before terminal failure.

0 commit comments

Comments
 (0)