diff --git a/examples/disp_limit.py b/examples/disp_limit.py index c7bcead..ab715e8 100644 --- a/examples/disp_limit.py +++ b/examples/disp_limit.py @@ -28,4 +28,5 @@ def printLimit(): if __name__ == '__main__': print("LSF Clustername is : {}".format(lsf.ls_getclustername())) + lsf.set_limit_filter_flag(True) printLimit() diff --git a/pythonlsf/lsf.i b/pythonlsf/lsf.i index 9052da7..a18028d 100644 --- a/pythonlsf/lsf.i +++ b/pythonlsf/lsf.i @@ -26,6 +26,8 @@ int fclose(FILE *f); #include "lsbatch.h" #include "lib.table.h" extern struct gpuJobData* str2GpuJobData(char *str); +typedef int bool_t; +extern void setbConfigInfoFlag4Lib(bool_t bConfigInfo); %} typedef long off_t; @@ -247,6 +249,16 @@ static void stringArray_setitem(char * *ary, size_t index, char * value) { $1 = 0; } +%typemap(in) bool_t { + if (PyBool_Check($input)) { + $1 = (bool_t)(($input == Py_True) ? 1 : 0); + } else if (PyLong_Check($input)) { + $1 = (bool_t)PyLong_AsLong($input); + } else { + $1 = (bool_t)0; + } +} + /* The following routines are not wrapped because SWIG has issues generating proper code for them @@ -765,4 +777,8 @@ PyObject * get_host_info_all() { return result; } +void set_limit_filter_flag(bool_t bConfigInfo) { + setbConfigInfoFlag4Lib(bConfigInfo); +} + %}