Esempio n. 1
0
 def test_energy_efficient_max_freq(self):
     test_freq = self._sticker_freq - 2 * self._step_freq
     current_freq = geopm_test_launcher.geopmread("MSR::PERF_CTL:FREQ board 0")
     self.assertNotEqual(test_freq, current_freq)
     self.run_tool('energy_efficient', {'FREQ_FIXED': test_freq})
     current_freq = geopm_test_launcher.geopmread("MSR::PERF_CTL:FREQ board 0")
     self.assertEqual(test_freq, current_freq)
    def setUpClass(cls):
        """Create launcher, execute benchmark and set up class variables.

        """
        sys.stdout.write('(' + os.path.basename(__file__).split('.')[0] + '.' +
                         cls.__name__ + ') ...')
        test_name = 'test_ee_timed_scaling_mix'
        cls._report_path = test_name + '.report'
        cls._trace_path = test_name + '.trace'
        cls._skip_launch = not util.do_launch()
        cls._agent_conf_path = test_name + '-agent-config.json'
        geopmpy.error.exc_clear()
        if not cls._skip_launch:
            num_node = 2
            num_rank = 2
            min_freq = geopm_test_launcher.geopmread(
                "CPUINFO::FREQ_MIN board 0")
            sticker_freq = geopm_test_launcher.geopmread(
                "CPUINFO::FREQ_STICKER board 0")
            agent_conf = geopmpy.io.AgentConf(cls._agent_conf_path,
                                              'energy_efficient', {
                                                  'frequency_min': min_freq,
                                                  'frequency_max': sticker_freq
                                              })
            launcher = geopm_test_launcher.TestLauncher(AppConf(),
                                                        agent_conf,
                                                        cls._report_path,
                                                        cls._trace_path,
                                                        time_limit=6000)
            launcher.set_num_node(num_node)
            launcher.set_num_rank(num_rank)
            launcher.run(test_name)
Esempio n. 3
0
 def test_freq_map_max_freq(self):
     test_freq = self._sticker_freq - 2 * self._step_freq
     current_freq = geopm_test_launcher.geopmread("MSR::PERF_CTL:FREQ board 0")
     self.assertNotEqual(test_freq, current_freq)
     self.run_tool('frequency_map', {'FREQ_DEFAULT': test_freq})
     current_freq = geopm_test_launcher.geopmread("MSR::PERF_CTL:FREQ board 0")
     self.assertEqual(test_freq, current_freq)
Esempio n. 4
0
 def test_power_balancer_power_cap(self):
     num_pkg = geopmpy.topo.num_domain('package')
     test_power = self._tdp_power * num_pkg - 20
     current_power = num_pkg * geopm_test_launcher.geopmread("MSR::PKG_POWER_LIMIT:PL1_POWER_LIMIT board 0")
     self.assertNotEqual(test_power, current_power)
     self.run_tool('power_balancer', {'power_budget': test_power})
     current_power = num_pkg * geopm_test_launcher.geopmread("MSR::PKG_POWER_LIMIT:PL1_POWER_LIMIT board 0")
     self.assertEqual(test_power, current_power)
Esempio n. 5
0
 def test_monitor_no_policy(self):
     # check that the monitor doesn't change anything
     start_freq = geopm_test_launcher.geopmread("MSR::PERF_CTL:FREQ board 0")
     start_power = geopm_test_launcher.geopmread("MSR::PKG_POWER_LIMIT:PL1_POWER_LIMIT board 0")
     self.run_tool('monitor', {})
     end_freq = geopm_test_launcher.geopmread("MSR::PERF_CTL:FREQ board 0")
     end_power = geopm_test_launcher.geopmread("MSR::PKG_POWER_LIMIT:PL1_POWER_LIMIT board 0")
     self.assertEqual(start_freq, end_freq)
     self.assertEqual(start_power, end_power)
Esempio n. 6
0
    def setUpClass(cls):
        """Create launcher, execute benchmark and set up class variables.

        """
        sys.stdout.write('(' + os.path.basename(__file__).split('.')[0] + '.' +
                         cls.__name__ + ') ...')
        test_name = 'test_scaling_region'
        cls._report_path = test_name + '.report'
        cls._trace_path = test_name + '.trace'
        cls._skip_launch = not util.do_launch()
        cls._agent_conf_path = test_name + '-agent-config.json'
        # region_hash() of the sequence:
        # scaling_region_0, scaling_region_1, ... , scaling_region_30
        cls._region_hash = [
            geopmpy.hash.crc32_str('scaling_region_{}'.format(idx))
            for idx in range(31)
        ]
        geopmpy.error.exc_clear()
        if not cls._skip_launch:
            num_node = 1
            num_rank = 1
            # Set up agent configuration so that each region is assigned a different frequency
            freq_min = geopm_test_launcher.geopmread(
                "CPUINFO::FREQ_MIN board 0")
            freq_sticker = geopm_test_launcher.geopmread(
                "CPUINFO::FREQ_STICKER board 0")
            freq_step = geopm_test_launcher.geopmread(
                "CPUINFO::FREQ_STEP board 0")
            num_step = int((freq_sticker - freq_min) / freq_step + 0.5)
            agent_conf_dict = {'FREQ_DEFAULT': freq_sticker}
            cls._region_freq = [
                freq_min + idx * freq_step for idx in range(num_step)
            ]
            freq_idx = 0
            for freq_idx in range(len(cls._region_freq)):
                agent_conf_dict['HASH_{}'.format(
                    freq_idx)] = cls._region_hash[freq_idx]
                agent_conf_dict['FREQ_{}'.format(
                    freq_idx)] = cls._region_freq[freq_idx]

            agent_conf = geopmpy.io.AgentConf(cls._agent_conf_path,
                                              'frequency_map', agent_conf_dict)
            launcher = geopm_test_launcher.TestLauncher(AppConf(),
                                                        agent_conf,
                                                        cls._report_path,
                                                        cls._trace_path,
                                                        time_limit=6000)
            launcher.set_num_node(num_node)
            launcher.set_num_rank(num_rank)
            launcher.run(test_name)
Esempio n. 7
0
    def setUp(self):
        self._old_max_freq = geopm_test_launcher.geopmread("MSR::PERF_CTL:FREQ board 0")
        self._old_max_power = geopm_test_launcher.geopmread("MSR::PKG_POWER_LIMIT:PL1_POWER_LIMIT board 0")

        # make sure controls are at default
        self._max_freq = geopm_test_launcher.geopmread("FREQUENCY_MAX board 0")
        geopm_test_launcher.geopmwrite("FREQUENCY board 0 {}".format(self._max_freq))
        self._tdp_power = geopm_test_launcher.geopmread("POWER_PACKAGE_TDP package 0")
        geopm_test_launcher.geopmwrite("POWER_PACKAGE_LIMIT board 0 {}".format(self._tdp_power))
        self._sticker_freq = geopm_test_launcher.geopmread("FREQUENCY_STICKER board 0")
        self._step_freq = geopm_test_launcher.geopmread("FREQUENCY_STEP board 0")

        self._stdout = None
        self._stderr = None
    def setUpClass(cls):
        """Create launcher, execute benchmark and set up class variables.

        """
        sys.stdout.write('(' + os.path.basename(__file__).split('.')[0] + '.' +
                         cls.__name__ + ') ...')
        test_name = 'frequency_hint_usage'
        cls._skip_launch = not util.do_launch()

        cls._fmap_report_path = 'test_{}_fmap.report'.format(test_name)
        cls._fmap_trace_path = 'test_{}_fmap.trace'.format(test_name)
        cls._fmap_agent_conf_path = 'test_' + test_name + '-fmap-agent-config.json'

        cls._ee_report_path = 'test_{}_ee.report'.format(test_name)
        cls._ee_trace_path = 'test_{}_ee.trace'.format(test_name)
        cls._ee_agent_conf_path = 'test_' + test_name + '-ee-agent-config.json'

        geopmpy.error.exc_clear(
        )  # Clear out exception record for python 2 support

        cls._freq_min = geopm_test_launcher.geopmread(
            "CPUINFO::FREQ_MIN board 0")
        cls._freq_sticker = geopm_test_launcher.geopmread(
            "CPUINFO::FREQ_STICKER board 0")
        cls._freq_step = geopm_test_launcher.geopmread(
            "FREQUENCY_STEP board 0")
        cls._freq_default = cls._freq_sticker - cls._freq_step

        if not cls._skip_launch:
            # Set the job size parameters
            num_node = 1
            num_rank = 1
            time_limit = 6000
            # Configure the test application
            app_conf = AppConf()

            # Configure the agents
            agent_conf_dict = {'FREQ_DEFAULT': cls._freq_default}
            fmap_agent_conf = geopmpy.io.AgentConf(cls._fmap_agent_conf_path,
                                                   'frequency_map',
                                                   agent_conf_dict)
            agent_conf_dict = {
                'FREQ_MIN': cls._freq_min,
                'FREQ_MAX': cls._freq_default
            }
            ee_agent_conf = geopmpy.io.AgentConf(cls._ee_agent_conf_path,
                                                 'energy_efficient',
                                                 agent_conf_dict)

            # Fmap run
            launcher = geopm_test_launcher.TestLauncher(app_conf,
                                                        fmap_agent_conf,
                                                        cls._fmap_report_path,
                                                        cls._fmap_trace_path,
                                                        time_limit=time_limit)
            launcher.set_num_node(num_node)
            launcher.set_num_rank(num_rank)
            launcher.run('test_' + test_name)

            # EE run
            launcher = geopm_test_launcher.TestLauncher(app_conf,
                                                        ee_agent_conf,
                                                        cls._ee_report_path,
                                                        cls._ee_trace_path,
                                                        time_limit=time_limit)
            launcher.set_num_node(num_node)
            launcher.set_num_rank(num_rank)
            launcher.run(test_name)