Beispiel #1
0
def run_job(command):
    """
    Run a job...
    """
    submitreq = lsf.submit()
    submitreq.command = command
    submitreq.options = 0
    submitreq.options2 = 0

    limits = []
    for i in range(0, lsf.LSF_RLIM_NLIMITS):
        limits.append(lsf.DEFAULT_RLIMIT)

    submitreq.rLimits = limits
 
    submitreq.beginTime = 0
    submitreq.termTime = 0
    submitreq.numProcessors = 1
    submitreq.maxNumProcessors = 1

    submitreply = lsf.submitReply()

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

    job_id = lsf.lsb_submit(submitreq, submitreply)
    return job_id
def run_job(command):
    """
    Run a job...
    """
    submitreq = lsf.submit()
    submitreq.command = command
    submitreq.options = 0
    submitreq.options2 = 0

    limits = []
    for i in range(0, lsf.LSF_RLIM_NLIMITS):
        limits.append(lsf.DEFAULT_RLIMIT)

    submitreq.rLimits = limits
 
    submitreq.beginTime = 0
    submitreq.termTime = 0
    submitreq.numProcessors = 1
    submitreq.maxNumProcessors = 1

    submitreply = lsf.submitReply()

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

    job_id = lsf.lsb_submit(submitreq, submitreply)
    return job_id
Beispiel #3
0
def launch(request):
    reply = create_reply()

    try:
        submit_result = lsf.lsb_submit(request, reply)
    except:
        LOG.exception()
        raise

    if submit_result > 0:
        LOG.debug('Successfully submitted lsf job: %s', submit_result)
        return submit_result

    else:
        lsf.lsb_perror("lsb_submit")
        LOG.error('Failed to submit lsf job, return value = (%s), err = %s',
                submit_result, lsf.lsb_sperror("lsb_submit"))
        exit_process(exit_codes.EXECUTE_FAILURE)
Beispiel #4
0
def submit_job(request, quiet=True):
    init()
    reply = create_reply()

    try:
        if quiet:
            os.environ["BSUB_QUIET"] = "1"
        job_id = api.lsb_submit(request, reply)
    except:
        LOG.exception("Failed to submit LSF job")
        raise LSFBindingException("Caught exception in lsb_submit")
    finally:
        if "BSUB_QUIET" in os.environ:
            del os.environ["BSUB_QUIET"]

    if job_id > 0:
        LOG.debug("Successfully submitted LSF job: %s", job_id)
        return job_id

    else:
        LOG.debug("Failed to submit LSF job, return value = (%s)", job_id)
        raise LSFBindingException("Failed to submit LSF job")
Beispiel #5
0
def submit_job(request, quiet=True):
    init()
    reply = create_reply()

    try:
        if quiet:
            os.environ['BSUB_QUIET'] = '1'
        job_id = api.lsb_submit(request, reply)
    except:
        LOG.exception('Failed to submit LSF job')
        raise LSFBindingException('Caught exception in lsb_submit')
    finally:
        if 'BSUB_QUIET' in os.environ:
            del os.environ['BSUB_QUIET']

    if job_id > 0:
        LOG.debug('Successfully submitted LSF job: %s', job_id)
        return job_id

    else:
        LOG.debug('Failed to submit LSF job, return value = (%s)', job_id)
        raise LSFBindingException('Failed to submit LSF job')
Beispiel #6
0
def submit_job(request, quiet=True):
    init()
    reply = create_reply()

    try:
        if quiet:
            os.environ['BSUB_QUIET'] = '1'
        job_id = api.lsb_submit(request, reply)
    except:
        LOG.exception('Failed to submit LSF job')
        raise LSFBindingException('Caught exception in lsb_submit')
    finally:
        if 'BSUB_QUIET' in os.environ:
            del os.environ['BSUB_QUIET']

    if job_id > 0:
        LOG.debug('Successfully submitted LSF job: %s', job_id)
        return job_id

    else:
        LOG.debug('Failed to submit LSF job, return value = (%s)', job_id)
        raise LSFBindingException('Failed to submit LSF job')