Commit 49a1a104 authored by Maiterth, Matthias's avatar Maiterth, Matthias
Browse files

Fix with default values in cpu/gpu util and policy.

Default values for avg cpu /gpu util in stats were not set when no jobs completed.

Default policy was picked up as the first entry which was fcfs no backfill.
This should be replay, and in fact by choice of the scheduler not by the args
implementation.
parent 766eef73
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ parser.add_argument('-w', '--workload', type=str, choices=choices, default=choic
choices = ['default', 'scheduleflow', 'nrel', 'anl', 'flux']
parser.add_argument('--scheduler', type=str, choices=choices, default=choices[0], help='Name of scheduler')
choices = [policy.value for policy in PolicyType]
parser.add_argument('--policy', type=str, choices=choices, default=choices[0], help='Schedule policy to use')
parser.add_argument('--policy', type=str, choices=choices, default=None, help='Schedule policy to use')
choices = [policy.value for policy in BackfillType]
parser.add_argument('--backfill', type=str, choices=choices, default=None, help='Backfill Policy')

+1 −1
Original line number Diff line number Diff line
@@ -3,10 +3,10 @@ from enum import Enum

class PolicyType(Enum):
    """Supported scheduling policies."""
    REPLAY = 'replay'  # Default is specified in each scheduler!
    FCFS = 'fcfs'
    PRIORITY = 'priority'
    FUGAKU_PTS = 'fugaku_pts'
    REPLAY = 'replay'
    SJF = 'sjf'
    LJF = 'ljf'

+5 −1
Original line number Diff line number Diff line
@@ -172,7 +172,6 @@ def get_job_stats(engine: Engine):
        avg_ntx_u = sum_ntx_u / len(engine.job_history_dict)
        avg_nrx_u = sum_nrx_u / len(engine.job_history_dict)


        avg_awrt = sum_awrt / sum_agg_node_hours
        psf = (3 * sum_psf_partial_num) / (4 * sum_psf_partial_den)
    else:
@@ -188,6 +187,11 @@ def get_job_stats(engine: Engine):
        min_awrt, max_awrt, avg_awrt = -1,-1,-1
        psf = -1

        min_cpu_u, max_cpu_u, avg_cpu_u = -1,-1,-1
        min_gpu_u, max_gpu_u, avg_gpu_u = -1,-1,-1
        min_ntx_u, max_ntx_u, avg_ntx_u = -1,-1,-1
        min_nrx_u, max_nrx_u, avg_nrx_u = -1,-1,-1

    job_stats = {
        'jobs completed': engine.jobs_completed,
        'throughput': f'{throughput:.2f} jobs/hour',