Skip to content

Commit 448d19c

Browse files
authored
add get_pids_from_stream
add get_pids_from_stream to get multiple pidinfo from lsb.stream
1 parent a6809ce commit 448d19c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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)