Beispiel #1
0
def num_jobs_running_history(condor, handle, num_resources):
    return track_quantity(
        condor.job_queue.filter(lambda j, e: j in handle.job_ids),
        increment_condition=lambda id_event: id_event[-1] == SetJobStatus(
            JobStatus.RUNNING),
        decrement_condition=lambda id_event: id_event[-1] == SetJobStatus(
            JobStatus.COMPLETED),
        max_quantity=num_resources,
        expected_quantity=num_resources,
    )
def num_jobs_running_history(condor, all_jobs_ran, concurrency_limit):
    return track_quantity(
        condor.job_queue.filter(lambda j, e: j in all_jobs_ran.job_ids),
        increment_condition=lambda id_event: id_event[-1] == SetJobStatus(
            JobStatus.RUNNING),
        decrement_condition=lambda id_event: id_event[-1] == SetJobStatus(
            JobStatus.COMPLETED),
        max_quantity=concurrency_limit["max-running"],
        expected_quantity=concurrency_limit["max-running"],
    )
def num_busy_slots_history(startd_log_file, handle, num_resources):
    logger.debug("Checking Startd log file...")
    logger.debug("Expected Job IDs are: {}".format(handle.job_ids))

    active_claims_history = track_quantity(
        startd_log_file.read(),
        increment_condition=lambda msg: "Changing activity: Idle -> Busy" in msg,
        decrement_condition=lambda msg: "Changing activity: Busy -> Idle" in msg,
        max_quantity=num_resources,
        expected_quantity=num_resources,
    )

    return active_claims_history
def num_busy_slots_history(startd_log_file, all_jobs_ran, concurrency_limit):
    logger.debug("Checking Startd log file...")
    logger.debug("Expected Job IDs are: {}".format(all_jobs_ran.job_ids))

    active_claims_history = track_quantity(
        startd_log_file.read(),
        increment_condition=lambda msg: "Changing activity: Idle -> Busy" in
        msg,
        decrement_condition=lambda msg: "Changing activity: Busy -> Idle" in
        msg,
        max_quantity=concurrency_limit["max-running"],
        expected_quantity=concurrency_limit["max-running"],
    )

    return active_claims_history
Beispiel #5
0
def num_busy_slots_history(startd_log_file, limit_exceeded, concurrency_limit):
    logger.debug("Checking Startd log file...")
    logger.debug("Expected Job IDs are: {}".format(limit_exceeded.job_ids))

    # You'd expect the conditions to be mirror-images, but for unknown reasons,
    # putting jobs on hold sometimes skips this step.
    active_claims_history = track_quantity(
        startd_log_file.read(),
        increment_condition=lambda msg: "Changing activity: Idle -> Busy" in
        msg,
        decrement_condition=lambda msg: "Changing activity: Busy -> Idle" in
        msg or "Changing state and activity: Preempting/Vacating -> Owner/Idle"
        in msg,
        max_quantity=concurrency_limit["max-running"],
        expected_quantity=concurrency_limit["max-running"],
    )

    return active_claims_history