Skip to content
Snippets Groups Projects
Commit 81622d4f authored by David Hendriks's avatar David Hendriks
Browse files

added thingy to log runtimes

parent c25c0843
No related branches found
No related tags found
No related merge requests found
...@@ -876,6 +876,9 @@ class Population: ...@@ -876,6 +876,9 @@ class Population:
This function is called by _evolve_population_grid This function is called by _evolve_population_grid
""" """
# set start timer
start_process_time = datetime.datetime.now()
self.process_ID = ( self.process_ID = (
ID # Store the ID as a object property again, lets see if that works. ID # Store the ID as a object property again, lets see if that works.
) )
...@@ -942,9 +945,18 @@ class Population: ...@@ -942,9 +945,18 @@ class Population:
binary_cmdline_string = self._return_argline(full_system_dict) binary_cmdline_string = self._return_argline(full_system_dict)
f.write(binary_cmdline_string) f.write(binary_cmdline_string)
start_runtime_binary_c = time.time()
# Evolve the system # Evolve the system
self._evolve_system_mp(full_system_dict) self._evolve_system_mp(full_system_dict)
end_runtime_binary_c = time.time()
# Debug line: logging all the lines
with open(os.path.join(self.grid_options["tmp_dir"], "thread_{}_runtime_systems.txt".format(self.process_ID)), 'a+') as f:
binary_cmdline_string = self._return_argline(full_system_dict)
f.write("{} {}\n".format(end_runtime_binary_c-start_runtime_binary_c, binary_cmdline_string))
# Keep track of systems: # Keep track of systems:
probability_of_systems_run += full_system_dict["probability"] probability_of_systems_run += full_system_dict["probability"]
number_of_systems_run += 1 number_of_systems_run += 1
...@@ -1008,10 +1020,14 @@ class Population: ...@@ -1008,10 +1020,14 @@ class Population:
"_count": number_of_systems_run, "_count": number_of_systems_run,
} }
end_process_time = datetime.datetime.now()
verbose_print( verbose_print(
"Process {}: generator done at {}. Ran {} systems with a total probability of {}. This thread had {} failing systems with a total probability of {}".format( "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(
ID, ID,
datetime.datetime.now().isoformat(), start_process_time.isoformat(),
end_process_time.isoformat(),
(end_process_time-start_process_time).total_seconds(),
number_of_systems_run, number_of_systems_run,
probability_of_systems_run, probability_of_systems_run,
self.grid_options["_failed_count"], self.grid_options["_failed_count"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment