From 2c5d48c6bd557e78438682690bf007039fee375f Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 21 Jan 2019 14:40:10 +0000 Subject: Separate LaTeX build directory for each user in group scenario When building in group mode, users can manage them selves to work on independent analysis steps and thus not cause conflicts. However, until now, there was no way to avoid conflicts in building the final paper. To fix this problem, when we are in group mode, the pipeline will create a separate LaTeX build director for each user and also a separate PDF file for each user. This will ensure that their compilations don't conflict. --- reproduce/src/make/initialize.mk | 48 +++++++++++++++++++++++++++++++++++----- reproduce/src/make/paper.mk | 2 +- 2 files changed, 43 insertions(+), 7 deletions(-) (limited to 'reproduce/src') diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk index 35d365b..545f113 100644 --- a/reproduce/src/make/initialize.mk +++ b/reproduce/src/make/initialize.mk @@ -38,8 +38,6 @@ texdir = $(BDIR)/tex srcdir = reproduce/src lockdir = $(BDIR)/locks indir = $(BDIR)/inputs -texbdir = $(texdir)/build -tikzdir = $(texbdir)/tikz mtexdir = $(texdir)/macros pconfdir = reproduce/config/pipeline installdir = $(BDIR)/dependencies/installed @@ -50,8 +48,42 @@ gconfdir = reproduce/config/gnuastro -# System's environment -# -------------------- + +# TeX build directory +# ------------------ +# +# In scenarios where multiple users are working on the pipeline +# simultaneously, they can't all build the final paper together, there will +# be conflicts! It is possible to manage the working on the analysis, so no +# conflict is caused in that phase, but it would be very slow to only let +# one of the project members to build the paper at every instance +# (independent parts of the paper can be added to it independently). To fix +# this problem, when we are in a group setting, we'll use the user's ID to +# create a separate LaTeX build directory for each user. +# +# The same logic applies to the final paper PDF: each user will create a +# separte final PDF (for example `paper-user1.pdf' and `paper-user2.pdf') +# and no `paper.pdf' will be built. This isn't a problem because +# `initialize.tex' is a .PHONY prerequisite, so the rule to build the final +# 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) +user = $(shell whoami) +texbdir = $(texdir)/build-$(user) +final-paper = paper-$(user).pdf +else +texbdir = $(texdir)/build +final-paper = paper.pdf +endif +tikzdir = $(texbdir)/tikz + + + + + +# Original system environment +# --------------------------- # # Before defining the local sub-environment here, we'll need to save the # system's environment for some scenarios (for example after `clean'ing the @@ -61,6 +93,9 @@ sys-rm := $(shell which rm) curdir := $(shell echo $$(pwd)) + + + # High level environment # ---------------------- # @@ -85,8 +120,8 @@ export CPPFLAGS := -I$(installdir)/include -# Make the high-level level directories -# ------------------------------------- +# High-level level directories +# ---------------------------- # # These are just the top-level directories for all the separate steps. The # directories (or possible sub-directories) for individual steps will be @@ -178,6 +213,7 @@ lvcheck = idir=$(BDIR)/dependencies/installed/include; \ + # Pipeline initialization results # ------------------------------- # diff --git a/reproduce/src/make/paper.mk b/reproduce/src/make/paper.mk index 4006070..17d59bf 100644 --- a/reproduce/src/make/paper.mk +++ b/reproduce/src/make/paper.mk @@ -135,6 +135,6 @@ paper.pdf: tex/pipeline.tex paper.tex $(texbdir)/paper.bbl \ # Come back to the top pipeline directory and copy the built PDF # file here. cd $$p - cp $(texbdir)/$@ $@ + cp $(texbdir)/$@ $(final-paper) fi -- cgit v1.2.1