Esempio n. 1
0
    def _generate_matrix(self, run, reference_run, aggfunc):
        """Generate the Correlation Matrix"""

        reference_aggs = []
        aggs = []

        for idx in range(self._dimension):

            reference_aggs.append(
                MultiTriggerAggregator(
                    sconf.sched_triggers(
                        reference_run,
                        self._reference_pids[idx],
                        trappy.sched.SchedSwitch
                        ),
                    self._topology,
                    aggfunc))

            aggs.append(
                MultiTriggerAggregator(
                    sconf.sched_triggers(
                        run,
                        self._pids[idx],
                        trappy.sched.SchedSwitch
                        ),
                    self._topology,
                    aggfunc))

        agg_pair_gen = ((r_agg, agg)
                        for r_agg in reference_aggs for agg in aggs)

        # pylint fails to recognize numpy members.
        # pylint: disable=no-member
        matrix = np.zeros((self._dimension, self._dimension))
        # pylint: enable=no-member

        for (ref_result, test_result) in agg_pair_gen:
            i = reference_aggs.index(ref_result)
            j = aggs.index(test_result)
            corr = Correlator(
                ref_result,
                test_result,
                corrfunc=sconf.binary_correlate,
                filter_gaps=True)
            _, total = corr.correlate(level="cluster")

            matrix[i][j] = total

        return matrix
Esempio n. 2
0
    def __init__(self, run, topology, execname=None, pid=None):
        """Args:
                run (trappy.Run): A single trappy.Run object
                    or a path that can be passed to trappy.Run
                topology(trappy.stats.Topology): The CPU topology
                execname(str, optional): Optional execname of the task
                     under consideration.
                PID(int): The PID of the task to be checked

            One of pid or execname is mandatory. If only execname
            is specified, The current implementation will fail if
            there are more than one processes with the same execname
        """

        run = Utils.init_run(run)

        if not execname and not pid:
            raise ValueError("Need to specify at least one of pid or execname")

        self.execname = execname
        self._run = run
        self._pid = self._validate_pid(pid)
        self._aggs = {}
        self._topology = topology
        self._triggers = sconf.sched_triggers(self._run, self._pid,
                                              trappy.sched.SchedSwitch)
        self.name = "{}-{}".format(self.execname, self._pid)
Esempio n. 3
0
    def __init__(self, run, topology, execname=None, pid=None):
        """Args:
                run (trappy.Run): A single trappy.Run object
                    or a path that can be passed to trappy.Run
                topology(trappy.stats.Topology): The CPU topology
                execname(str, optional): Optional execname of the task
                     under consideration.
                PID(int): The PID of the task to be checked

            One of pid or execname is mandatory. If only execname
            is specified, The current implementation will fail if
            there are more than one processes with the same execname
        """

        run = Utils.init_run(run)

        if not execname and not pid:
            raise ValueError("Need to specify at least one of pid or execname")

        self.execname = execname
        self._run = run
        self._pid = self._validate_pid(pid)
        self._aggs = {}
        self._topology = topology
        self._triggers = sconf.sched_triggers(self._run, self._pid,
                                              trappy.sched.SchedSwitch)
        self.name = "{}-{}".format(self.execname, self._pid)
Esempio n. 4
0
    def _generate_matrix(self, run, reference_run, aggfunc):
        """Generate the Correlation Matrix"""

        reference_aggs = []
        aggs = []

        for idx in range(self._dimension):

            reference_aggs.append(
                MultiTriggerAggregator(
                    sconf.sched_triggers(reference_run,
                                         self._reference_pids[idx],
                                         trappy.sched.SchedSwitch),
                    self._topology, aggfunc))

            aggs.append(
                MultiTriggerAggregator(
                    sconf.sched_triggers(run, self._pids[idx],
                                         trappy.sched.SchedSwitch),
                    self._topology, aggfunc))

        agg_pair_gen = ((r_agg, agg) for r_agg in reference_aggs
                        for agg in aggs)

        # pylint fails to recognize numpy members.
        # pylint: disable=no-member
        matrix = np.zeros((self._dimension, self._dimension))
        # pylint: enable=no-member

        for (ref_result, test_result) in agg_pair_gen:
            i = reference_aggs.index(ref_result)
            j = aggs.index(test_result)
            corr = Correlator(ref_result,
                              test_result,
                              corrfunc=sconf.binary_correlate,
                              filter_gaps=True)
            _, total = corr.correlate(level="cluster")

            matrix[i][j] = total

        return matrix
Esempio n. 5
0
    def __init__(self, run, topology, execname=None, pid=None):

        run = Utils.init_run(run)

        if not execname and not pid:
            raise ValueError("Need to specify at least one of pid or execname")

        self.execname = execname
        self._run = run
        self._pid = self._validate_pid(pid)
        self._aggs = {}
        self._topology = topology
        self._triggers = sconf.sched_triggers(self._run, self._pid,
                                              trappy.sched.SchedSwitch)
        self.name = "{}-{}".format(self.execname, self._pid)
Esempio n. 6
0
    def __init__(self, run, topology, execname=None, pid=None):

        run = Utils.init_run(run)

        if not execname and not pid:
            raise ValueError("Need to specify at least one of pid or execname")

        self.execname = execname
        self._run = run
        self._pid = self._validate_pid(pid)
        self._aggs = {}
        self._topology = topology
        self._triggers = sconf.sched_triggers(self._run, self._pid,
                                              trappy.sched.SchedSwitch)
        self.name = "{}-{}".format(self.execname, self._pid)