Skip to content
Snippets Groups Projects
Commit a20f3660 authored by Chris Hines's avatar Chris Hines
Browse files

better template for gres.conf allowing for Grid K1 GPUS and different CPU counts

Former-commit-id: 2aee70cb
parent 3125f816
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ try: ...@@ -35,7 +35,7 @@ try:
if not line : if not line :
break break
#print "Line is ",line #print "Line is ",line
pe=re.compile('GPU\s*(\d*).*Tesla\s*(\S*)') pe=re.compile('GPU\s+(\d*):\s+\S+\s+(\S*)')
m=pe.search(line) m=pe.search(line)
if not m: if not m:
#print "No match found" #print "No match found"
......
...@@ -90,6 +90,11 @@ ...@@ -90,6 +90,11 @@
register: probeOutput register: probeOutput
check_mode: no check_mode: no
- name: get cpu count
shell: 'lscpu | grep "On-line CPU" | cut -f 2 -d ":" | sed "s/\ *//g"'
register: cpucount
check_mode: no
- name: "set nvidiaprobe slurm_gres_list" - name: "set nvidiaprobe slurm_gres_list"
set_fact: "slurm_gres_list={{ probeOutput.stdout }}" set_fact: "slurm_gres_list={{ probeOutput.stdout }}"
......
#slurm gres file for {{ ansible_hostname }} #slurm gres file for {{ ansible_hostname }}
#No Of Devices={{ slurm_gres_list | length }} #No Of Devices={{ slurm_gres_list | length }}
{% for gr in slurm_gres_list %} {% for gr in slurm_gres_list %}
Name={{ gr.name }} Type={{ gr.type }} File={{ gr.file }} CPUs=0-23 Name={{ gr.name }} Type={{ gr.type }} File={{ gr.file }} CPUs={{ cpucount.stdout }}
{% endfor %} {% endfor %}
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