From 0917531dd5b62f1ba6322e8019ee74ab9b25109a Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Wed, 2 Jan 2019 14:18:50 +0100 Subject: PLRsearch: Use stat trackers to shorten Integrator + Extract several tracker classes and use them in Integrator. + Apply next_rate workarounds to focus more on critical region. + Rewrite stretch function, as the previous implementation was wrong. + Rework logging: ++ Use injected trace() function in Integrator. ++ Inject function that skips trace logging on default initialization. ++ Use the same multiprocessing-safe passing, but separate queue. + Set duration to 120m in Robot, but keep at 30m in Python. + Apply minor changes to make computations more reproducible: ++ Attempt to log everything needed by reproducibility in one line. ++ Log samples used, and make it settable as upper limit. ++ Use repr output in TRex scripts, to avoid rounding when copypasting. +- Numpy seems to be sharing PRNG between processes. +-- An edit to disable one thread is needed for full reproducibility. +-- Such an edit is prepared, but will not be merged anytime soon. Change-Id: Icf56429b34ab6de2d18a12e6c676e2d242b3ba4c Signed-off-by: Vratko Polak --- resources/libraries/python/TrafficGenerator.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'resources/libraries/python/TrafficGenerator.py') diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index 5f92888fe8..da364cbded 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -425,8 +425,8 @@ class TrafficGenerator(AbstractMeasurer): command = ( "sh -c '{tool}/resources/tools/trex/trex_stateless_profile.py" " --profile {prof}/resources/traffic_profiles/trex/{traffic}.py" - " --duration {duration} --frame_size {frame_size} --rate {rate}" - " --warmup_time {warmup} --port_0 {p_0} --port_1 {p_1}").format( + " --duration {duration!r} --frame_size {frame_size} --rate {rate!r}" + " --warmup_time {warmup!r} --port_0 {p_0} --port_1 {p_1}").format( tool=Constants.REMOTE_FW_DIR, prof=Constants.REMOTE_FW_DIR, traffic=traffic_profile, duration=duration, frame_size=frame_size, rate=rate, warmup=warmup_time, p_0=p_0, @@ -698,8 +698,8 @@ class OptimizedSearch(object): @staticmethod def perform_soak_search( frame_size, traffic_profile, minimum_transmit_rate, - maximum_transmit_rate, plr_target=1e-7, tdpt=0.2, - initial_count=50, timeout=1800.0): + maximum_transmit_rate, plr_target=1e-7, tdpt=0.1, + initial_count=50, timeout=1800.0, trace_enabled=False): """Setup initialized TG, perform soak search, return avg and stdev. :param frame_size: Frame size identifier or value [B]. @@ -734,6 +734,7 @@ class OptimizedSearch(object): algorithm = PLRsearch( measurer=tg_instance, trial_duration_per_trial=tdpt, packet_loss_ratio_target=plr_target, - trial_number_offset=initial_count, timeout=timeout) + trial_number_offset=initial_count, timeout=timeout, + trace_enabled=trace_enabled) result = algorithm.search(minimum_transmit_rate, maximum_transmit_rate) return result -- cgit 1.2.3-korg