diff --git a/balsam/__init__.py b/balsam/__init__.py index c5aec0d9..47b27195 100644 --- a/balsam/__init__.py +++ b/balsam/__init__.py @@ -1,4 +1,4 @@ from balsam.util import config_root_logger -__version__ = "0.7.0.a20" +__version__ = "0.7.0.a21" config_root_logger() diff --git a/balsam/_api/manager.py b/balsam/_api/manager.py index 6a202654..2a5e2941 100644 --- a/balsam/_api/manager.py +++ b/balsam/_api/manager.py @@ -161,7 +161,6 @@ def _unpack_list_response(self, response_data: Dict[str, Any]) -> Tuple[int, Lis def _fetch_pages( self, filters: Dict[str, Any], ordering: Optional[str], limit: Optional[int], offset: Optional[int] ) -> Tuple[int, List[Dict[str, Any]]]: - base_offset = 0 if offset is None else offset page_size = MAX_PAGE_SIZE if limit is None else min(limit, MAX_PAGE_SIZE) @@ -191,7 +190,6 @@ def _get_list( limit: Optional[int], offset: Optional[int], ) -> Tuple[List[T], int]: - filter_chunks = self._chunk_filters(filters) full_count: int = 0 full_results: List[Dict[str, Any]] = [] diff --git a/balsam/_api/models.py b/balsam/_api/models.py index 6a71d3e7..0c3fcdaa 100644 --- a/balsam/_api/models.py +++ b/balsam/_api/models.py @@ -1,5 +1,5 @@ # This file was auto-generated via /Users/turam/opt/miniconda3/bin/python balsam/schemas/api_generator.py -# [git rev 3fcc4a5] +# [git rev ce4bdce] # Do *not* make changes to the API by changing this file! import datetime @@ -765,7 +765,7 @@ class BatchJob(balsam._api.bases.BatchJobBase): job_mode = Field[balsam.schemas.batchjob.JobMode]() optional_params = Field[typing.Dict[str, str]]() filter_tags = Field[typing.Dict[str, str]]() - partitions = Field[Optional[typing.Union[typing.List[balsam.schemas.batchjob.BatchJobPartition], None]]]() + partitions = Field[typing.Optional[typing.List[balsam.schemas.batchjob.BatchJobPartition]]]() site_id = Field[int]() project = Field[str]() queue = Field[str]() @@ -786,7 +786,7 @@ def __init__( queue: str, optional_params: Optional[typing.Dict[str, str]] = None, filter_tags: Optional[typing.Dict[str, str]] = None, - partitions: Optional[typing.Union[typing.List[balsam.schemas.batchjob.BatchJobPartition], None]] = None, + partitions: Optional[typing.Optional[typing.List[balsam.schemas.batchjob.BatchJobPartition]]] = None, **kwargs: Any, ) -> None: """ @@ -918,7 +918,7 @@ def create( queue: str, optional_params: Optional[typing.Dict[str, str]] = None, filter_tags: Optional[typing.Dict[str, str]] = None, - partitions: Optional[typing.Union[typing.List[balsam.schemas.batchjob.BatchJobPartition], None]] = None, + partitions: Optional[typing.Optional[typing.List[balsam.schemas.batchjob.BatchJobPartition]]] = None, ) -> BatchJob: """ Create a new BatchJob object and save it to the API in one step. diff --git a/balsam/client/requests_client.py b/balsam/client/requests_client.py index 723a653b..ccec6656 100644 --- a/balsam/client/requests_client.py +++ b/balsam/client/requests_client.py @@ -21,7 +21,6 @@ class NotAuthenticatedError(Exception): class RequestsClient(RESTClient): - _client_classes: "Dict[str, Type[RequestsClient]]" = {} @staticmethod diff --git a/balsam/cmdline/_launcher.py b/balsam/cmdline/_launcher.py index ddbc88d7..13aeb67c 100644 --- a/balsam/cmdline/_launcher.py +++ b/balsam/cmdline/_launcher.py @@ -157,7 +157,7 @@ def launcher( for proc in launcher_procs: try: proc.wait(timeout=1) - except (subprocess.TimeoutExpired): + except subprocess.TimeoutExpired: pass else: done_procs.append(proc) diff --git a/balsam/platform/compute_node/alcf_cooley_node.py b/balsam/platform/compute_node/alcf_cooley_node.py index 7e71f7ad..393f07f2 100644 --- a/balsam/platform/compute_node/alcf_cooley_node.py +++ b/balsam/platform/compute_node/alcf_cooley_node.py @@ -5,7 +5,6 @@ class CooleyNode(ComputeNode): - cpu_ids = list(range(12)) gpu_ids = list(range(2)) diff --git a/balsam/platform/compute_node/alcf_polaris_node.py b/balsam/platform/compute_node/alcf_polaris_node.py index 1edef7ba..b5283c3b 100644 --- a/balsam/platform/compute_node/alcf_polaris_node.py +++ b/balsam/platform/compute_node/alcf_polaris_node.py @@ -10,7 +10,6 @@ class PolarisNode(ComputeNode): - # turam: confirm number of cpus cpu_ids = list(range(64)) gpu_ids: List[IntStr] = list(range(4)) diff --git a/balsam/platform/compute_node/alcf_sunspot_node.py b/balsam/platform/compute_node/alcf_sunspot_node.py index 511ec06f..715f4e42 100644 --- a/balsam/platform/compute_node/alcf_sunspot_node.py +++ b/balsam/platform/compute_node/alcf_sunspot_node.py @@ -9,7 +9,6 @@ class SunspotNode(ComputeNode): - cpu_ids = list(range(104)) gpu_ids: List[IntStr] diff --git a/balsam/platform/compute_node/alcf_thetagpu_node.py b/balsam/platform/compute_node/alcf_thetagpu_node.py index 0ceb439d..112fc81c 100644 --- a/balsam/platform/compute_node/alcf_thetagpu_node.py +++ b/balsam/platform/compute_node/alcf_thetagpu_node.py @@ -10,7 +10,6 @@ class ThetaGPUNode(ComputeNode): - cpu_ids = list(range(128)) gpu_ids: List[IntStr] = list(range(8)) diff --git a/balsam/platform/compute_node/alcf_thetaknl_node.py b/balsam/platform/compute_node/alcf_thetaknl_node.py index ea6894c0..c17057f0 100644 --- a/balsam/platform/compute_node/alcf_thetaknl_node.py +++ b/balsam/platform/compute_node/alcf_thetaknl_node.py @@ -5,7 +5,6 @@ class ThetaKNLNode(ComputeNode): - cpu_ids = list(range(64)) gpu_ids: List[Union[int, str]] = [] diff --git a/balsam/platform/compute_node/compute_node.py b/balsam/platform/compute_node/compute_node.py index 6cf5d03f..a18b562c 100644 --- a/balsam/platform/compute_node/compute_node.py +++ b/balsam/platform/compute_node/compute_node.py @@ -6,7 +6,6 @@ class ComputeNode: - cpu_ids: List[IntStr] = [] gpu_ids: List[IntStr] = [] diff --git a/balsam/platform/compute_node/default.py b/balsam/platform/compute_node/default.py index 293b9f0f..0d91cbf8 100644 --- a/balsam/platform/compute_node/default.py +++ b/balsam/platform/compute_node/default.py @@ -10,7 +10,6 @@ class DefaultNode(ComputeNode): - cpu_ids = list(range(psutil.cpu_count() or 4)) gpu_ids: List[Union[int, str]] = [] diff --git a/balsam/platform/compute_node/nersc_corihas_node.py b/balsam/platform/compute_node/nersc_corihas_node.py index c8d41ab3..4b92469d 100644 --- a/balsam/platform/compute_node/nersc_corihas_node.py +++ b/balsam/platform/compute_node/nersc_corihas_node.py @@ -5,7 +5,6 @@ class CoriHaswellNode(ComputeNode): - cpu_ids = list(range(32)) gpu_ids: List[Union[int, str]] = [] diff --git a/balsam/platform/compute_node/nersc_coriknl_node.py b/balsam/platform/compute_node/nersc_coriknl_node.py index 617203f7..0e500e77 100644 --- a/balsam/platform/compute_node/nersc_coriknl_node.py +++ b/balsam/platform/compute_node/nersc_coriknl_node.py @@ -7,7 +7,6 @@ class CoriKNLNode(ComputeNode): - cpu_ids: List[IntStr] = list(range(68)) gpu_ids: List[IntStr] = [] diff --git a/balsam/platform/compute_node/nersc_perlmutter_gpu.py b/balsam/platform/compute_node/nersc_perlmutter_gpu.py index c15284ef..74fda925 100644 --- a/balsam/platform/compute_node/nersc_perlmutter_gpu.py +++ b/balsam/platform/compute_node/nersc_perlmutter_gpu.py @@ -5,7 +5,6 @@ class PerlmutterGPUNode(ComputeNode): - cpu_ids = list(range(64)) gpu_ids: List[Union[int, str]] = list(range(4)) diff --git a/balsam/platform/compute_node/summit_node.py b/balsam/platform/compute_node/summit_node.py index e5ac15e5..b079c7a6 100644 --- a/balsam/platform/compute_node/summit_node.py +++ b/balsam/platform/compute_node/summit_node.py @@ -5,7 +5,6 @@ class SummitNode(ComputeNode): - cpu_ids = list(range(42)) gpu_ids = list(range(6)) diff --git a/balsam/platform/tests/test_mpirun.py b/balsam/platform/tests/test_mpirun.py index 7ac1db9d..1c021c7a 100644 --- a/balsam/platform/tests/test_mpirun.py +++ b/balsam/platform/tests/test_mpirun.py @@ -110,7 +110,6 @@ def setUp(self): @staticmethod def parse_output(output_fn): - ranks = [] sizes = [] with open(output_fn) as file: @@ -164,7 +163,6 @@ def setUp(self): @staticmethod def parse_output(output_fn): - ranks = [] sizes = [] with open(output_fn) as file: @@ -218,7 +216,6 @@ def setUp(self): @staticmethod def parse_output(output_fn): - ranks = [] sizes = [] with open(output_fn) as file: @@ -280,7 +277,6 @@ def setUp(self): @staticmethod def parse_output(output_fn): - ranks = [] sizes = [] with open(output_fn) as file: diff --git a/balsam/platform/tests/test_scheduler.py b/balsam/platform/tests/test_scheduler.py index 8acf2b8f..7523e9a6 100644 --- a/balsam/platform/tests/test_scheduler.py +++ b/balsam/platform/tests/test_scheduler.py @@ -14,7 +14,6 @@ def assertInPath(self, exe): self.assertTrue(which_exe is not None, f"'{exe}' not in PATH") def test_submit(self): - # verify script exists self.assertTrue(os.path.exists(self.script_path)) # verify submit command is in path @@ -127,7 +126,6 @@ def tearDown(self): class CobaltTest(SchedulerTestMixin, unittest.TestCase): - submit_script = """!#/usr/bin/env bash echo [$SECONDS] Running test submit script echo [$SECONDS] COBALT_JOBID = $COBALT_JOBID @@ -171,7 +169,6 @@ def tearDown(self): class SlurmTest(SchedulerTestMixin, unittest.TestCase): - submit_script = """#!/usr/bin/env bash -l echo [$SECONDS] Running test submit script echo [$SECONDS] SLURM_JOB_ID = SLURM_JOB_ID @@ -221,7 +218,6 @@ def test_get_backfill_windows(self): class LsfTest(SchedulerTestMixin, unittest.TestCase): - submit_script = """#!/usr/bin/env bash echo [$SECONDS] Running test submit script echo [$SECONDS] LSB_JOBID = $LSB_JOBID diff --git a/balsam/server/models/crud/sessions.py b/balsam/server/models/crud/sessions.py index e6e175b5..ff40985a 100644 --- a/balsam/server/models/crud/sessions.py +++ b/balsam/server/models/crud/sessions.py @@ -149,7 +149,6 @@ def _footprint_func() -> Any: def acquire( db: Session, owner: schemas.UserOut, session_id: int, spec: schemas.SessionAcquire ) -> List[Dict[str, Any]]: - session = (owned_session_query(db, owner).filter(models.Session.id == session_id)).one() session.heartbeat = datetime.utcnow() diff --git a/balsam/site/launcher/_serial_mode_master.py b/balsam/site/launcher/_serial_mode_master.py index 1cc08874..558fdc9b 100644 --- a/balsam/site/launcher/_serial_mode_master.py +++ b/balsam/site/launcher/_serial_mode_master.py @@ -82,7 +82,7 @@ def update_job_states( for id in done_ids: self.status_updater.put(id, JobState.run_done, state_timestamp=now) - for (id, retcode, tail) in error_logs: + for id, retcode, tail in error_logs: self.status_updater.put( id, JobState.run_error, state_timestamp=now, state_data={"returncode": retcode, "error": tail} ) diff --git a/tests/benchmark/locustfile.py b/tests/benchmark/locustfile.py index 17118e27..418dc236 100644 --- a/tests/benchmark/locustfile.py +++ b/tests/benchmark/locustfile.py @@ -28,6 +28,7 @@ ) TEST_BALSAM_SERVER = os.environ.get("BALSAM_TESET_SERVER", "http://0.0.0.0:8000") + # overload client using username/password token authentication class LocustBalsamClientA(BasicAuthRequestsClient): def __init__(self, api_root: str, request_event: EventHook) -> None: @@ -236,7 +237,6 @@ def bulk_job_submission(self) -> None: # simulate runnings jobs in batches steps = int(len(jobs) / simulated_nodes) + 1 for step in range(steps): - # indices of jobs to operate on start = simulated_nodes * step end = min(simulated_nodes * (step + 1), len(jobs))