From 658b4acccf71fdccfce43715bacc343053bb0504 Mon Sep 17 00:00:00 2001 From: Thomas Limbacher Date: Wed, 24 Jun 2020 17:30:22 +0200 Subject: [PATCH] Add missing file and minor changes --- core/sync_buffer.py | 26 ++++++++++++++++++++++++++ core/system.py | 14 +++++++------- 2 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 core/sync_buffer.py diff --git a/core/sync_buffer.py b/core/sync_buffer.py new file mode 100644 index 0000000..558299f --- /dev/null +++ b/core/sync_buffer.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +"""TODO""" + + +class SyncBuffer(): + """TODO""" + + def __init__(self, mpicomm): + """TODO""" + self._mpicomm = mpicomm + + def sync(self): + """TODO""" + pass + + def push(self, delay, size): + """TODO""" + pass + + def pop(self, delay, size): + """TODO""" + pass + + def null_terminate_send_buffer(self): + """TODO""" + pass diff --git a/core/system.py b/core/system.py index 948fdb3..4f2f228 100644 --- a/core/system.py +++ b/core/system.py @@ -73,7 +73,7 @@ def _run(self, start_time, stop_time, total_time, checking=False): if self.get_total_neurons() == 0: self._logger.warning("There are no units assigned to this rank") - run_time = (stop_time - self._clock) * spaghetti_timestep + run_time = (stop_time - self._clock) * simulation_timestep self._logger.notification("Simulation triggered (run time = %.2fs) ..." % run_time) @@ -105,7 +105,7 @@ def _run(self, start_time, stop_time, total_time, checking=False): and (self._clock % self.progress_bar_update_interval == 0 or self._clock == stop_time - 1)): fraction = ((self._clock - start_time + 1) * - spaghetti_timestep / total_time) + simulation_timestep / total_time) _progress_bar(fraction) # Evolve neuron groups @@ -129,7 +129,7 @@ def _run(self, start_time, stop_time, total_time, checking=False): # Sync nodes if (self._mpi_size > 1 - and self._clock % spaghetti_mindelay == 0): + and self._clock % simulation_mindelay == 0): self._sync() elapsed = time.process_time() - t_sim_start @@ -191,15 +191,15 @@ def run(self, simulation_time, checking=False): return False start_time = self._clock - stop_time = self._clock + int(simulation_time / spaghetti_timestep) + stop_time = self._clock + int(simulation_time / simulation_timestep) return self._run(start_time, stop_time, simulation_time, checking) def run_chunk(self, chunk_time, interval_start, interval_end, checking=False): """TODO""" - start_time = int(interval_start / spaghetti_timestep) - stop_time = self._clock + int(chunk_time / spaghetti_timestep) + start_time = int(interval_start / simulation_timestep) + stop_time = self._clock + int(chunk_time / simulation_timestep) simulation_time = interval_end - interval_start return self._run(start_time, stop_time, simulation_time, checking) @@ -210,7 +210,7 @@ def get_clock(self): def get_time(self): """TODO""" - return self._clock * spaghetti_timestep + return self._clock * simulation_timestep def get_total_neurons(self): """TODO"""