Skip to content

Commit 15b9043

Browse files
authored
Merge pull request #41 from liyancn/master
move lsinfo.py into examples/ and add get_pids_from_stream for multiple pid info
2 parents 9b2451b + 448d19c commit 15b9043

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lsinfo.py renamed to examples/lsinfo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,3 @@ def printLsInfo(argList):
8585
for i in range(1,len(sys.argv)):
8686
argList.append(sys.argv[i])
8787
printLsInfo(argList)
88-

pythonlsf/lsf.i

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,4 +696,17 @@ char * get_lsb_sysmsg() {
696696
return lsb_sysmsg();
697697
}
698698

699+
PyObject * get_pids_from_stream(struct jRusage * jrusage) {
700+
struct pidInfo *pidInfo;
701+
pidInfo = jrusage->pidInfo;
702+
int i = 0;
703+
PyObject *result = PyList_New(jrusage->npids);
704+
for (i = 0; i < jrusage->npids; i++) {
705+
PyObject *o = SWIG_NewPointerObj(SWIG_as_voidptr(&pidInfo[i]),
706+
SWIGTYPE_p_pidInfo, 0 | 0 );
707+
PyList_SetItem(result, i, o);
708+
}
709+
return result;
710+
}
711+
699712
%}

0 commit comments

Comments
 (0)