From 5763b91d39b07b3b5444ec72e3611010d63594b1 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 9 Nov 2020 17:46:11 +0100 Subject: [PATCH] Use the trebuchet only to specify an experiment --- garlic/sh/garlic | 16 +++++++++------- garlic/sh/garlic.1 | 8 ++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/garlic/sh/garlic b/garlic/sh/garlic index c759772..24b760b 100755 --- a/garlic/sh/garlic +++ b/garlic/sh/garlic @@ -10,7 +10,7 @@ PATH=@PATH@ #sshHost=mn1 #PATH=/nix/store/yjkcxbf0y1jdlbj0axghlg2fndc4dqkz-patchelf-0.11/bin:/nix/store/6is25fyx29d731idycngl7qmgcax5xng-gcc-wrapper-9.3.0/bin:/nix/store/h986r9i2j9x5z8i5g8aj0z8jdd129wyx-gcc-9.3.0/bin:/nix/store/48dypl6qdsj3vdzh7hjg5qnngfpdcz7h-glibc-2.31-bin/bin:/nix/store/zmac3n79ayg4fdqgznmi2v3lmcprzx4g-coreutils-8.31/bin:/nix/store/dmnnqr6j7kqgcr357b5qwiwvjvg2yyhd-binutils-wrapper-2.31.1/bin:/nix/store/gmi6xrkl95h6iypv00dvdpm3f4md9i6i-binutils-2.31.1/bin:/nix/store/48dypl6qdsj3vdzh7hjg5qnngfpdcz7h-glibc-2.31-bin/bin:/nix/store/zmac3n79ayg4fdqgznmi2v3lmcprzx4g-coreutils-8.31/bin:/nix/store/a41ky6icdgxa54jzps32gfgcrdyx94hs-rsync-3.1.3/bin:/nix/store/sxll2dlamfm32xd2nyfx7v8mlnx0gxks-openssh-8.3p1/bin:/nix/store/3gp7gv5z9jj3g92czxadvgphpwiviv28-nix-2.3.7/bin:/nix/store/zmac3n79ayg4fdqgznmi2v3lmcprzx4g-coreutils-8.31/bin:/nix/store/f2hn65ksj194nmy58nrjikv9r9w25irh-findutils-4.7.0/bin:/nix/store/m39n3m5c7r22b3ma2phnwmp0jj8a5jja-diffutils-3.7/bin:/nix/store/ray7jgwsr5xbxp28wvr427vywd08nz9s-gnused-4.8/bin:/nix/store/gzc092gzsanvym4c6sjgh22dsh9fzj4s-gnugrep-3.4/bin:/nix/store/mn412q9rz9afdrhl9v2ybf605r91wzl2-gawk-5.1.0/bin:/nix/store/xca341k5x5b4hcmi310gjhdlgqm4l56m-gnutar-1.32/bin:/nix/store/zvb8qad72bz6j7ia60dcsf3dfncxxqc7-gzip-1.10/bin:/nix/store/9pb8zp3zyykw09rg60f2nv32plamhd7h-bzip2-1.0.6.0.1-bin/bin:/nix/store/fm2p1d8w9sx4gbaf8qfv2rsailsyhvm3-gnumake-4.3/bin:/nix/store/npfsrhkjww5q7sax7p7ijcrj3wlbrxn7-bash-4.4-p23/bin:/nix/store/72m0m8v6mbp58vbngjgv5pn2scqhs6kk-patch-2.7.6/bin:/nix/store/7vh7fckk2srlkmmkfhs9y85icwm9rhj5-xz-5.2.5-bin/bin -usage() { echo "Usage: garlic [-RFwv] experiment" 1>&2; exit 1; } +usage() { echo "Usage: garlic [-RFwv] trebuchet" 1>&2; exit 1; } findClosure() { what=$1 @@ -28,6 +28,10 @@ findClosure() { echo "$mexp" } +findExperiment() { + grep -o -- "/nix/store/.*-experiment" "$1" +} + drvFromOutput() { nix-store -q --deriver $1 } @@ -166,23 +170,21 @@ while getopts "vwRF" o; do esac done shift $((OPTIND-1)) -ref="$1" - +trebuchet="$1" if [ -z "$enableRun" -a -z "$enableFetch" ]; then >&2 echo "missing operation" usage fi -if [ -z "$ref" ]; then +if [ -z "$trebuchet" ]; then >&2 echo "missing experiment" usage fi -experiment=$(findClosure "-experiment$" "$ref") -trebuchet=$(findClosure "-trebuchet$" "$ref") - checkTrebuchet $trebuchet + +experiment=$(findExperiment "$trebuchet") checkExperiment $experiment trebuchetDrv=$(drvFromOutput $trebuchet) diff --git a/garlic/sh/garlic.1 b/garlic/sh/garlic.1 index 6d455ab..86915d8 100644 --- a/garlic/sh/garlic.1 +++ b/garlic/sh/garlic.1 @@ -8,20 +8,20 @@ .Sh SYNOPSIS .Nm garlic .Op Fl RFvw -.Ar experiment +.Ar trebuchet .Sh DESCRIPTION .Nm is a program to handle tasks related with the experiments of the Garlic benchmark. The -.Ar experiment -argument is a path to a valid trebuchet or experiment stage script. The +.Ar trebuchet +argument is a path to a valid trebuchet stage script. The specified operations are executed sequentially and at least one must be selected from: .Bl -tag -width Ds -compact .Pp .It Fl R launches the -.Ar experiment . +.Ar experiment using the trebuchet. .Pp .It Fl F waits until the