Commit 466af07c authored by David Hendriks's avatar David Hendriks
Browse files

added time spent calling binary_c

parent 47c3b333
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -718,8 +718,9 @@ class Population:

        # Log and print some information
        verbose_print(
            "Population-{} finished! It took a total of {}s to run {} systems on {} cores".format(
            "Population-{} finished! The total probability was: {}. It took a total of {}s to run {} systems on {} cores".format(
                self.grid_options["_population_id"],
                self.grid_options["_probtot"],
                self.grid_options["_end_time_evolution"]
                - self.grid_options["_start_time_evolution"],
                self.grid_options["_total_starcount"],
@@ -917,7 +918,9 @@ class Population:
            "Process {} started at {}. Using store memaddr {}".format(ID, datetime.datetime.now().isoformat(), self.grid_options["_store_memaddr"]), self.grid_options["verbosity"], 0
        )

        round_number_mod = 0
        round_number_mod = 0 # rotating modulo

        total_time_calling_binary_c = 0

        # Go over the generator
        while running:
@@ -955,6 +958,8 @@ class Population:

                    end_runtime_binary_c = time.time()

                    total_time_calling_binary_c += end_runtime_binary_c - start_runtime_binary_c # keep track of total binary_c call time

                    # Debug line: logging all the lines
                    if self.grid_options['log_runtime_systems']==1:
                        with open(os.path.join(self.grid_options["tmp_dir"], "thread_{}_runtime_systems.txt".format(self.process_ID)), 'a+') as f:
@@ -1031,11 +1036,12 @@ class Population:
        end_process_time = datetime.datetime.now()

        verbose_print(
            "Process {} finished:\n\tgenerator started at {}, done at {} (total: {}s).\n\tRan {} systems with a total probability of {}.\n\tThis thread had {} failing systems with a total probability of {}".format(
            "Process {} finished:\n\tgenerator started at {}, done at {} (total: {}s of which {}s interfacing with binary_c).\n\tRan {} systems with a total probability of {}.\n\tThis thread had {} failing systems with a total probability of {}".format(
                ID,
                start_process_time.isoformat(),
                end_process_time.isoformat(),
                (end_process_time-start_process_time).total_seconds(),
                total_time_calling_binary_c,
                number_of_systems_run,
                probability_of_systems_run,
                self.grid_options["_failed_count"],