Beispiel #1
0
    def test_get_job_times_limits(self):
        rt = ResultTrace()
        rt._lists_submit["time_end"] = [10, 10, 10000, 140]
        rt._lists_submit["time_start"] = [5, 2, 1000, 120]
        rt._lists_submit["time_submit"] = [0, 2, 30, 100]
        rt._lists_submit["job_name"] = ["J0", "J1", "J2", "J3"]
        rt._lists_submit["timelimit"] = [1, 2, 3, 4]
        rt._lists_submit["cpus_alloc"] = [10, 20, 30, 40]

        (jobs_runtime, jobs_waittime, jobs_turnaround, jobs_timelimit,
         jobs_cores_alloc, jobs_slow_down) = rt._get_job_times(submit_start=20,
                                                               submit_stop=40)
        self.assertEqual(jobs_runtime, [9000])
        self.assertEqual(jobs_waittime, [970])
        self.assertEqual(jobs_turnaround, [9970])
        self.assertEqual(jobs_timelimit, [3])
        self.assertEqual(jobs_cores_alloc, [30])
        self.assertEqual(jobs_slow_down, [9970.0 / 9000.0])
Beispiel #2
0
    def test_get_job_times(self):
        rt = ResultTrace()
        rt._lists_submit["time_end"] = [10, 10, 10000, 55, 330]
        rt._lists_submit["time_start"] = [5, 2, 1000, 50, 290]
        rt._lists_submit["time_submit"] = [0, 2, 30, 100, 200]
        rt._lists_submit["job_name"] = ["J0", "J1", "J2", "J3", "wf_man"]
        rt._lists_submit["timelimit"] = [1, 2, 3, 4, 5]
        rt._lists_submit["cpus_alloc"] = [10, 20, 30, 40, 50]

        (jobs_runtime, jobs_waittime, jobs_turnaround, jobs_timelimit,
         jobs_cores_alloc,
         jobs_slow_down) = rt._get_job_times(only_non_wf=True)
        self.assertEqual(jobs_runtime, [8, 9000])
        self.assertEqual(jobs_waittime, [0, 970])
        self.assertEqual(jobs_turnaround, [8, 9970])
        self.assertEqual(jobs_timelimit, [2, 3])
        self.assertEqual(jobs_cores_alloc, [20, 30])
        self.assertEqual(jobs_slow_down, [1.0, 9970.0 / 9000.0])