Exemplo n.º 1
0
def query_queue(queue_name):
    """
    "query queue info"
    """

    if lsf.lsb_init("test") > 0:
        return -1;

    intp_num_queues = lsf.new_intp();
    lsf.intp_assign(intp_num_queues, 1);
    strArr = lsf.new_stringArray(1);
    #print lsf.intp_value(intp_num_queues);
    lsf.stringArray_setitem(strArr, 0, queue_name);
    #print lsf.stringArray_getitem(strArr, 0);
    queueInfo = lsf.lsb_queueinfo(strArr,intp_num_queues,None,None,0);
    if queueInfo != None:
        print 'queueInfo is not null';
    else:
        print 'queueInfo is null'
        return -1;

    print 'queue name = %s' % queueInfo.queue;
    print 'queue description = %s' % queueInfo.description; 

    return 0;
Exemplo n.º 2
0
def printQueueInfo():
    if lsf.lsb_init("test") > 0:
        return -1;

    strArr = lsf.new_stringArray(2); //array length is 2
    lsf.stringArray_setitem(strArr, 0, "normal");
    lsf.stringArray_setitem(strArr, 1, "short");

    for info in lsf.get_queue_info_by_name(strArr, 2):
        print info.queue;
        print info.description;
        print ''

    return 0;
def printQueueInfo():
    if lsf.lsb_init("test") > 0:
        return -1

    strArr = lsf.new_stringArray(2)
    lsf.stringArray_setitem(strArr, 0, "normal")
    lsf.stringArray_setitem(strArr, 1, "short")

    for info in lsf.get_queue_info_by_name(strArr, 2):
        print info.queue
        print info.description
        print ''

    return 0
def printQueueInfo():
    if lsf.lsb_init("test") > 0:
        return -1;

    strArr = lsf.new_stringArray(1); #array length is 2
    lsf.stringArray_setitem(strArr, 0, "normal");
#    lsf.stringArray_setitem(strArr, 1, "short");

    for info in lsf.get_queue_info_by_name(strArr, 1):
        print(info.queue)
        print(info.description)
        print('')

    return 0;
Exemplo n.º 5
0
def printQueueInfo():
    if lsf.lsb_init("test") > 0:
        return -1

    strArr = lsf.new_stringArray(1)
    #array length is 2
    lsf.stringArray_setitem(strArr, 0, "normal")
    #    lsf.stringArray_setitem(strArr, 1, "short");

    for info in lsf.get_queue_info_by_name(strArr, 1):
        print(info.queue)
        print(info.description)
        print('')

    return 0
Exemplo n.º 6
0
def queue_info(queue_name=None):
    """
    :param queue_name:
    :return:
    python api style
    """
    if lsf.lsb_init("test") != 0:
        exit(1)

    queue = lsf.new_stringArray(1)
    lsf.stringArray_setitem(queue, 0, queue_name)

    for info in lsf.get_queue_info_by_name(queue, 0):
        print info.queue
        print info.description
        print ''
Exemplo n.º 7
0
def query_queue(queue_name):
    """
    c api style
    """

    if lsf.lsb_init("test") != 0:
        exit(1)

    intp_num_queues = lsf.new_intp()
    lsf.intp_assign(intp_num_queues, 1)
    queue_p = lsf.new_stringArray(1)
    lsf.stringArray_setitem(queue_p, 0, queue_name)
    info = lsf.lsb_queueinfo(queue_p, intp_num_queues, None, None, 0)
    if info is not None:
        return info.queue, info.description
    else:
        print 'queueInfo is null'
        exit(1)
Exemplo n.º 8
0
def queryHostGroupInfo():
    """
    "query host group info"
    """
    if lsf.lsb_init("queryHostGroupInfo") > 0:
        return -1

    strArr = lsf.new_stringArray(2)
    lsf.stringArray_setitem(strArr, 0, "hg1")
    lsf.stringArray_setitem(strArr, 1, "hg2")
    for hgroupInfo in lsf.get_hostgroup_info_by_name(strArr, 2):
        if hgroupInfo != None:
            print 'hgroup name = %s' % hgroupInfo.group
            print 'hgroup list = %s' % hgroupInfo.memberList
        else:
            print 'hgroupInfo is null'
            return -1

    return 0
def queryHostGroupInfo():
    """
    "query host group info"
    """
    if lsf.lsb_init("queryHostGroupInfo") > 0:
        return -1;

    strArr = lsf.new_stringArray(2);
    lsf.stringArray_setitem(strArr, 0, "hg1");
    lsf.stringArray_setitem(strArr, 1, "hg2");
    for hgroupInfo in lsf.get_hostgroup_info_by_name(strArr,2):
        if hgroupInfo != None:
            print('hgroup name = %s' % hgroupInfo.group);
            print('hgroup list = %s' % hgroupInfo.memberList);
        else:
            print('hgroupInfo is null')
            return -1;

    lsf.delete_stringArray(strArr);

    return 0;