Skip to content

Commit 78ebe96

Browse files
authored
Adding support for allocation and partition specification in SDK (#93)
* add specification for allocation and partition * adding optional keyword to allocation/partition text entry * Updated UI.py with more details for allocation/partition input * fix to bug submitting job
1 parent 1d719d8 commit 78ebe96

File tree

1 file changed

+12
-2
lines changed
  • cybergis_compute_client

1 file changed

+12
-2
lines changed

cybergis_compute_client/UI.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,11 @@ def renderSlurm(self):
334334
if self.slurm[i] is not None:
335335
w.append(self.slurm[i])
336336
self.slurm['vbox'] = widgets.VBox(w)
337+
self.slurm['allocation'] = widgets.Text(placeholder='(Optional) Specify Allocation', style=self.style)
338+
self.slurm['partition'] = widgets.Text(placeholder='(Optional) Specify Partition', style=self.style)
337339

338340
# settings end
339-
self.slurm['accordion'] = widgets.Accordion(children=(widgets.VBox(children=(self.slurm['description'], self.slurm['vbox'])),), selected_index=None)
341+
self.slurm['accordion'] = widgets.Accordion(children=(widgets.VBox(children=(self.slurm['description'], self.slurm['vbox'], widgets.Label("In most cases, specifying an allocation and partition is unnecessary. Do not input anything unless you have a non-default allocation and/or partition to specify."), widgets.HBox([widgets.Label("Allocation: "), self.slurm['allocation']]), widgets.HBox([widgets.Label("Partition: "), self.slurm['partition']]))),), selected_index=None)
340342
self.slurm['accordion'].set_title(0, 'Slurm Computing Configurations')
341343
with self.slurm['output']:
342344
display(self.slurm['accordion'])
@@ -1037,13 +1039,21 @@ def get_data(self):
10371039
dict : Information about the job submitted (template,
10381040
computing resource used, slurm rules, param rules, user email)
10391041
"""
1042+
allocation = None
1043+
if self.slurm['allocation'].value != '':
1044+
allocation = self.slurm['allocation'].value
1045+
partition = None
1046+
if self.slurm['partition'].value != '':
1047+
partition = self.slurm['partition'].value
10401048
out = {
10411049
'job_template': self.jobTemplate['dropdown'].value,
10421050
'computing_resource': self.computingResource['dropdown'].value,
10431051
'slurm': {
10441052
'time': '01:00:00',
10451053
'num_of_task': 1,
1046-
'cpu_per_task': 1
1054+
'cpu_per_task': 1,
1055+
'allocation': allocation,
1056+
'partition': partition
10471057
},
10481058
'param': {},
10491059
'email': self.email['text'].value if self.email[

0 commit comments

Comments
 (0)