Iam_Sandeep

Untitled

May 11th, 2022
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1.  
  2. import sys
  3. from nest.experiment import *
  4. from nest.topology import *
  5. from topo_helper import topo_helper
  6.  
  7. class PodError(Exception):
  8.     def __init__(self,message):
  9.         self.message=message
  10.  
  11.  
  12. class Pod:
  13.     def __init__(self,switch_cnt):
  14.         self.switch_cnt=switch_cnt
  15.         self.agg_switches=[None]*(switch_cnt)
  16.         self.edge_switches=[None]*(switch_cnt)
  17.  
  18.  
  19.  
  20.  
  21. class Fat_tree_helper(topo_helper):
  22.     def __init__(self,pod_cnt):
  23.         if pod_cnt<0:
  24.             raise PodError("Negative pod count")
  25.         elif pod_cnt%2==1:
  26.             raise PodError("Odd pod count")
  27.  
  28.         self.pod_cnt=pod_cnt
  29.         self.core_cnt=(pod_cnt//2)**2
  30.         self.core_switches=[None]*(self.core_cnt)
  31.         self.host_cnt=(pod_cnt)**3//4
  32.         self.hosts=[None]*self.host_cnt
  33.  
  34.  
  35.    
  36.  
  37.     def __str__(self):
  38.         return "This is Fat tree class"
Advertisement
Add Comment
Please, Sign In to add comment