Skip to content

Commit

Permalink
Add missing file and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tlimbacher committed Jun 24, 2020
1 parent e895801 commit 658b4ac
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
26 changes: 26 additions & 0 deletions core/sync_buffer.py
Original file line number Diff line number Diff line change
@@ -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
14 changes: 7 additions & 7 deletions core/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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"""
Expand Down

0 comments on commit 658b4ac

Please sign in to comment.