From 25e10511e12fc0587cf9c553e368b63f775655a5 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Wed, 27 May 2026 16:37:15 +0200 Subject: [PATCH] update runner scripts to allow different experiment arguments --- scripts/deploy.pl | 2 +- scripts/multi_runner.pl | 26 ++++++++++++++++++++++++++ scripts/runner.pl | 21 ++++++++++----------- 3 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 scripts/multi_runner.pl diff --git a/scripts/deploy.pl b/scripts/deploy.pl index 407a872..92cae4f 100755 --- a/scripts/deploy.pl +++ b/scripts/deploy.pl @@ -18,7 +18,7 @@ my $local_builds_dir = "$local_root/builds"; my $remote_root = '/home/lab/smchurla/Documents/failnix'; my $remote_builds_dir = "$remote_root/builds"; -my $remote_runner = "$remote_root/scripts/runner.pl"; +my $remote_runner = "$remote_root/scripts/multi_runner.pl"; my $remote_log = "$remote_root/runner.log"; # Upload new experiments diff --git a/scripts/multi_runner.pl b/scripts/multi_runner.pl new file mode 100644 index 0000000..e28f328 --- /dev/null +++ b/scripts/multi_runner.pl @@ -0,0 +1,26 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use diagnostics; + +use FindBin; +use lib $FindBin::Bin; + +use Util; + +use feature 'say'; + +my $remote_root = '/home/lab/smchurla/Documents/failnix'; +my $remote_builds_dir = "$remote_root/builds"; + +# Run experiments +my @experiments = Util::find_subdirs($remote_builds_dir); +for my $experiment (@experiments) { + say "Running experiment: $experiment"; + my $experiment_runner = "$remote_builds_dir/$experiment/runner.pl"; + system( "perl", $experiment_runner, $experiment ) == 0 + or warn "runner.pl failed for $experiment: $?"; +} + +Util::notify("Finished all experiments"); diff --git a/scripts/runner.pl b/scripts/runner.pl index 9be936c..339832d 100644 --- a/scripts/runner.pl +++ b/scripts/runner.pl @@ -6,6 +6,7 @@ use diagnostics; use FindBin; use lib $FindBin::Bin; +use lib "$FindBin::Bin/../../scripts"; use Util; @@ -273,16 +274,14 @@ sub results { } } -# Run experiments -my @experiments = Util::find_subdirs($remote_builds_dir); -for my $experiment (@experiments) { - Util::rewrite_file( $remote_db_conf, "database=", - "database=${db_prefix}_$experiment\n" ); +# Run single experiment passed as argument +my $experiment = $ARGV[0] or die "Usage: runner.pl \n"; +Util::rewrite_file( $remote_db_conf, "database=", + "database=${db_prefix}_$experiment\n" ); - trace($experiment); - import_trace($experiment); - inject($experiment); - results($experiment); -} +trace($experiment); +import_trace($experiment); +inject($experiment); +results($experiment); -Util::notify("Finished all experiments"); +Util::notify("Finished experiment $experiment");