Skip to content

Commit d1b8510

Browse files
authored
Add deprecation warning for the CobaltProvider (#3101)
Cobalt scheduler is no longer in use in any of the major ALCF machines. At this point only JLSE uses Cobalt. Since we don't know for sure if there are any parsl users on JLSE, I'm adding a deprecation notice with intent to remove the CobaltProvider by 2024-04.
1 parent 3203888 commit d1b8510

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

parsl/providers/cobalt/cobalt.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22
import os
33
import time
4+
import warnings
45

56
from parsl.providers.errors import ScaleOutFailed
67
from parsl.channels import LocalChannel
@@ -24,6 +25,8 @@
2425
class CobaltProvider(ClusterProvider, RepresentationMixin):
2526
""" Cobalt Execution Provider
2627
28+
WARNING: CobaltProvider is deprecated and will be removed by 2024.04
29+
2730
This provider uses cobalt to submit (qsub), obtain the status of (qstat), and cancel (qdel)
2831
jobs. Theo script to be used is created from a template file in this
2932
same module.
@@ -86,6 +89,9 @@ def __init__(self,
8689
self.queue = queue
8790
self.scheduler_options = scheduler_options
8891
self.worker_init = worker_init
92+
warnings.warn("CobaltProvider is deprecated; This will be removed after 2024-04",
93+
DeprecationWarning,
94+
stacklevel=2)
8995

9096
def _status(self):
9197
"""Returns the status list for a list of job_ids
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import warnings
2+
import pytest
3+
from parsl.providers import CobaltProvider
4+
5+
6+
@pytest.mark.local
7+
def test_deprecation_warning():
8+
9+
with warnings.catch_warnings(record=True) as w:
10+
warnings.simplefilter("always")
11+
12+
CobaltProvider()
13+
14+
assert len(w) == 1
15+
assert issubclass(w[-1].category, DeprecationWarning)
16+
assert "CobaltProvider" in str(w[-1].message)

0 commit comments

Comments
 (0)