Don't nest the unit results
The experiment directory now contains symlinks to the units, keeping the old structure. The unit results are directly placed in the garlic out directory.
This commit is contained in:
parent
be0506bc21
commit
2680dcb66f
@ -13,6 +13,9 @@ with garlicTools;
|
||||
let
|
||||
unitsString = builtins.concatStringsSep "\n"
|
||||
(map (x: "${stageProgram x}") units);
|
||||
|
||||
unitsLinks = builtins.concatStringsSep "\n"
|
||||
(map (x: "ln -s ../${baseNameOf x} ${baseNameOf x}") units);
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "experiment";
|
||||
@ -30,16 +33,20 @@ stdenv.mkDerivation {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "\$GARLIC_OUT"
|
||||
|
||||
export GARLIC_EXPERIMENT=$(basename $out)
|
||||
echo "Running experiment \$GARLIC_EXPERIMENT"
|
||||
|
||||
if [ -e "\$GARLIC_EXPERIMENT" ]; then
|
||||
>&2 echo "Already exists \$GARLIC_EXPERIMENT, aborting"
|
||||
exit 1
|
||||
>&2 echo "skipping, experiment path already exists: \$GARLIC_EXPERIMENT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "\$GARLIC_EXPERIMENT"
|
||||
cd "\$GARLIC_EXPERIMENT"
|
||||
${unitsLinks}
|
||||
|
||||
echo "Running experiment \$GARLIC_EXPERIMENT"
|
||||
|
||||
# This is an experiment formed by the following units:
|
||||
${unitsString}
|
||||
|
@ -50,9 +50,21 @@ stdenv.mkDerivation {
|
||||
|
||||
${desc}
|
||||
|
||||
if [ -z "\$GARLIC_OUT" ]; then
|
||||
>&2 echo "GARLIC_OUT not defined, aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "\$GARLIC_OUT"
|
||||
|
||||
# Set the experiment unit in the environment
|
||||
export GARLIC_UNIT=$(basename $out)
|
||||
|
||||
if [ -e "\$GARLIC_UNIT" ]; then
|
||||
>&2 echo "skipping, unit path already exists: \$GARLIC_UNIT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# And change the working directory
|
||||
mkdir \$GARLIC_UNIT
|
||||
cd \$GARLIC_UNIT
|
||||
|
Loading…
Reference in New Issue
Block a user