コード例 #1
0
 def test_dualCPU_noncontiguousID(self):
     results = _get_cpu_cores_per_run0(
         2,
         3,
         False,
         [0, 4, 9, 15, 21, 19, 31, 12, 10, 11, 8, 23, 27, 14, 1, 20],
         {
             0: [0, 4, 9, 12, 15, 19, 21, 31],
             2: [10, 11, 8, 23, 27, 14, 1, 20]
         },
         {
             0: [0, 4],
             4: [0, 4],
             9: [9, 12],
             12: [9, 12],
             15: [15, 19],
             19: [15, 19],
             21: [21, 31],
             31: [21, 31],
             10: [10, 11],
             11: [10, 11],
             8: [8, 23],
             23: [8, 23],
             27: [27, 14],
             14: [27, 14],
             1: [1, 20],
             20: [1, 20],
         },
     )
     self.assertEqual(
         results,
         [[0, 9], [8, 10], [15, 21]],
         "Incorrect result for {} cores and {} threads.".format(2, 3),
     )
コード例 #2
0
ファイル: test_core_assignment.py プロジェクト: sosy-lab/tbf
 def test_quadCPU_HT_noncontiguousId(self):
     """4 CPUs with 8 cores (plus HT) and non-contiguous core and package numbers.
     This may happen on systems with administrative core restrictions,
     because the ordering of core and package numbers is not always consistent.
     Furthermore, sibling cores have numbers next to each other (occurs on AMD Opteron machines with shared L1/L2 caches)
     and are not split as far as possible from each other (as it occurs on hyper-threading machines).
     """
     result = _get_cpu_cores_per_run0(
         1, 8, [0, 1, 8, 9, 16, 17, 24, 25, 32, 33, 40, 41, 48, 49, 56, 57],
         {
             0: [0, 1, 8, 9],
             1: [32, 33, 40, 41],
             2: [48, 49, 56, 57],
             3: [16, 17, 24, 25]
         }, {
             0: [0, 1],
             1: [0, 1],
             48: [48, 49],
             33: [32, 33],
             32: [32, 33],
             40: [40, 41],
             9: [8, 9],
             16: [16, 17],
             17: [16, 17],
             56: [56, 57],
             57: [56, 57],
             8: [8, 9],
             41: [40, 41],
             24: [24, 25],
             25: [24, 25],
             49: [48, 49]
         })
     self.assertEqual(
         [[0], [32], [48], [16], [8], [40], [56], [24]], result,
         "Incorrect result for {} cores and {} threads.".format(1, 8))
コード例 #3
0
 def test_threeCPU_HT_noncontiguousId(self):
     """3 CPUs with one core (plus HT) and non-contiguous core and package numbers.
     This may happen on systems with administrative core restrictions,
     because the ordering of core and package numbers is not always consistent."""
     result = _get_cpu_cores_per_run0(
         2,
         3,
         True,
         [0, 1, 2, 3, 6, 7],
         {
             0: [0, 1],
             2: [2, 3],
             3: [6, 7]
         },
         {
             0: [0, 1],
             1: [0, 1],
             2: [2, 3],
             3: [2, 3],
             6: [6, 7],
             7: [6, 7]
         },
     )
     self.assertEqual(
         [[0, 1], [2, 3], [6, 7]],
         result,
         "Incorrect result for {} cores and {} threads.".format(2, 3),
     )
コード例 #4
0
 def test_threeCPU_HT_noncontiguousId(self):
     """3 CPUs with one core (plus HT) and non-contiguous core and package numbers.
     This may happen on systems with administrative core restrictions,
     because the ordering of core and package numbers is not always consistent."""
     result = _get_cpu_cores_per_run0(2, 3,
         [0, 1, 2, 3, 6, 7], {0: [0, 1], 2: [2, 3], 3: [6, 7]},
         {0: [0, 1], 1: [0, 1], 2: [2, 3], 3: [2, 3], 6: [6, 7], 7: [6,7]})
     self.assertEqual([[0, 1], [2, 3], [6, 7]], result, "Incorrect result for {} cores and {} threads.".format(2, 3))
コード例 #5
0
ファイル: test_core_assignment.py プロジェクト: sosy-lab/tbf
 def assertValid(self, coreLimit, num_of_threads, expectedResult=None):
     result = _get_cpu_cores_per_run0(coreLimit, num_of_threads,
                                      *self.machine())
     if expectedResult:
         self.assertEqual(
             expectedResult, result,
             "Incorrect result for {} cores and {} threads.".format(
                 coreLimit, num_of_threads))
コード例 #6
0
 def assertValid(self, coreLimit, num_of_threads, expectedResult=None):
     result = _get_cpu_cores_per_run0(coreLimit, num_of_threads,
                                      self.use_ht, *self.machine())
     if expectedResult:
         self.assertEqual(
             expectedResult,
             result,
             f"Incorrect result for {coreLimit} cores and {num_of_threads} threads.",
         )
コード例 #7
0
 def test_quadCPU_HT_noncontiguousId(self):
     """4 CPUs with 8 cores (plus HT) and non-contiguous core and package numbers.
     This may happen on systems with administrative core restrictions,
     because the ordering of core and package numbers is not always consistent.
     Furthermore, sibling cores have numbers next to each other (occurs on AMD Opteron machines with shared L1/L2 caches)
     and are not split as far as possible from each other (as it occurs on hyper-threading machines).
     """
     result = _get_cpu_cores_per_run0(1, 8,
         [0, 1, 8, 9, 16, 17, 24, 25, 32, 33, 40, 41, 48, 49, 56, 57],
         {0: [0, 1, 8, 9], 1: [32, 33, 40, 41], 2: [48, 49, 56, 57], 3: [16, 17, 24, 25]},
         {0: [0, 1], 1: [0, 1], 48: [48, 49], 33: [32, 33], 32: [32, 33], 40: [40, 41], 9: [8, 9], 16: [16, 17], 17: [16, 17], 56: [56, 57], 57: [56, 57], 8: [8, 9], 41: [40, 41], 24: [24, 25], 25: [24, 25], 49: [48, 49]})
     self.assertEqual([[0], [32], [48], [16], [8], [40], [56], [24]], result, "Incorrect result for {} cores and {} threads.".format(1, 8))
コード例 #8
0
 def assertValid(self, coreLimit, num_of_threads, expectedResult=None):
     result = _get_cpu_cores_per_run0(coreLimit, num_of_threads, *self.machine())
     if expectedResult:
         self.assertEqual(expectedResult, result, "Incorrect result for {} cores and {} threads.".format(coreLimit, num_of_threads))