Commit 7549fa9e authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

pre-commit run -a

parent aac98df8
......@@ -23,15 +23,16 @@
# Allow own class to be used as type for a method's argument
from __future__ import annotations
from abc import ABCMeta, abstractmethod
import shutil
import pathlib
import shutil
import typing as tp
from abc import ABCMeta, abstractmethod
import simbricks.exectools as exectools
from simbricks.experiment.experiment_environment import ExpEnv
from simbricks.experiment.experiment_output import ExpOutput
from simbricks.experiments import Experiment
import simbricks.exectools as exectools
class Run(object):
......
......@@ -23,12 +23,15 @@
import asyncio
import pathlib
import simbricks.proxy as proxy
from simbricks.exectools import Executor
from simbricks.runtime.common import *
import simbricks.experiments as exp
import simbricks.proxy as proxy
class DistributedSimpleRuntime(Runtime):
def __init__(self, execs, verbose=False):
self.runnable = []
self.complete = []
......@@ -42,8 +45,9 @@ class DistributedSimpleRuntime(Runtime):
self.runnable.append(run)
async def do_run(self, run: Run):
runner = exp.ExperimentDistributedRunner(self.execs, run.experiment,
run.env, self.verbose)
runner = exp.ExperimentDistributedRunner(
self.execs, run.experiment, run.env, self.verbose
)
for exec in self.execs:
await run.prep_dirs(exec)
await runner.prepare()
......@@ -62,9 +66,11 @@ class DistributedSimpleRuntime(Runtime):
def auto_dist(
e: Experiment, execs: tp.List[Executor], proxy_type: str = 'sockets'
):
""" Converts an Experiment into a DistributedExperiment. Assigns network to
executor zero, and then round-robin assignment of hosts to executors,
while also assigning all nics for a host to the same executor.
"""
Converts an Experiment into a DistributedExperiment.
Assigns network to executor zero, and then round-robin assignment of hosts
to executors, while also assigning all nics for a host to the same executor.
"""
if len(execs) < 2:
......
......@@ -24,9 +24,10 @@ import asyncio
import pathlib
from typing import Optional
import simbricks.exectools as exectools
from simbricks.runtime.common import *
import simbricks.experiments as exp
import simbricks.exectools as exectools
class LocalSimpleRuntime(Runtime):
......
......@@ -20,14 +20,16 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import pickle
import os
import pathlib
import pickle
import re
from simbricks.runtime.common import *
class SlurmRuntime(Runtime):
def __init__(self, slurmdir, args, verbose=False, cleanup=True):
self.runnable = []
self.slurmdir = slurmdir
......
......@@ -23,9 +23,10 @@
import typing as tp
from simbricks.nodeconfig import AppConfig, NodeConfig
from simbricks.simulators import HostSim, I40eMultiNIC, NetSim, NICSim
from simbricks.experiments import Experiment
from simbricks.nodeconfig import NodeConfig, AppConfig
from simbricks.simulators import NetSim, NICSim, HostSim, I40eMultiNIC
def create_basic_hosts(
......@@ -40,7 +41,9 @@ def create_basic_hosts(
ip_start: int = 1,
ip_prefix: int = 24
):
"""Creates and configures multiple hosts to be simulated using the given parameters.
"""
Creates and configures multiple hosts to be simulated using the given
parameters.
Args:
`num`: number of hosts to create
......@@ -82,7 +85,9 @@ def create_multinic_hosts(
ip_start: int = 1,
ip_prefix: int = 24
):
"""Creates and configures multiple hosts to be simulated using the given parameters. These hosts use multiple NICs.
"""
Creates and configures multiple hosts to be simulated using the given
parameters. These hosts use multiple NICs.
Args:
num: number of hosts to create
......@@ -130,7 +135,9 @@ def create_dctcp_hosts(
mtu: int,
ip_start: int = 1
):
"""Creates and configures multiple hosts to be simulated in a DCTCP experiment using the given parameters.
"""
Creates and configures multiple hosts to be simulated in a DCTCP experiment
using the given parameters.
Args:
num: number of hosts to create
......
This diff is collapsed.
......@@ -20,11 +20,11 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import sys
import json
import os
import pathlib
import shutil
import json
import sys
if len(sys.argv) != 2:
print('Usage: udp_scale.py OUTDIR')
......@@ -43,12 +43,10 @@ for cl in types_of_client:
diff_time = ''
else:
exp_log = json.load(log)
start_time = exp_log["start_time"]
end_time = exp_log["end_time"]
diff_time = (end_time - start_time)/60 #min
start_time = exp_log['start_time']
end_time = exp_log['end_time']
diff_time = (end_time - start_time) / 60 #min
diff_time = str(diff_time)
log.close()
print('%d\t%s' % (cl, diff_time))
......@@ -20,12 +20,12 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import sys
import json
import math
import os
import pathlib
import shutil
import json
import math
import sys
num_runs = 3
if len(sys.argv) != 2:
......@@ -42,14 +42,14 @@ for bw in types_of_bw:
avg_time = 0
std = 0
all_time = []
for i in range(1, num_runs+1):
for i in range(1, num_runs + 1):
log_path = '%sgt-ib-sw-Load-%dm-%d.json' % (basedir, bw, i)
if os.path.exists(log_path):
log = open(log_path, 'r')
exp_log = json.load(log)
start_time = exp_log["start_time"]
end_time = exp_log["end_time"]
diff_time = (end_time - start_time)/60 #min
start_time = exp_log['start_time']
end_time = exp_log['end_time']
diff_time = (end_time - start_time) / 60 #min
total_time += diff_time
all_time.append(diff_time)
diff_time = str(diff_time)
......@@ -60,16 +60,13 @@ for bw in types_of_bw:
#print('%d\t%s' % (bw, diff_time))
avg_time = total_time/num_runs
avg_time = total_time / num_runs
#print('avg_time: ' + str(avg_time))
for i in range(0, num_runs):
std += (all_time[i] - avg_time) * (all_time[i] - avg_time)
std = std/num_runs
std = std / num_runs
std = math.sqrt(std)
#print(str(std))
print('%d %s %f' % (bw, avg_time, std))
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment