-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
71 lines (54 loc) · 1.6 KB
/
config.py
File metadata and controls
71 lines (54 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python
#
# Copyright (c) 2013-2016, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
# This is meant to hold all sort of configuration options
import os
topologies = [
"adaptivetree",
"mst",
"bintree",
"cluster",
"badtree",
"fibonacci",
"sequential",
]
machines = []
# List of models that have been generated - this is needed (currently)
# to make generated models available for sending back to the
# requesting client when acting as a RPC server.
models = []
running_as_server = False
# Find config.py's working directory
dir_path = os.path.dirname(os.path.realpath(__file__))
# Path to the machine database.
MACHINE_DATABASE='%s/machinedb' % dir_path
MACHINE_DATABASE_SCRIPTS='%s/machinedb/scripts' % dir_path
MACHINE_DATABASE_DATA='%s/machinedb/machine-data' % dir_path
# Arguments as given when invoking the simulator
args = None
def translate_machine_name(n):
"""
"""
return n
def arg_machine_class(machine):
"""
"""
import netos_machine
return netos_machine.NetosMachine
def arg_machine(machine_name):
"""
Return instance of the machine given as argument
"""
machine_name = translate_machine_name(machine_name)
if machine_name == 'rack':
raise Exception('Racks not currently supported')
else:
return arg_machine_class(machine_name)
def get_mc_group():
assert args.group
return args.group