def execute(self, run):
        """
        This function executes the tool with a sourcefile with options.
        It also calls functions for output before and after the run.
        """
        self.output_handler.output_before_run(run)
        benchmark = self.benchmark

        memlimit = benchmark.rlimits.get(MEMLIMIT)

        args = run.cmdline()
        logging.debug('Command line of run is %s', args)
        run_result = \
            self.run_executor.execute_run(
                args, run.log_file,
                hardtimelimit=benchmark.rlimits.get(TIMELIMIT),
                softtimelimit=benchmark.rlimits.get(SOFTTIMELIMIT),
                cores=self.my_cpus,
                memory_nodes=self.my_memory_nodes,
                memlimit=memlimit,
                environments=benchmark.environment(),
                workingDir=benchmark.working_directory(),
                maxLogfileSize=benchmark.config.maxLogfileSize)

        if self.run_executor.PROCESS_KILLED:
            # If the run was interrupted, we ignore the result and cleanup.
            try:
                if benchmark.config.debug:
                    os.rename(run.log_file, run.log_file + ".killed")
                else:
                    os.remove(run.log_file)
            except __HOLE__:
                pass
            return 1

        if self.my_cpus:
            run_result['cpuCores'] = self.my_cpus
        if self.my_memory_nodes:
            run_result['memoryNodes'] = self.my_memory_nodes

        run.set_result(run_result)
        self.output_handler.output_after_run(run)
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/localexecution.py/_Worker.execute