Skip to content
Snippets Groups Projects
Unverified Commit 41d53a64 authored by Jeff Ohrstrom's avatar Jeff Ohrstrom Committed by GitHub
Browse files

Merge pull request #13 from OSC/account-select

Account select
parents 9abdf3eb 84dfaf67
No related branches found
No related tags found
No related merge requests found
<%-
groups = OodSupport::User.new.groups.sort_by(&:id).tap { |groups|
groups.unshift(groups.delete(OodSupport::Process.group))
}.map(&:name).grep(/^P./)
-%>
---
cluster:
- "owens"
- "owens-slurm"
form:
- version
- bc_account
- account
- bc_num_hours
- bc_num_slots
- num_cores
......@@ -26,9 +30,13 @@ attributes:
bc_num_slots: "1"
bc_vnc_resolution:
required: true
bc_account:
account:
label: "Project"
help: "You can leave this blank if **not** in multiple projects."
widget: select
options:
<%- groups.each do |group| %>
- "<%= group %>"
<%- end %>
node_type:
widget: select
label: "Node type"
......
<%-
ppn = num_cores.blank? ? 28 : num_cores.to_i
nodes = bc_num_slots.blank? ? 1 : bc_num_slots.to_i
torque_cluster = OodAppkit.clusters[cluster].job_config[:adapter] == 'torque'
case node_type
when "hugemem"
ppn = 48
partition = bc_num_slots.to_i > 1 ? "hugemem-parallel" : "hugemem"
slurm_args = [ "--nodes", "#{nodes}", "--ntasks-per-node", "#{ppn}", "--partition", partition ]
torque_args = "#{nodes}:ppn=#{ppn}:#{node_type}"
when "vis"
slurm_args = ["--nodes", "#{nodes}", "--ntasks-per-node", "#{ppn}", "--gpus-per-node", "1", "--gres", "vis" ]
torque_args = "#{nodes}:ppn=#{ppn}:#{node_type}:gpus=1"
else
slurm_args = ["--nodes", "#{nodes}", "--ntasks-per-node", "#{ppn}" ]
torque_args = "#{nodes}:ppn=#{ppn}"
end
%>
---
batch_connect:
template: vnc
script:
accounting_id: "<%= account %>"
native:
<%- if torque_cluster %>
resources:
nodes: "<%= torque_args %>"
<%- else %>
<%- slurm_args.each do |arg| %>
- "<%= arg %>"
<%- end %>
<%- end %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment