Skip to content

Commit

Permalink
A different way to check links
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Sep 26, 2023
1 parent e3bba49 commit 36afa36
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
15 changes: 5 additions & 10 deletions link_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# If SPINN_DIRS is not defined, this is an error!
ifndef SPINN_DIRS
$(error SPINN_DIRS is not set. Please define SPINN_DIRS (possibly by running "source setup" in the spinnaker package folder))
endif
BUILDS = link_test_sender.mk link_test_receiver.mk link_test.mk
all: $(BUILDS)
for f in $(BUILDS); do ("$(MAKE)" -f $$f) || exit $$?; done

APP = link_test
SOURCES = link_test.c

APP_OUTPUT_DIR := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))/

include $(SPINN_DIRS)/make/local.mk
clean: $(BUILDS)
for f in $(BUILDS); do ("$(MAKE)" -f $$f clean) || exit $$?; done
28 changes: 19 additions & 9 deletions link_test/link_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
import sys
from pacman.model.graphs.machine.machine_edge import MachineEdge
import spinnaker_graph_front_end as front_end
from link_test.link_test_vertex import LinkTestVertex, PARTITION_NAME
from link_test.link_test_send_vertex import LinkTestSendVertex, PARTITION_NAME
from link_test.link_test_receive_vertex import LinkTestReceiveVertex

WRITE_ROUTES = True
SENDS_PER_TS = 256
DROPS_PER_TS = 0


def run(n_boards=None):
Expand All @@ -27,26 +32,31 @@ def run(n_boards=None):
run_time = 10000

# Put link test on all chips
chips = dict()
senders = dict()
receivers = dict()
for c_x, c_y in machine.chip_coordinates:
chips[c_x, c_y] = LinkTestVertex(c_x, c_y, 256, 0, run_time)
front_end.add_machine_vertex_instance(chips[c_x, c_y])
receivers[c_x, c_y] = LinkTestReceiveVertex(
c_x, c_y, SENDS_PER_TS, DROPS_PER_TS, run_time, WRITE_ROUTES)
front_end.add_machine_vertex_instance(receivers[c_x, c_y])
senders[c_x, c_y] = LinkTestSendVertex(
c_x, c_y, SENDS_PER_TS, WRITE_ROUTES)

# Connect links together
for chip in machine.chips:
for link in chip.router.links:
opposite_link = (link.source_link_id + 3) % 6
target = chips[link.destination_x, link.destination_y]
source = chips[chip.x, chip.y]
target = receivers[link.destination_x, link.destination_y]
source = senders[chip.x, chip.y]
target.set_neighbour(opposite_link, source)
front_end.add_machine_edge_instance(
MachineEdge(source, target), PARTITION_NAME)
if not WRITE_ROUTES:
front_end.add_machine_edge_instance(
MachineEdge(source, target), PARTITION_NAME)

front_end.run(run_time)
front_end.stop()

# Check the vertices for failure
for vertex in chips.values():
for vertex in receivers.values():
vertex.check_failure()


Expand Down
1 change: 0 additions & 1 deletion link_test/run_link_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def test_run(x, y):
f.write("write_network_specification_report = False\n")
f.write("write_provenance = False\n")
f.write("read_graph_provenance_data = False\n")
f.write("read_placements_provenance_data = False\n")
f.write("read_profile_data = False\n")

test = LinkTest()
Expand Down

0 comments on commit 36afa36

Please sign in to comment.