Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/disp_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ def printLimit():

if __name__ == '__main__':
print("LSF Clustername is : {}".format(lsf.ls_getclustername()))
lsf.set_limit_filter_flag(True)
printLimit()
16 changes: 16 additions & 0 deletions pythonlsf/lsf.i
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -765,4 +777,8 @@ PyObject * get_host_info_all() {
return result;
}

void set_limit_filter_flag(bool_t bConfigInfo) {
setbConfigInfoFlag4Lib(bConfigInfo);
}

%}