Skip to content

Commit 5addfaa

Browse files
committed
set_limit_filter_flag() added for lsb_limitInfo()
1 parent 1948917 commit 5addfaa

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

examples/disp_limit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ def printLimit():
2828

2929
if __name__ == '__main__':
3030
print("LSF Clustername is : {}".format(lsf.ls_getclustername()))
31+
lsf.set_limit_filter_flag(True)
3132
printLimit()

pythonlsf/lsf.i

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ int fclose(FILE *f);
2626
#include "lsbatch.h"
2727
#include "lib.table.h"
2828
extern struct gpuJobData* str2GpuJobData(char *str);
29+
typedef int bool_t;
30+
extern void setbConfigInfoFlag4Lib(bool_t bConfigInfo);
2931
%}
3032
typedef long off_t;
3133

@@ -247,6 +249,16 @@ static void stringArray_setitem(char * *ary, size_t index, char * value) {
247249
$1 = 0;
248250
}
249251

252+
%typemap(in) bool_t {
253+
if (PyBool_Check($input)) {
254+
$1 = (bool_t)(($input == Py_True) ? 1 : 0);
255+
} else if (PyLong_Check($input)) {
256+
$1 = (bool_t)PyLong_AsLong($input);
257+
} else {
258+
$1 = (bool_t)0;
259+
}
260+
}
261+
250262
/*
251263
The following routines are not wrapped because SWIG has issues generating
252264
proper code for them
@@ -765,4 +777,8 @@ PyObject * get_host_info_all() {
765777
return result;
766778
}
767779

780+
void set_limit_filter_flag(bool_t bConfigInfo) {
781+
setbConfigInfoFlag4Lib(bConfigInfo);
782+
}
783+
768784
%}

0 commit comments

Comments
 (0)