oh-my-batch 0.4.7__tar.gz → 0.4.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/PKG-INFO +1 -11
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/README.md +0 -10
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/job.py +20 -1
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/pyproject.toml +1 -1
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/LICENSE +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/__init__.py +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/__main__.py +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/assets/__init__.py +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/assets/functions.sh +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/batch.py +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/cli.py +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/combo.py +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/misc.py +0 -0
- {oh_my_batch-0.4.7 → oh_my_batch-0.4.8}/oh_my_batch/util.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: oh-my-batch
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.8
|
4
4
|
Summary:
|
5
5
|
License: GPL
|
6
6
|
Author: weihong.xu
|
@@ -44,16 +44,6 @@ To make the best use of `oh-my-batch`, you need to know some shell tips.
|
|
44
44
|
* [Run multiple line shell script with ssh](https://stackoverflow.com/a/32082912/3099733)
|
45
45
|
|
46
46
|
## Use cases
|
47
|
-
### Load functions in shell script
|
48
|
-
You can load useful functions from `oh-my-batch` this way:
|
49
|
-
|
50
|
-
```bash
|
51
|
-
eval "$(omb misc export-shell-func)"
|
52
|
-
# or
|
53
|
-
omb misc export-shell-func > omb-func.sh && source omb-func.sh
|
54
|
-
```
|
55
|
-
|
56
|
-
This will load extra functions to your shell script, for example, `checkpoint`.
|
57
47
|
|
58
48
|
### Generate files from different combinations of parameters
|
59
49
|
|
@@ -25,16 +25,6 @@ To make the best use of `oh-my-batch`, you need to know some shell tips.
|
|
25
25
|
* [Run multiple line shell script with ssh](https://stackoverflow.com/a/32082912/3099733)
|
26
26
|
|
27
27
|
## Use cases
|
28
|
-
### Load functions in shell script
|
29
|
-
You can load useful functions from `oh-my-batch` this way:
|
30
|
-
|
31
|
-
```bash
|
32
|
-
eval "$(omb misc export-shell-func)"
|
33
|
-
# or
|
34
|
-
omb misc export-shell-func > omb-func.sh && source omb-func.sh
|
35
|
-
```
|
36
|
-
|
37
|
-
This will load extra functions to your shell script, for example, `checkpoint`.
|
38
28
|
|
39
29
|
### Generate files from different combinations of parameters
|
40
30
|
|
@@ -94,6 +94,25 @@ class BaseJobManager:
|
|
94
94
|
error = True
|
95
95
|
if error:
|
96
96
|
raise RuntimeError('Some jobs failed')
|
97
|
+
|
98
|
+
def wait(self, *job_ids, timeout=None, interval=10):
|
99
|
+
"""
|
100
|
+
Wait for jobs to finish
|
101
|
+
|
102
|
+
:param job_ids: Job ids to wait for
|
103
|
+
:param timeout: Timeout in seconds
|
104
|
+
:param interval: Interval in seconds for checking job status
|
105
|
+
"""
|
106
|
+
current = time.time()
|
107
|
+
while True:
|
108
|
+
jobs = [{'id': j, 'state': JobState.NULL} for j in job_ids]
|
109
|
+
jobs = self._update_state(jobs)
|
110
|
+
if all(JobState.is_terminal(j['state']) for j in jobs):
|
111
|
+
break
|
112
|
+
if timeout and time.time() - current > timeout:
|
113
|
+
logger.error('Timeout, current state: %s', jobs)
|
114
|
+
break
|
115
|
+
time.sleep(interval)
|
97
116
|
|
98
117
|
def _update_jobs(self, jobs: List[dict], max_tries: int, submit_opts: str):
|
99
118
|
jobs = self._update_state(jobs)
|
@@ -135,7 +154,7 @@ class Slurm(BaseJobManager):
|
|
135
154
|
logger.error('Failed to query job status: %s', log_cp(cp))
|
136
155
|
return jobs
|
137
156
|
out = cp.stdout.decode('utf-8')
|
138
|
-
logger.
|
157
|
+
logger.debug('Job status:\n%s', out)
|
139
158
|
new_state = parse_csv(out)
|
140
159
|
else:
|
141
160
|
new_state = []
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|