From f41be41e376dfd521881ad2e6137360e549777de Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 1 Feb 2019 18:30:02 +0000 Subject: 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'). --- reproduce/src/make/initialize.mk | 8 ++++---- reproduce/src/make/top.mk | 33 +++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 18 deletions(-) (limited to 'reproduce/src') 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 -- cgit v1.2.1