Skip to content

Commit

Permalink
tries making constraint a param
Browse files Browse the repository at this point in the history
because can't get a v100-32gb GPU if we're asking for no gpus
  • Loading branch information
billbrod committed Oct 5, 2020
1 parent 9911a8c commit d74f614
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@ def get_partition(wildcards, cluster):
part += ',p100_4'
return part

def get_constraint(wildcards, cluster):
if wildcards.gpu > 0 and cluster == 'rusty':
return 'v100-32gb'
else:
return ''

rule create_metamers:
input:
ref_image = lambda wildcards: utils.get_ref_image_full_path(wildcards.image_name),
Expand Down Expand Up @@ -608,6 +614,7 @@ rule create_metamers:
time = lambda wildcards: {'V1': '12:00:00', 'RGC': '5-00:00:00'}[wildcards.model_name.split('_')[0]],
rusty_partition = lambda wildcards: get_partition(wildcards, 'rusty'),
prince_partition = lambda wildcards: get_partition(wildcards, 'prince'),
rusty_constraint = lambda wildcards: get_constraitn(wildcards, 'rusty'),
run:
import foveated_metamers as met
import contextlib
Expand Down Expand Up @@ -694,6 +701,7 @@ rule continue_metamers:
time = lambda wildcards: {'V1': '12:00:00', 'RGC': '5-00:00:00'}[wildcards.model_name.split('_')[0]],
rusty_partition = lambda wildcards: get_partition(wildcards, 'rusty'),
prince_partition = lambda wildcards: get_partition(wildcards, 'prince'),
rusty_constraint = lambda wildcards: get_constraitn(wildcards, 'rusty'),
run:
import foveated_metamers as met
import contextlib
Expand Down
4 changes: 2 additions & 2 deletions rusty.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
{
"gres": "gpu:{resources.gpu}",
"partition": "{params.rusty_partition}",
"constraint": "v100-32gb",
"constraint": "{params.rusty_constraint}",
"time": "{params.time}"
},
"continue_metamers":
{
"gres": "gpu:{resources.gpu}",
"partition": "{params.rusty_partition}",
"constraint": "v100-32gb",
"constraint": "{params.rusty_constraint}",
"time": "{params.time}"
},
"cache_windows":
Expand Down

0 comments on commit d74f614

Please sign in to comment.