Skip to content

Commit

Permalink
Rename gpus_per_task to gpu_limit
Browse files Browse the repository at this point in the history
GPU on SLURM can be supported by a variety of flags, usually --gres, so
`gpus_per_task` was a misleading name.
  • Loading branch information
jennydaman committed Feb 8, 2022
1 parent 33c58b6 commit 87b68ae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pman/cromwell/slurm/wdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
sharedir: '{{ sharedir }}'
cpu: '{{ (cpu_limit / 1000)|round(method='ceil')|int }}'
memory: '{{ (memory_limit * 1.048576)|round(method='ceil')|int }}M'
gpus_per_task: '{{ gpu_limit }}'
gpu_limit: '{{ gpu_limit }}'
number_of_workers: '{{ number_of_workers }}'
timelimit: '{{ timelimit }}'
{%- if partition %}
Expand Down Expand Up @@ -81,15 +81,15 @@ def from_wdl(cls, wdl: StrWdl) -> 'SlurmJob':
sharedir, end = cls._get_resource(wdl, 'sharedir', end)
cpu, end = cls._get_resource(wdl, 'cpu', end)
memory, end = cls._get_resource(wdl, 'memory', end)
gpus_per_task, end = cls._get_resource(wdl, 'gpus_per_task', end)
gpu_limit, end = cls._get_resource(wdl, 'gpu_limit', end)
number_of_workers, end = cls._get_resource(wdl, 'number_of_workers', end)
timelimit, end = cls._get_resource(wdl, 'timelimit', end)
partition, _ = cls._find_between(wdl, "slurm_partition: '", "'\n", end)
r = Resources(
number_of_workers=int(number_of_workers),
cpu_limit=cls.__serialize_cpu(cpu),
memory_limit=cls.__serialize_mem(memory),
gpu_limit=int(gpus_per_task)
gpu_limit=int(gpu_limit)
)
return cls(Image(image), command.strip(), sharedir, r, int(timelimit), partition)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name = 'pman',
version = '3.4.0',
version = '3.4.1',
description = 'Process Manager',
long_description = readme,
author = 'FNNDSC Developers',
Expand Down
6 changes: 3 additions & 3 deletions tests/cromwell/examples/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
],
"actualWorkflowLanguageVersion": "1.0",
"submittedFiles": {
"workflow": "\nversion 1.0\n\ntask plugin_instance {\n command {\n office_convert /share/incoming /share/outgoing\n } #ENDCOMMAND\n runtime {\n docker: 'docker.io/fnndsc/pl-office-convert:0.0.1'\n sharedir: '/mounted/storebase/example-jid-1234'\n cpu: '2'\n memory: '4195M'\n gpus_per_task: '0'\n number_of_workers: '1'\n timelimit: '5'\n slurm_partition: 'my-slurm-partition'\n }\n}\n\nworkflow ChRISJob {\n call plugin_instance\n}",
"workflow": "\nversion 1.0\n\ntask plugin_instance {\n command {\n office_convert /share/incoming /share/outgoing\n } #ENDCOMMAND\n runtime {\n docker: 'docker.io/fnndsc/pl-office-convert:0.0.1'\n sharedir: '/mounted/storebase/example-jid-1234'\n cpu: '2'\n memory: '4195M'\n gpu_limit: '0'\n number_of_workers: '1'\n timelimit: '5'\n slurm_partition: 'my-slurm-partition'\n }\n}\n\nworkflow ChRISJob {\n call plugin_instance\n}",
"workflowType": "WDL",
"root": "",
"workflowTypeVersion": "1.0",
Expand Down Expand Up @@ -366,7 +366,7 @@
response_notstarted = r"""
{
"submittedFiles": {
"workflow": "\nversion 1.0\n\ntask plugin_instance {\n command {\n /usr/local/bin/python /usr/local/bin/whatsgood --day sunny /share/incoming /share/outgoing\n } #ENDCOMMAND\n runtime {\n docker: 'ghcr.io/fnndsc/pl-salute-the-sun:latest'\n sharedir: '/storebase/key-vitamin-d'\n cpu: '2'\n memory: '5954M'\n gpus_per_task: '2'\n number_of_workers: '1'\n timelimit: '50'\n }\n}\n\nworkflow ChRISJob {\n call plugin_instance\n}",
"workflow": "\nversion 1.0\n\ntask plugin_instance {\n command {\n /usr/local/bin/python /usr/local/bin/whatsgood --day sunny /share/incoming /share/outgoing\n } #ENDCOMMAND\n runtime {\n docker: 'ghcr.io/fnndsc/pl-salute-the-sun:latest'\n sharedir: '/storebase/key-vitamin-d'\n cpu: '2'\n memory: '5954M'\n gpu_limit: '2'\n number_of_workers: '1'\n timelimit: '50'\n }\n}\n\nworkflow ChRISJob {\n call plugin_instance\n}",
"root": "",
"options": "{\n\n}",
"inputs": "{}",
Expand Down Expand Up @@ -412,7 +412,7 @@
],
"actualWorkflowLanguageVersion": "1.0",
"submittedFiles": {
"workflow": "\nversion 1.0\n\ntask plugin_instance {\n command {\n /usr/local/bin/python /usr/local/bin/fruit_machine --salad orange /share/incoming /share/outgoing\n } #ENDCOMMAND\n runtime {\n docker: 'internal.gitlab:5678/fnndsc/pl-fruit:1.2.3'\n sharedir: '/storebase/key-fruity-fruit'\n cpu: '1'\n memory: '828M'\n gpus_per_task: '0'\n number_of_workers: '3'\n timelimit: '70'\n }\n}\n\nworkflow ChRISJob {\n call plugin_instance\n}",
"workflow": "\nversion 1.0\n\ntask plugin_instance {\n command {\n /usr/local/bin/python /usr/local/bin/fruit_machine --salad orange /share/incoming /share/outgoing\n } #ENDCOMMAND\n runtime {\n docker: 'internal.gitlab:5678/fnndsc/pl-fruit:1.2.3'\n sharedir: '/storebase/key-fruity-fruit'\n cpu: '1'\n memory: '828M'\n gpu_limit: '0'\n number_of_workers: '3'\n timelimit: '70'\n }\n}\n\nworkflow ChRISJob {\n call plugin_instance\n}",
"root": "",
"options": "{\n\n}",
"inputs": "{}",
Expand Down
4 changes: 2 additions & 2 deletions tests/cromwell/examples/wdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
sharedir: '/location/of/bribe'
cpu: '2'
memory: '5954M'
gpus_per_task: '0'
gpu_limit: '0'
number_of_workers: '9'
timelimit: '12'
}
Expand Down Expand Up @@ -70,7 +70,7 @@
sharedir: '/neuroimaging/data'
cpu: '7'
memory: '10356M'
gpus_per_task: '6'
gpu_limit: '6'
number_of_workers: '5'
timelimit: '300'
slurm_partition: 'has-gpu'
Expand Down

0 comments on commit 87b68ae

Please sign in to comment.