From e70329599cf6b2134c09cec233c25fc325af3cbc Mon Sep 17 00:00:00 2001 From: Denis Kuchelev Date: Mon, 28 Oct 2019 03:03:07 +0100 Subject: [PATCH 1/2] Implement copying benchmark parameters from an existing experiment Resolves #448. --- .../src/app/benchmark/benchmark.component.ts | 24 +++++++++++++++++++ .../details/details.component.html | 8 ++++++- .../experiments/details/details.component.ts | 8 +++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/hobbit-gui/gui-client/src/app/benchmark/benchmark.component.ts b/hobbit-gui/gui-client/src/app/benchmark/benchmark.component.ts index 3f3a32f6..232c6a9e 100644 --- a/hobbit-gui/gui-client/src/app/benchmark/benchmark.component.ts +++ b/hobbit-gui/gui-client/src/app/benchmark/benchmark.component.ts @@ -43,6 +43,14 @@ export class BenchmarkComponent implements OnInit { if (this.benchmarks.length === 0) this.messageService.add({ severity: 'warn', summary: 'No Benchmarks', detail: 'Did not find any benchmarks.' }); + + if (window['repeatExperiment']) { + const benchmark = this.benchmarks.find(b => b.id === window['repeatExperiment'].benchmark.id); + if (benchmark) { + this.configModel.benchmark = benchmark.id; + this.onChangeBenchmark(benchmark.id); + } + } }); } @@ -57,6 +65,22 @@ export class BenchmarkComponent implements OnInit { this.selectedBenchmark.systems.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())); this.selectedBenchmark.systems = this.filterInvalidSystems(this.selectedBenchmark.systems); + + if (window['repeatExperiment']) { + const system = this.selectedBenchmark.systems.find(s => s.id === window['repeatExperiment'].system.id); + if (system) { + this.selectedSystem = system; + } + + this.selectedBenchmark.configurationParams.forEach(param => { + const experimentParamValue = window['repeatExperiment'].benchmark.configurationParamValues.find(v => v.id === param.id); + if (experimentParamValue) { + param.defaultValue = experimentParamValue.value; + } + }); + + delete window['repeatExperiment']; + } }); } } diff --git a/hobbit-gui/gui-client/src/app/experiments/details/details.component.html b/hobbit-gui/gui-client/src/app/experiments/details/details.component.html index e789f9b8..527fca77 100644 --- a/hobbit-gui/gui-client/src/app/experiments/details/details.component.html +++ b/hobbit-gui/gui-client/src/app/experiments/details/details.component.html @@ -36,11 +36,17 @@ -
+
+ +
+ +
+
+
diff --git a/hobbit-gui/gui-client/src/app/experiments/details/details.component.ts b/hobbit-gui/gui-client/src/app/experiments/details/details.component.ts index 570d3cef..28b6e096 100644 --- a/hobbit-gui/gui-client/src/app/experiments/details/details.component.ts +++ b/hobbit-gui/gui-client/src/app/experiments/details/details.component.ts @@ -162,6 +162,9 @@ export class DetailsComponent implements OnInit, OnChanges { this.rows.push(this.buildRow('Logs', 'System Log', '', t => [ t.systemLogAvailable ? [`system/query?id=${t.id}`, `${t.id} system log`] : null, 'Download' ])); + this.rows.push(this.buildRow('Controls', 'Repeat Experiment', '', t => [ + null, 'Repeat' + ])); this.rows.sort((a, b) => { if (a.group !== b.group) @@ -215,6 +218,11 @@ export class DetailsComponent implements OnInit, OnChanges { }); } + repeat(ex: Experiment) { + window['repeatExperiment'] = ex; + this.router.navigate(['benchmarks/']); + } + private getMimeType(format: string): string { if (format === 'JSON') return 'application/json'; From 7d5195ba77c4e76a4eb7d08d6e1c8d985d0097fa Mon Sep 17 00:00:00 2001 From: Denis Kuchelev Date: Fri, 15 Nov 2019 05:06:31 +0100 Subject: [PATCH 2/2] Mark cells which have the same value as in a neighboring experiment Issue #478. --- .../src/app/experiments/details/details.component.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hobbit-gui/gui-client/src/app/experiments/details/details.component.html b/hobbit-gui/gui-client/src/app/experiments/details/details.component.html index 527fca77..488bb3c1 100644 --- a/hobbit-gui/gui-client/src/app/experiments/details/details.component.html +++ b/hobbit-gui/gui-client/src/app/experiments/details/details.component.html @@ -42,11 +42,15 @@ -
+
+ + + +