Пример #1
0
    def setup(self):
        self.graph = nx.DiGraph()
        self.graph.add_nodes_from(["h1", "h2"])
        self.graph.add_nodes_from(["s1", "s2", "s3", "s4"])

        self.graph.add_edge("h1", "s1", traffic=0)
        self.graph.add_edge("s1", "s2", traffic=1)
        self.graph.add_edge("s1", "s3", traffic=3)
        self.graph.add_edge("s2", "s4", traffic=4)
        self.graph.add_edge("s3", "s4", traffic=3)
        self.graph.add_edge("s4", "h2", traffic=0)

        self.graph.add_edge("s1", "h1", traffic=0)
        self.graph.add_edge("s2", "s1", traffic=0)
        self.graph.add_edge("s3", "s1", traffic=0)
        self.graph.add_edge("s4", "s2", traffic=0)
        self.graph.add_edge("s4", "s3", traffic=0)
        self.graph.add_edge("h2", "s4", traffic=0)

        self.h1 = Host("h1", capacity=8)
        self.h2 = Host("h2", capacity=8)

        self.hosts = [self.h1, self.h2]

        self.router = GreedyRouter2(self.graph, hosts=self.hosts)
Пример #2
0
    def setup(self):
        self.graph = nx.DiGraph()
        self.graph.add_nodes_from(["h1", "h2", "s1", "s2", "s3", "s4"])
        self.graph.add_edges_from([("h1", "s1"), ("s1", "h1")])
        self.graph.add_edges_from([("s2", "h2"), ("h2", "s2")])
        self.graph.add_edges_from([("h1", "s2"), ("s2", "h1")])
        self.graph.add_edges_from([("s1", "h2"), ("h2", "s1")])
        self.graph.add_edges_from([("h1", "s3"), ("s3", "h1")])
        self.graph.add_edges_from([("s3", "s4"), ("s4", "s3")])
        self.graph.add_edges_from([("s4", "h2"), ("h2", "s4")])

        self.h1 = Host("h1", capacity=8)
        self.h2 = Host("h2", capacity=8)

        self.router = RandomRouter(self.graph)
Пример #3
0
    def setup(self):
        self.hosts = [Host("h" + str(i), capacity=8) for i in range(8)]

        self.job1 = Job("j1", n_procs=8)
        self.job2 = Job("j2", n_procs=24)

        self.selector = RandomHostSelector(hosts=self.hosts)
Пример #4
0
    def setup(self):
        self.hosts = [Host("h" + str(i), capacity=8) for i in range(8)]

        self.job1 = Job("j1", n_procs=32)
        self.job2 = Job("j2", n_procs=16)
        self.job3 = Job("j3", n_procs=24)

        self.selector = LinearHostSelector(hosts=self.hosts)
Пример #5
0
    def setup(self):
        self.sim = Simulator()

        self.h1 = Host("h1")
        self.h2 = Host("h2")
        self.s1 = Switch("s1")
        self.s2 = Switch("s2")

        self.cluster = MagicMock()
        self.cluster.hosts = [self.h1, self.h2]

        self.g = nx.DiGraph()
        self.g.add_path([self.h1, self.s1, self.s2, self.h2])
        self.g[self.h1][self.s1]["capacity"] = 1
        self.g[self.s1][self.s2]["capacity"] = 2
        self.g[self.s2][self.h2]["capacity"] = 1
        self.cluster.graph = self.g

        self.collector = InterconnectMetricsCollector(self.sim, self.cluster)
Пример #6
0
    def setup(self):
        self.graph = nx.DiGraph()
        self.graph.add_nodes_from(["h1", "h2", "h3", "h4"])
        self.graph.add_nodes_from(["s1", "s2", "s3", "s4", "s5", "s6"])
        self.graph.add_edges_from([("s1", "s3"), ("s3", "s1")])
        self.graph.add_edges_from([("s1", "s4"), ("s4", "s1")])
        self.graph.add_edges_from([("s2", "s3"), ("s3", "s2")])
        self.graph.add_edges_from([("s2", "s4"), ("s4", "s2")])
        self.graph.add_edges_from([("s3", "h1"), ("h1", "s3")])
        self.graph.add_edges_from([("s3", "h2"), ("h2", "s3")])
        self.graph.add_edges_from([("s4", "h3"), ("h3", "s4")])
        self.graph.add_edges_from([("s4", "h4"), ("h4", "s4")])

        self.h1 = Host("h1", capacity=8)
        self.h2 = Host("h2", capacity=8)
        self.h3 = Host("h3", capacity=8)
        self.h4 = Host("h4", capacity=8)

        self.hosts = [self.h1, self.h2, self.h3, self.h4]

        self.router = DmodKRouter(self.graph, hosts=self.hosts)
Пример #7
0
    def setup(self):
        self.hosts = [Host("h" + str(i), capacity=8) for i in range(8)]

        self.job1 = Job("j1", n_procs=32, duration=5.0)
        self.job2 = Job("j2", n_procs=16, duration=5.0)
        self.job3 = Job("j3", n_procs=24, duration=5.0)
        self.job4 = Job("j4", n_procs=64, duration=5.0)
        self.job5 = Job("j5", n_procs=64, duration=5.0)
        self.job6 = Job("j6", n_procs=64, duration=5.0)

        self.simulator = Simulator()
        self.scheduler = FCFSScheduler(self.hosts, self.simulator,
                                       LinearHostSelector(hosts=self.hosts),
                                       LinearProcessMapper())
Пример #8
0
 def setup(self):
     self.hosts = [Host("h" + str(i), capacity=8) for i in range(8)]
     self.procs = [Process("j1", rank=i) for i in range(60)]