We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7bd036 commit 1f95c07Copy full SHA for 1f95c07
1 file changed
examples/disp_gpu.py
@@ -0,0 +1,17 @@
1
+from pythonlsf import lsf
2
+if __name__ == '__main__':
3
+ print("LSF Clustername is : {}".format(lsf.ls_getclustername()))
4
+ if lsf.lsb_init("test") > 0:
5
+ exit -1;
6
+ host_names = None
7
+ num_hosts = lsf.new_intp()
8
+ lsf.intp_assign(num_hosts, 0)
9
+ host_data = lsf.lsb_hostinfo_ex(host_names, num_hosts, "", 4096)
10
+ all_host_data = lsf.hostInfoEntArray_frompointer(host_data)
11
+ for i in range(0, lsf.intp_value(num_hosts)):
12
+ hostname = all_host_data[i].host
13
+ print(hostname)
14
+ gpudata = all_host_data[i].gpuData
15
+ print("ngpus avail_shared_gpus avail_excl_gpus")
16
+ print(" {} {} {}". \
17
+ format(gpudata.ngpus, gpudata.avail_shared_ngpus, gpudata.avail_excl_ngpus))
0 commit comments