tmetsch/platform-python-lsf-api — pull request #5 by decandia50 (2013-01-25 20:29:36+00:00)
Title: Add the ability to call lsb_hostinfo correctly

- The LSF API docs state that calling lsb_hostinfo with host=NULL and
numHosts=0 returns an array containing all of the hostInfoEnt structs
and numHosts will be set to the size of the array
- Without this patch the SWIG generation casts the pointer to the array
from lsb_hostinfo to a single struct.

- Example Code:
---------------
from pythonlsf import lsf
lsf.lsb_init('myapp')
host_names = None
num_hosts = lsf.new_intp()
lsf.intp_assign(num_hosts, 0)
host_data = lsf.lsb_hostinfo(host_names, num_hosts)
all_host_data = lsf.hostInfoEntArray_frompointer(host_data)
for i in range(0, lsf.intp_value(num_hosts)):
print(all_host_data[i].host)