Skip to content
Snippets Groups Projects
Commit 039c1358 authored by Gin Tan's avatar Gin Tan
Browse files

Merge branch 'fix_gres.conf' into 'master'

Fix gres.conf

See merge request !181
parents 4fa731a8 a834e7ec
No related branches found
No related tags found
1 merge request!181Fix gres.conf
...@@ -23,7 +23,7 @@ import os ...@@ -23,7 +23,7 @@ import os
import json import json
try: try:
#run nvidia-smi -L to parse output #run nvidia-smi -L to parse output
p = subprocess.Popen(['nvidia-smi', '-L'], stdout=subprocess.PIPE, p = subprocess.Popen(['nvidia-smi', '-L'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
out, err = p.communicate() out, err = p.communicate()
...@@ -48,9 +48,9 @@ try: ...@@ -48,9 +48,9 @@ try:
if os.path.exists(devicePath): if os.path.exists(devicePath):
#print "OK" #print "OK"
deviceList.append( { 'name':'gpu' , 'file': devicePath, 'type':typeOfDevice } ) deviceList.append( { 'name':'gpu' , 'file': devicePath, 'type':typeOfDevice } )
else: else:
#print "Error file not found ",devicePath print("error looking for nvidia device")
sys.exit(0) sys.exit(1)
#now convert list to json #now convert list to json
output=json.dumps(deviceList) output=json.dumps(deviceList)
print output print output
......
#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={{ cpucount.stdout }} Name={{ gr.name }} Type={{ gpumap[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