From 69c169db8eb0d839279033577980ec6847e0cbb3 Mon Sep 17 00:00:00 2001 From: Peter Kang Date: Wed, 18 Feb 2026 11:51:39 -0800 Subject: [PATCH] set_limit_filter_flag() added for lsb_limitInfo() --- examples/disp_limit.py | 1 + pythonlsf/lsf.i | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) 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); +} + %}