Skip to content

Commit f4d8971

Browse files
authored
Merge branch 'master' into master
2 parents cb3321d + 8c4e39b commit f4d8971

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

examples/readstream.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ def display(eventrec):
2727
for i in range(0,numhosts):
2828
hoststr += lsf.stringArray_getitem(exechosts, i) + ""
2929
print("EVENT_JOB_FORCE jobid<%d>, execHost<%s>, username<%s>" %(jobid, hoststr, username))
30-
30+
elif eventrec.type == lsf.EVENT_JOB_RUN_RUSAGE:
31+
jobid = eventrec.eventLog.jobRunRusageLog.jobid;
32+
numpgids = eventrec.eventLog.jobRunRusageLog.jrusage.npgids;
33+
for i in range(0,numpgids):
34+
pgids = str(lsf.intArray_getitem(eventrec.eventLog.jobRunRusageLog.jrusage.pgid, i)) + " "
35+
pgids = pgids[:-1]
36+
numpids = eventrec.eventLog.jobRunRusageLog.jrusage.npids;
37+
for i in range(0,numpids):
38+
pids = str(lsf.pidInfoArray_getitem(eventrec.eventLog.jobRunRusageLog.jrusage.pidInfo, i).pid) + " ";
39+
pids = pids[:-1]
40+
print("EVENT_JOB_RUN_RUSAGE jobid<%d> pgids<%s> pids<%s>" %(jobid, pgids, pids))
3141
else:
3242
print("event type is %d" %(eventrec.type))
3343

pythonlsf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PROJECT = _lsf.so
1414
OBJECTS = lsf_wrap.o
1515

1616
CFLAGS = -fPIC -I$(PYTHON_INCLUDE) -I$(LSF_INCLUDE)
17-
LDFLAGS = $(LSF_LIBDIR)/liblsf.a $(LSF_LIBDIR)/libbat.a $(LSF_LIBDIR)/libfairshareadjust.so $(LSF_LIBDIR)/liblsbstream.so -lc -lnsl
17+
LDFLAGS = $(LSF_LIBDIR)/liblsf.a $(LSF_LIBDIR)/libbat.a $(LSF_LIBDIR)/libfairshareadjust.so $(LSF_LIBDIR)/liblsbstream.so -lc -lnsl -lz
1818

1919
all: $(PROJECT)
2020

pythonlsf/lsf.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ int fclose(FILE *f);
2727
#include "lib.table.h"
2828
extern struct gpuJobData* str2GpuJobData(char *str);
2929
%}
30+
typedef long off_t;
3031

3132
%pointer_functions(int, intp)
3233
%pointer_functions(float, floatp)
@@ -52,6 +53,7 @@ extern struct gpuJobData* str2GpuJobData(char *str);
5253
%array_functions(struct gpuTaskData, gpuTaskDataArray)
5354
%array_functions(struct gpuData *, gpuDataArray)
5455
%array_functions(struct migData, migDataArray)
56+
%array_functions(struct pidInfo, pidInfoArray)
5557
#endif
5658
%array_functions(LS_LONG_INT, LS_LONG_INTArray)
5759
%array_functions(guaranteedResourcePoolEnt, guaranteedResourcePoolEntArray)

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def set_gccflag_lsf_version():
6666
xlc_path = os.path.join(path, 'xlc')
6767
if os.access(xlc_path, os.F_OK):
6868
found_xlc = True
69-
os.environ["LDSHARED"] = "%s -pthread -shared -Wl,-z,relro" % xlc_path
69+
os.environ["LDSHARED"] = "%s -pthread -shared -Wl,-z,-lz,relro" % xlc_path
7070
break
7171
if found_xlc == False:
7272
print('''
@@ -90,11 +90,11 @@ def set_gccflag_lsf_version():
9090

9191
if os.access(LSF_LIBDIR + "/liblsbstream.a", os.F_OK):
9292
lsf_static_lib = [ LSF_LIBDIR + '/liblsbstream.a']
93-
lsf_dynamic_lib = ['c', 'nsl', 'rt']
93+
lsf_dynamic_lib = ['c', 'nsl', 'rt', 'z']
9494
warning_msg = ""
9595
else:
9696
lsf_static_lib = []
97-
lsf_dynamic_lib = ['c', 'nsl', 'lsbstream', 'lsf', 'bat', 'rt']
97+
lsf_dynamic_lib = ['c', 'nsl', 'lsbstream', 'lsf', 'bat', 'rt', 'z']
9898
warning_msg = '''
9999
Warning: The compatibility of the LSF Python API package is not guaranteed
100100
if you update LSF at a later time. This is because your current

0 commit comments

Comments
 (0)