This method writes information about benchmark and system into txt_file.

def write_header_to_log(self, sysinfo):
        """
        This method writes information about benchmark and system into txt_file.
        """
        runSetName = None
        run_sets = [runSet for runSet in self.benchmark.run_sets if runSet.should_be_executed()]
        if len(run_sets) == 1:
            # in case there is only a single run set to to execute, we can use its name
            runSetName = run_sets[0].name

        columnWidth = 25
        simpleLine = "-" * (60) + "\n\n"

        def format_line(key, value):
            if value is None:
                return ""
            return (key +":").ljust(columnWidth) + str(value).strip() + "\n"

        def format_byte(key, value):
            if value is None:
                return ""
            return format_line(key, str(value/_BYTE_FACTOR/_BYTE_FACTOR) + " MB")

        def format_time(key, value):
            if value is None:
                return ""
            return format_line(key, str(value) + " s")

        header = ("   BENCHMARK INFORMATION\n"
            + ((self.benchmark.display_name + "\n") if self.benchmark.display_name else "")
            + format_line("benchmark definition", self.benchmark.benchmark_file)
            + format_line("name", self.benchmark.name)
            + format_line("run sets", ", ".join(run_set.name for run_set in run_sets))
            + format_line("date", time.strftime("%a, %Y-%m-%d %H:%M:%S %Z", self.benchmark.start_time))
            + format_line("tool", self.benchmark.tool_name + " " + self.benchmark.tool_version)
            + format_line("tool executable", self.benchmark.executable)
            + format_line("options", " ".join(map(util.escape_string_shell, self.benchmark.options)))
            + format_line("property file", self.benchmark.propertyfile)
            )
        if self.benchmark.num_of_threads > 1:
            header += format_line("parallel runs", self.benchmark.num_of_threads)

        header += ("resource limits:\n"
            + format_byte("- memory", self.benchmark.rlimits.get(MEMLIMIT))
            + format_time("- time", self.benchmark.rlimits.get(SOFTTIMELIMIT) or self.benchmark.rlimits.get(TIMELIMIT))
            + format_line("- cpu cores", self.benchmark.rlimits.get(CORELIMIT))
            )

        header += ("hardware requirements:\n"
            + format_line("- cpu model", self.benchmark.requirements.cpu_model)
            + format_line("- cpu cores", self.benchmark.requirements.cpu_cores)
            + format_byte("- memory", self.benchmark.requirements.memory)
            + simpleLine)

        if sysinfo:
            header += ("   SYSTEM INFORMATION\n"\
                + format_line("host", sysinfo.hostname)
                + format_line("os", sysinfo.os)
                + format_line("cpu", sysinfo.cpu_model)
                + format_line("- cores", sysinfo.cpu_number_of_cores)
                + format_line("- max frequency", str(sysinfo.cpu_max_frequency/1000/1000) + " MHz")
                + format_line("- turbo boost enabled", sysinfo.cpu_turboboost)
                + format_byte("ram", sysinfo.memory)
                + simpleLine)

        self.description = header

        # write to file
        txt_file_name = self.get_filename(runSetName, "txt")
        self.txt_file = filewriter.FileWriter(txt_file_name, self.description)
        self.all_created_files.add(txt_file_name)