diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2019-02-01 18:30:02 +0000 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2019-02-01 18:38:44 +0000 |
commit | f41be41e376dfd521881ad2e6137360e549777de (patch) | |
tree | f01dfde240cf065ea161b073ac6663a4941a2ed4 /reproduce | |
parent | d65b1ccd97fab64062804ace0e0ec5914e1029c1 (diff) |
Group name is now part of the local configuration
Until now, the group name to build the project actually went into the Git
source of the project! This doesn't allow exact reproducibility on
different machines (where the group name may be different).
With this commit, the `for-group' script has been modified to accept the
group name as its first argument and pass that onto `configure' and
Make. This is much better now, because not only the existance of a group
installation is checked, but also the name of the group. It also made
things simpler (in particular in `LOCAL.mk.in').
Diffstat (limited to 'reproduce')
-rw-r--r-- | reproduce/config/pipeline/LOCAL.mk.in | 25 | ||||
-rw-r--r-- | reproduce/src/make/initialize.mk | 8 | ||||
-rw-r--r-- | reproduce/src/make/top.mk | 33 |
3 files changed, 24 insertions, 42 deletions
diff --git a/reproduce/config/pipeline/LOCAL.mk.in b/reproduce/config/pipeline/LOCAL.mk.in index 846a5b8..41298ee 100644 --- a/reproduce/config/pipeline/LOCAL.mk.in +++ b/reproduce/config/pipeline/LOCAL.mk.in @@ -6,27 +6,4 @@ BDIR = @bdir@ INDIR = @indir@ DEPENDENCIES-DIR = @ddir@ DOWNLOADER = @downloader@ -FOR-GROUP = @forgroup@ - - - - - -# In the top Makefile (which is created after running `./configure' and is -# actually a symbolic link to `reproduce/src/make/top.mk'), we need to -# start by checking if there is no conflict with the running and configured -# group configuration of the pipeline. -good-group-configuration := $(shell \ - if [ "x$(FOR-GROUP)" = xyes ]; then \ - if [ "x$(reproducible_paper_for_group)" = xyes ]; then \ - echo "yes"; \ - else \ - echo "no"; \ - fi; \ - else \ - if [ "x$(reproducible_paper_for_group)" = xyes ]; then \ - echo "no"; \ - else \ - echo "yes"; \ - fi; \ - fi) +GROUP-NAME = @groupname@ diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk index da2d012..57565b9 100644 --- a/reproduce/src/make/initialize.mk +++ b/reproduce/src/make/initialize.mk @@ -68,13 +68,13 @@ gconfdir = reproduce/config/gnuastro # paper is always executed (even if it is present and nothing has # changed). So in terms of over-all efficiency and processing steps, this # doesn't change anything. -ifeq ($(FOR-GROUP),yes) +ifeq (x$(GROUP-NAME),x) +texbdir = $(texdir)/build +final-paper = paper.pdf +else user = $(shell whoami) texbdir = $(texdir)/build-$(user) final-paper = paper-$(user).pdf -else -texbdir = $(texdir)/build -final-paper = paper.pdf endif tikzdir = $(texbdir)/tikz diff --git a/reproduce/src/make/top.mk b/reproduce/src/make/top.mk index 25c4f0b..9b81a58 100644 --- a/reproduce/src/make/top.mk +++ b/reproduce/src/make/top.mk @@ -39,24 +39,29 @@ include reproduce/config/pipeline/LOCAL.mk # configuration settings, necessary for a group building scenario mentioned # next). # +# # Group build # ----------- # # This pipeline can also be configured to have a shared build directory # between multiple users. In this scenario, many users (on a server) can -# have their own/separate version controlled pipeline source of the -# pipeline, but share the same build outputs (in a common directory). This -# will allow a group to work separately, on parallel parts of the analysis. -# It is thus very useful in cases were special storage requirements or CPU -# power is necessary and its not possible/efficient for each user to have a -# fully separate copy of the build directory. +# have their own/separate version controlled pipeline source, but share the +# same build outputs (in a common directory). This will allow a group to +# work separately, on parallel parts of the analysis that don't +# interfere. It is thus very useful in cases were special storage +# requirements or CPU power is necessary and its not possible/efficient for +# each user to have a fully separate copy of the build directory. +# +# Controlling this requires two variables that are available at this stage: +# +# - `GROUP-NAME': from `LOCAL.mk' (which was built by `./configure'). +# - `reproducible_paper_group_name': from the `./for-group' script (if it +# was used to call Make). # -# `FOR-GROUP': from `LOCAL.mk' (which was built by `./configure'). -# `reproducible_paper_for_group': from the `./for-group' script. +# The analysis is only done when both have the same group name. Note that +# when the pipeline isn't being built for a group, both variables will be +# an empty string. # -# The final paper is only built when both have a value of `yes', or when -# `FOR-GROUP' is no and `./for-group' wasn't called (if `./for-group' is -# called before `make', then `reproducible_paper_for_group==yes'). # # Only processing, no LaTeX PDF # ----------------------------- @@ -64,16 +69,16 @@ include reproduce/config/pipeline/LOCAL.mk # If you are just interested in the processing and don't want to build the # PDF, you can skip the creatation of the final PDF by removing the value # of `pdf-build-final' in `reproduce/config/pipeline/pdf-build.mk'. -ifeq ($(good-group-configuration),yes) +ifeq (x$(reproducible_paper_group_name),x$(GROUP-NAME)) all: paper.pdf else all: - @if [ "x$(reproducible_paper_for_group)" = xyes ]; then \ + @if [ "x$(GROUP-NAME)" = x ]; then \ echo "Pipeline is NOT configured for groups, please run"; \ echo " $$ .local/bin/make"; \ else \ echo "Pipeline is configured for groups, please run"; \ - echo " $$ ./for-group make"; \ + echo " $$ ./for-group $(GROUP-NAME) make -j8"; \ fi endif |