Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bc_desktop behavior #254

Merged
merged 7 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps.awesim.org/apps/bc_desktop/pitzer.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ attributes:
- [
"any", "any",
data-min-cores: 1,
data-max-cores: 80,
data-set-gpus: 0,
data-max-cores: 48,
]
- [
"40 core", "any-40core",
Expand Down
22 changes: 12 additions & 10 deletions apps.awesim.org/apps/bc_desktop/submit/slurm.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
return tasks_per_node + [ "--constraint", "48core" ]
end

def plus_gpus(arr, gpu_arr)
gpu_count.to_i > 0 ? arr + gpu_arr : arr
end

def gpu_count
if !gpus.nil? && !gpus.empty? && gpus.to_i.positive?
if !gpus.nil? && !gpus.empty? && gpus.to_i >= 0
gpus
else
1
Expand All @@ -30,23 +34,22 @@
slurm_args = case node_type
# 'any' case handled by scheduler, this is just a quick short circuit
when "any"
base_slurm_args + any_node

plus_gpus(base_slurm_args + any_node, ["--gpus-per-node", "#{gpu_count}"])
when "any-40core"
base_slurm_args + p18_node
when "any-48core"
base_slurm_args + p20_node

when "gpu-any"
base_slurm_args + any_node + ["--gpus-per-node", "#{gpu_count}"]
plus_gpus(base_slurm_args + any_node, ["--gpus-per-node", "#{gpu_count}"])
when "gpu-40core"
base_slurm_args + p18_node + ["--gpus-per-node", "#{gpu_count}"]
plus_gpus(base_slurm_args + p18_node, ["--gpus-per-node", "#{gpu_count}"])
when "gpu-48core"
base_slurm_args + p20_node + ["--gpus-per-node", "#{gpu_count}"]
plus_gpus(base_slurm_args + p20_node, ["--gpus-per-node", "#{gpu_count}"])
when "vis"
base_slurm_args + any_node + ["--gpus-per-node", "#{gpu_count}", "--gres", "vis"]
plus_gpus(base_slurm_args + any_node, ["--gpus-per-node", "#{gpu_count}", "--gres", "vis"])
when "densegpu"
base_slurm_args + p20_node + ["--gpus-per-node", "4"]
plus_gpus(base_slurm_args + p20_node, ["--gpus-per-node", "4"])

# using partitions here is easier than specifying memory requests
when "largemem"
Expand All @@ -55,7 +58,6 @@
when "hugemem"
partition = bc_num_slots.to_i > 1 ? "hugemem-parallel" : "hugemem"
base_slurm_args + tasks_per_node + ["--partition", partition ]

else
base_slurm_args
end
Expand All @@ -77,5 +79,5 @@ script:
accounting_id: "<%= account %>"
native:
<%- slurm_args.each do |arg| %>
- "<%= arg %>"
- "<%= arg %>"
<%- end %>
3 changes: 1 addition & 2 deletions ondemand.osc.edu/apps/bc_desktop/pitzer.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ attributes:
- [
"any", "any",
data-min-cores: 1,
data-max-cores: 80,
data-set-gpus: 0,
data-max-cores: 48,
]
- [
"40 core", "any-40core",
Expand Down
22 changes: 12 additions & 10 deletions ondemand.osc.edu/apps/bc_desktop/submit/slurm.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
return tasks_per_node + [ "--constraint", "48core" ]
end

def plus_gpus(arr, gpu_arr)
gpu_count.to_i > 0 ? arr + gpu_arr : arr
end

def gpu_count
if !gpus.nil? && !gpus.empty? && gpus.to_i.positive?
if !gpus.nil? && !gpus.empty? && gpus.to_i >= 0
gpus
else
1
Expand All @@ -30,23 +34,22 @@
slurm_args = case node_type
# 'any' case handled by scheduler, this is just a quick short circuit
when "any"
base_slurm_args + any_node

plus_gpus(base_slurm_args + any_node, ["--gpus-per-node", "#{gpu_count}"])
when "any-40core"
base_slurm_args + p18_node
when "any-48core"
base_slurm_args + p20_node

when "gpu-any"
base_slurm_args + any_node + ["--gpus-per-node", "#{gpu_count}"]
plus_gpus(base_slurm_args + any_node, ["--gpus-per-node", "#{gpu_count}"])
when "gpu-40core"
base_slurm_args + p18_node + ["--gpus-per-node", "#{gpu_count}"]
plus_gpus(base_slurm_args + p18_node, ["--gpus-per-node", "#{gpu_count}"])
when "gpu-48core"
base_slurm_args + p20_node + ["--gpus-per-node", "#{gpu_count}"]
plus_gpus(base_slurm_args + p20_node, ["--gpus-per-node", "#{gpu_count}"])
when "vis"
base_slurm_args + any_node + ["--gpus-per-node", "#{gpu_count}", "--gres", "vis"]
plus_gpus(base_slurm_args + any_node, ["--gpus-per-node", "#{gpu_count}", "--gres", "vis"])
when "densegpu"
base_slurm_args + p20_node + ["--gpus-per-node", "4"]
plus_gpus(base_slurm_args + p20_node, ["--gpus-per-node", "4"])

# using partitions here is easier than specifying memory requests
when "largemem"
Expand All @@ -55,7 +58,6 @@
when "hugemem"
partition = bc_num_slots.to_i > 1 ? "hugemem-parallel" : "hugemem"
base_slurm_args + tasks_per_node + ["--partition", partition ]

else
base_slurm_args
end
Expand All @@ -77,5 +79,5 @@ script:
accounting_id: "<%= account %>"
native:
<%- slurm_args.each do |arg| %>
- "<%= arg %>"
- "<%= arg %>"
<%- end %>
Loading