コード例 #1
0
ファイル: statemachine.py プロジェクト: jamiecn/pmdk
    def substitute_reorder(self, order_ops):
        """
        Changes the reordering engine based on the log marker class.

        :param order_ops: The reordering marker class.
        :type order_ops: subclass of :class:`memoryoperations.ReorderBase`
        :return: None
        """
        self._context.test_on_barrier = True
        if isinstance(order_ops, memoryoperations.Freorder):
            self._context.reorder_engine = \
                reorderengines.FullReorderEngine()
        elif isinstance(order_ops, memoryoperations.Preorder):
            # TODO add macro in valgrind or
            # parameter inside the tool to support parameters?
            self._context.reorder_engine = \
                reorderengines.RandomPartialReorderEngine(3)
        elif isinstance(order_ops, memoryoperations.Areorder):
            self._context.reorder_engine = \
                reorderengines.AccumulativeReorderEngine()
        elif isinstance(order_ops, memoryoperations.Fault_only):
            self._context.reorder_engine = reorderengines.NoReorderEngine()
        elif isinstance(order_ops, memoryoperations.No_reorder_fault):
            self._context.reorder_engine = reorderengines.NoReorderEngine()
            self._context.test_on_barrier = False
        else:
            raise NotSupportedOperationException(
                "Not supported reorder engine: {}".format(order_ops))
コード例 #2
0
ファイル: statemachine.py プロジェクト: lukaszstolarczuk/pmdk
    def substitute_reorder(self, order_ops):
        """
        Changes the reordering engine based on the log marker class.

        :param order_ops: The reordering marker class.
        :type order_ops: subclass of :class:`memoryoperations.ReorderBase`
        :return: None
        """
        if isinstance(order_ops, memops.ReorderFull):
            self._context.reorder_engine = reorderengines.FullReorderEngine()
            self._context.test_on_barrier = (
                self._context.reorder_engine.test_on_barrier
            )
        elif isinstance(order_ops, memops.ReorderPartial):
            # TODO add macro in valgrind or
            # parameter inside the tool to support parameters?
            self._context.reorder_engine = (
                reorderengines.RandomPartialReorderEngine(3)
            )
            self._context.test_on_barrier = (
                self._context.reorder_engine.test_on_barrier
            )
        elif isinstance(order_ops, memops.ReorderAccumulative):
            self._context.reorder_engine = (
                reorderengines.AccumulativeReorderEngine()
            )
            self._context.test_on_barrier = (
                self._context.reorder_engine.test_on_barrier
            )
        elif isinstance(order_ops, memops.ReorderReverseAccumulative):
            self._context.reorder_engine = (
                reorderengines.AccumulativeReverseReorderEngine()
            )
            self._context.test_on_barrier = (
                self._context.reorder_engine.test_on_barrier
            )
        elif isinstance(order_ops, memops.NoReorderDoCheck):
            self._context.reorder_engine = reorderengines.NoReorderEngine()
            self._context.test_on_barrier = (
                self._context.reorder_engine.test_on_barrier
            )
        elif isinstance(order_ops, memops.NoReorderNoCheck):
            self._context.reorder_engine = reorderengines.NoCheckerEngine()
            self._context.test_on_barrier = (
                self._context.reorder_engine.test_on_barrier
            )
        elif isinstance(order_ops, memops.ReorderDefault):
            self._context.reorder_engine = self._context.default_engine
            self._context.test_on_barrier = self._context.default_barrier
        else:
            raise NotSupportedOperationException(
                "Not supported reorder engine: {}".format(order_ops)
            )