-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
job scheduling information
to allow more flexible job submission (
#77) * initial commit figuring out the general shape of it * a bit more progress * fix typo * `timestamp_ok` fix to work with JSI.start_time instead of a scheduler-wide one * Add a timestamp value to JSI separate from the start time * `JobController` updates * Remove duplicate key word argument * Rename `SchedulerModeInterface` to `JobSlicerInterface` * Various fixes * `wait_all_jobs`: work correctly with per-job timeouts * Check `job_scheduling_info.log_directory` exists and make it if not * Add a terminate after total wait time to avoid getting stuck waiting for jobs stuck in a queue * use `datetime` and `timedelta` for `StatusInfo` * Set `time_to_dispatch` and `wall_time` with the right type * `_wait_for_jobs` working (to some extent!) * some progress with the job scheduler tests * `get_output_paths`: get output paths correctly from JSIs * `wait_for_ended`: use the correct lists of jobs * `_report_job_info` check actual output file, as set in JSI * `get_job_history_batch`: `batch_number=None` now returns latest batch * use `JobSchedulingInformation.set_job_script_path` * Add final `check_jobscript_is_readable` check before sending for submission * Use consistent phrasing for testing simplicity * `filter_killed_jobs`: correct typing * `resubmit_jobs`: allow filtering by job_id * progress wth tests * `test_job_scheduler_runs`: correct `create_js` args * `resubmit_killed_jobs` and `get_job_history_batch`: Fixes for tests * All tests working (resubmit tests adapted) * Remove old comment * Remove old variable from logging * Remove `StatusInfo.output_path` in favour of using JSI, use stdout path to check state * `fetch_and_update_state` use regex to check `tres_alloc_str` * String doesn't need to be f-string * Replace leftover slots reference with cpus Reformat long lines * Set minimum Python version to 3.10, plus use Python 3.10+ style typing * `resubmit_killed_jobs`: fix args (missing =) * Remove unused imports * add minimum versions to meta.yaml and environment.yaml * Refactor job slicers Add back methods in program wrapper and tweak job slicer implementations to fix job controller tests, and fix job scheduler tests * Update version number * Fix some bugs and type annotations from mypy Add back script names for some job slicers * Fix bugs in memory argument handling and make token optional * Fix logic in job scheduler waiting method Fix wrong destination of output in pass thru wrapper, and more logging info * Format imports and code * Fix expected string in test Add documentation on testing and rename test env var for slurm partition * Fix up job ID check Simplify output path in pass thru wrapper, remove odd bits * `get_job`: error messages needed to be f-strings * Set fallback job script in job slicer to current working directory --------- Co-authored-by: Peter Chang <peter.chang@diamond.ac.uk>
- Loading branch information
1 parent
d83439d
commit 12c62e8
Showing
37 changed files
with
1,775 additions
and
1,344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?eclipse-pydev version="1.0"?><pydev_project> | ||
|
||
|
||
|
||
|
||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">davidia</pydev_property> | ||
|
||
|
||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> | ||
|
||
|
||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property> | ||
|
||
|
||
|
||
|
||
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> | ||
|
||
|
||
|
||
<path>/${PROJECT_DIR_NAME}</path> | ||
|
||
</pydev_pathproperty> | ||
|
||
|
||
</pydev_pathproperty> | ||
|
||
|
||
</pydev_project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
version_info = (1, 1, 0) | ||
version_info = (2, 0, 0) | ||
__version__ = ".".join(str(c) for c in version_info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
from typing import List | ||
|
||
|
||
class AggregatorInterface: | ||
def aggregate(self, aggregation_output_dir: Path, data_files: List[Path]) -> Path: | ||
def aggregate(self, aggregation_output_dir: Path, data_files: list[Path]) -> Path: | ||
"""Aggregates data from multiple output files into one""" | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from __future__ import annotations | ||
|
||
|
||
class DataSlicerInterface: | ||
def slice(self, number_jobs: int, stop: int | None = None) -> list[slice] | None: | ||
"""Takes an input data file and returns a list of slice parameters.""" | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.