@@ -41,44 +41,40 @@ def board_chip_report() -> None:
4141
4242def _write_report (
4343 writer : TextIO , machine : Machine , progress_bar : ProgressBar ) -> None :
44- down_links : List [ Tuple [ int , int , int , str ]] = []
45- down_chips : List [ Tuple [ int , int , str ]] = []
46- down_cores : List [ Tuple [ int , int , str , str ]] = []
44+ n_cores = FecDataView . get_machine_version (). max_cores_per_chip
45+ n_links = Router . MAX_LINKS_PER_ROUTER
46+ cores = set ( range ( n_cores ))
4747 for e_chip in progress_bar .over (machine .ethernet_connected_chips ):
48- assert e_chip . ip_address is not None
49- existing_chips : List [ str ] = []
48+ writer . write (
49+ f"board with IP address: { e_chip . ip_address } \n " )
5050 for l_x , l_y in machine .local_xys :
51+ down_chips : List [Tuple [int , int ]] = list ()
5152 x , y = machine .get_global_xy (l_x , l_y , e_chip .x , e_chip .y )
5253 if machine .is_chip_at (x , y ):
5354 chip = machine [x , y ]
54- existing_chips .append (
55- f"({ x } , { y } , "
56- f"{ FecDataView .get_physical_string ((x , y ), 0 )} )" )
57- n_cores = FecDataView .get_machine_version ().max_cores_per_chip
58- down_procs = set (range (n_cores ))
59- for p in chip .all_processor_ids :
60- down_procs .remove (p )
61- for p in down_procs :
62- phys_p = FecDataView .get_physical_string ((x , y ), p )
63- if not phys_p : # ""
64- phys_p = str (- p )
65- down_cores .append ((l_x , l_y , phys_p , e_chip .ip_address ))
66- else :
67- down_chips .append ((l_x , l_y , e_chip .ip_address ))
68- for link in range (Router .MAX_LINKS_PER_ROUTER ):
69- if not machine .is_link_at (x , y , link ):
70- down_links .append ((l_x , l_y , link , e_chip .ip_address ))
55+ writer .write (
56+ f"\t { x } , { y } , scamp core 0:"
57+ f"{ FecDataView .get_physical_string (chip , 0 )} \n " )
7158
72- writer .write (
73- f"board with IP address: { e_chip .ip_address } has chips"
74- f" { ', ' .join (existing_chips )} \n " )
59+ if chip .n_processors < n_cores :
60+ physical = FecDataView .get_physical_cores (chip )
61+ down_cores = list (cores - physical )
62+ down_cores .sort ()
63+ writer .write (f"\t \t Down Cores: { down_cores } \n " )
64+
65+ router = chip .router
66+ if len (router ) < n_links :
67+ down_links = list ()
68+ for link in range (n_links ):
69+ if chip .router .is_link (link ):
70+ continue
71+ tx , ty = machine .xy_over_link (x , y , link )
72+ if machine .is_chip_at (tx , ty ):
73+ down_links .append (link )
74+ if down_links :
75+ writer .write (f"\t \t Down Links: { down_links } \n " )
76+ else :
77+ down_chips .append ((x , y ))
7578
76- down_chips_out = ":" .join (
77- f"{ x } ,{ y } ,{ ip } " for x , y , ip in down_chips )
78- down_cores_out = ":" .join (
79- f"{ x } ,{ y } ,{ phys_p } ,{ ip } " for x , y , phys_p , ip in down_cores )
80- down_links_out = ":" .join (
81- f"{ x } ,{ y } ,{ l } ,{ ip } " for x , y , l , ip in down_links )
82- writer .write (f"Down chips: { down_chips_out } \n " )
83- writer .write (f"Down cores: { down_cores_out } \n " )
84- writer .write (f"Down Links: { down_links_out } \n " )
79+ if down_chips :
80+ writer .write (f"\t \t Down chips: { down_chips } \n " )
0 commit comments