Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop the offset being 1000 microseconds or greater #1011

Merged
merged 5 commits into from
Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@

# The microseconds per timestep will be divided by this for the max offset
_MAX_OFFSET_DENOMINATOR = 10
# The max offset modulo to stop spikes in simple cases moving to the next ts
_MAX_OFFSET_MODULO = 1000


class ReverseIPTagMulticastSourceMachineVertex(
Expand Down Expand Up @@ -648,9 +650,9 @@ def _write_configuration(self, spec):
max_offset = (FecDataView.get_hardware_time_step_us() // (
_MAX_OFFSET_DENOMINATOR * 2))
spec.write_value(
(int(math.ceil(max_offset / self._n_vertices)) *
ReverseIPTagMulticastSourceMachineVertex._n_data_specs) +
int(math.ceil(max_offset)))
((int(math.ceil(max_offset / self._n_vertices)) *
ReverseIPTagMulticastSourceMachineVertex._n_data_specs) +
int(math.ceil(max_offset))) % _MAX_OFFSET_MODULO)
ReverseIPTagMulticastSourceMachineVertex._n_data_specs += 1

@overrides(
Expand Down