Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from nest.experiment import *
- from nest.topology import *
- from topo_helper import topo_helper
- class PodError(Exception):
- def __init__(self,message):
- self.message=message
- class Pod:
- def __init__(self,switch_cnt):
- self.switch_cnt=switch_cnt
- self.agg_switches=[None]*(switch_cnt)
- self.edge_switches=[None]*(switch_cnt)
- class Fat_tree_helper(topo_helper):
- def __init__(self,pod_cnt):
- if pod_cnt<0:
- raise PodError("Negative pod count")
- elif pod_cnt%2==1:
- raise PodError("Odd pod count")
- self.pod_cnt=pod_cnt
- self.core_cnt=(pod_cnt//2)**2
- self.core_switches=[None]*(self.core_cnt)
- self.host_cnt=(pod_cnt)**3//4
- self.hosts=[None]*self.host_cnt
- def __str__(self):
- return "This is Fat tree class"
Advertisement
Add Comment
Please, Sign In to add comment