nodeocc 1.0.3__tar.gz → 1.0.4__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.
- {nodeocc-1.0.3 → nodeocc-1.0.4}/PKG-INFO +1 -1
- {nodeocc-1.0.3 → nodeocc-1.0.4}/pyproject.toml +1 -1
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/controller/controller.py +1 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/nodeocc.egg-info/PKG-INFO +1 -1
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/readers/slurmreader.py +19 -19
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/view/slurm_list.py +1 -1
- {nodeocc-1.0.3 → nodeocc-1.0.4}/README.md +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/setup.cfg +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/setup.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/__init__.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/model/infrastructure.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/model/job.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/nodeocc.egg-info/SOURCES.txt +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/nodeocc.egg-info/dependency_links.txt +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/nodeocc.egg-info/entry_points.txt +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/nodeocc.egg-info/requires.txt +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/nodeocc.egg-info/top_level.txt +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/readers/compute_wait_time.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/view/__init__.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/view/curses_multiwindow.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/view/slurm_viz.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/view/styles.py +0 -0
- {nodeocc-1.0.3 → nodeocc-1.0.4}/src/view/utils.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nodeocc"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.4"
|
|
8
8
|
authors = [{ name = "Matteo Boschini" }]
|
|
9
9
|
maintainers = [{ name = "Lorenzo Bonicelli" }, { name = "Aniello Panariello" }]
|
|
10
10
|
description = "TUI application for viewing the status of GPU allocations on a Slurm cluster"
|
|
@@ -151,27 +151,29 @@ def _load_joblet_meta(line):
|
|
|
151
151
|
|
|
152
152
|
|
|
153
153
|
def _gpus_per_joblet(line):
|
|
154
|
-
|
|
154
|
+
try:
|
|
155
|
+
if 'node=1' in line['TRES_ALLOC']:
|
|
156
|
+
return line['TRES_ALLOC'].split('gpu=')[-1].split(',')[0] if 'gpu=' in line['TRES_ALLOC'] else 0
|
|
157
|
+
else:
|
|
158
|
+
node = line['NODELIST']
|
|
159
|
+
node_idx = line['ALL_JOB_NODES'].split(',').index(node)
|
|
160
|
+
return int(re.findall(r'gpu:(\d+)', line['TRES_PER_NODE'])[node_idx]) if 'gpu:' in line['TRES_PER_NODE'] else 0
|
|
161
|
+
except BaseException as e:
|
|
155
162
|
return 0
|
|
156
|
-
if line['ALL_JOB_NODES'].count(',') == 0:
|
|
157
|
-
return line['TRES_ALLOC'].split('gpu=')[-1].split(',')[0] if 'gpu=' in line['TRES_ALLOC'] else 0
|
|
158
|
-
else:
|
|
159
|
-
node = line['NODELIST']
|
|
160
|
-
node_idx = line['ALL_JOB_NODES'].split(',').index(node)
|
|
161
|
-
return int(re.findall(r'gpu:(\d+)', line['TRES_PER_NODE'])[node_idx]) if 'gpu:' in line['TRES_PER_NODE'] else 0
|
|
162
163
|
|
|
163
164
|
|
|
164
165
|
def _cpus_per_joblet(line):
|
|
165
|
-
|
|
166
|
+
try:
|
|
167
|
+
if 'node=1' in line['TRES_ALLOC']:
|
|
168
|
+
return int(str(line['TRES_ALLOC']).split('cpu=')[-1].split(',')[0])
|
|
169
|
+
else:
|
|
170
|
+
nodes = line['NODES']
|
|
171
|
+
tot_gpu = int(str(line['TRES_ALLOC']).split('gpu=')[-1].split(',')[0]) if 'gpu=' in str(line['TRES_ALLOC']) else 0
|
|
172
|
+
tot_cpus = int(str(line['TRES_ALLOC']).split('cpu=')[-1].split(',')[0])
|
|
173
|
+
n_gpus = line['joblet_gpus']
|
|
174
|
+
return int(tot_cpus) // int(nodes) if tot_gpu == 0 else int(tot_cpus) // tot_gpu * n_gpus
|
|
175
|
+
except BaseException as e:
|
|
166
176
|
return 0
|
|
167
|
-
if line['ALL_JOB_NODES'].count(',') == 0:
|
|
168
|
-
return int(str(line['TRES_ALLOC']).split('cpu=')[-1].split(',')[0])
|
|
169
|
-
else:
|
|
170
|
-
nodes = line['NODES']
|
|
171
|
-
tot_gpu = int(str(line['TRES_ALLOC']).split('gpu=')[-1].split(',')[0]) if 'gpu=' in str(line['TRES_ALLOC']) else 0
|
|
172
|
-
tot_cpus = int(str(line['TRES_ALLOC']).split('cpu=')[-1].split(',')[0])
|
|
173
|
-
n_gpus = line['joblet_gpus']
|
|
174
|
-
return int(tot_cpus) // int(nodes) if tot_gpu == 0 else int(tot_cpus) // tot_gpu * n_gpus
|
|
175
177
|
|
|
176
178
|
|
|
177
179
|
memunits = {
|
|
@@ -192,8 +194,6 @@ def parse_mem(thing):
|
|
|
192
194
|
|
|
193
195
|
|
|
194
196
|
def _mem_per_joblet(line):
|
|
195
|
-
if pd.isna(line['ALL_JOB_NODES']):
|
|
196
|
-
return 0
|
|
197
197
|
try:
|
|
198
198
|
mem = line['TRES_ALLOC'].split('mem=')[-1].split(',')[0]
|
|
199
199
|
if 'G' in mem:
|
|
@@ -205,7 +205,7 @@ def _mem_per_joblet(line):
|
|
|
205
205
|
except BaseException:
|
|
206
206
|
return 0
|
|
207
207
|
|
|
208
|
-
if line['
|
|
208
|
+
if 'node=1' in line['TRES_ALLOC']:
|
|
209
209
|
return mem
|
|
210
210
|
else:
|
|
211
211
|
nodes = line['NODES']
|
|
@@ -47,7 +47,7 @@ def _joblet_format(instance, job, width=74, jobid_type='agg'):
|
|
|
47
47
|
if instance.view_mode in ('gpu', 'ram'):
|
|
48
48
|
joblet_repr += _format_to((f'{joblet.n_gpus}gp' if joblet.n_gpus > 0 else " - "), 3, 'left')
|
|
49
49
|
elif instance.view_mode == 'cpu':
|
|
50
|
-
joblet_repr += _format_to((f'{joblet.cpus}cp' if joblet.cpus > 0 else "-"), 3, 'left')
|
|
50
|
+
joblet_repr += _format_to((f'{joblet.cpus}cp' if joblet.cpus > 0 else " - "), 3, 'left')
|
|
51
51
|
joblet_repr += ' '
|
|
52
52
|
joblet_repr += _format_to(joblet.node if joblet.node is not None else job.reason, 11)
|
|
53
53
|
joblet_reprs.append(joblet_repr)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|