Skip to content

Commit

Permalink
New paper draft on simd operator[]
Browse files Browse the repository at this point in the history
ChangeLog:

	* P3275_replace_simd_subscript_operators/Makefile: New file.
	* P3275_replace_simd_subscript_operators/changelog.tex: New file.
	* P3275_replace_simd_subscript_operators/main.tex: New file.
	* P3275_replace_simd_subscript_operators/strawpolls.tex: New file.
  • Loading branch information
mattkretz committed May 10, 2024
1 parent fd91e9b commit 1cd964d
Show file tree
Hide file tree
Showing 4 changed files with 509 additions and 0 deletions.
133 changes: 133 additions & 0 deletions P3275_replace_simd_subscript_operators/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
NAME := $(shell grep 'newcommand.wgDocumentNumber' main.tex|cut -f2 -d'{'|cut -f1 -d'}')
DRAFT := $(NAME)_draft
TEXINPUTS := ..:.:
PDFLATEX := TEXINPUTS=$(TEXINPUTS) flock . lualatex --shell-escape --halt-on-error --file-line-error --interaction nonstopmode
BIBER := biber --input-directory .. --output-directory .
MAKEINDEX := makeindex
SHELL := /bin/bash
EXTRA_DEPS := $(wildcard *.sty ../*.sty) ._dummy.tex
CREATEMD5 := md5sum `find . -regex '.*\.\(aux\|bbl\|toc\|tex\|ind\)'` > ._aux-md5sums
CHECKMD5 := md5sum --quiet -c ._aux-md5sums
UPLOADNAME := D$(shell echo $(NAME)|cut -c2-5).pdf

all: final

._dummy.tex:
touch $@

help:
@echo "all"
@echo "devel"
@echo "draft-loop"
@echo "final-loop"
@echo "final-figure<number>-loop"
@echo "draft"
@echo "final"
@echo "clean"
@echo "autocommit"

TEX_INPUTS := $(shell egrep '^[^%]*\\in(put|clude){.*?}' main.tex|sed 's@^.*{\(.*\)}.*$$@\1.tex@')
TEX_INPUTS2 := $(shell test -n "$(TEX_INPUTS)" && egrep '^[^%]*\\in(put|clude){.*?}' $(TEX_INPUTS) ._dummy.tex|sed -e 's@^.*{\([^.]*\)}.*$$@\1.tex@' -e 's@^.*{\(.*\)}.*$$@\1@') $(TEX_INPUTS)
TEX_INPUTS := $(shell test -n "$(TEX_INPUTS2)" && egrep '^[^%]*\\in(put|clude){.*?}' $(TEX_INPUTS2) ._dummy.tex|sed -e 's@^.*{\([^.]*\)}.*$$@\1.tex@' -e 's@^.*{\(.*\)}.*$$@\1@') $(TEX_INPUTS2) $(TEX_INPUTS) main.tex
TEX_LISTINGS := $(shell test -n "$(TEX_INPUTS)" && awk -F '{|}' -- '/lstinputlisting\[[^\]]*$$/ { getline; while($$0 !~ /\] *{.*\..*}$$/) getline; sub(/^.*\]/, ""); print } /lstinputlisting\[.*\] *{.*}/ { print }' $(TEX_INPUTS) |sed 's=.*\(\[[^]]*\]\)\?{\([^}]*\)}.*=\2='| sort -u)
TEX_PLOTDATA := $(shell grep '\\addplot.* file' $(TEX_INPUTS)|sed 's=^.*\\addplot.* file *{\(.*\)}.*$$=\1=')
GRAPHICS := $(shell grep 'includegraphics' main.tex $(TEX_INPUTS)|grep -v newcommand|sed -e 's=.*\\includegraphics[^{]*{\([^}]*\)}.*=\1=' |sort -u|while read f; do for d in $(subst :, ,$(TEXINPUTS)); do test -f $$d/$$f && echo $$d/$$f && break; done; done)
ALL_DEPS := $(TEX_INPUTS) $(TEX_LISTINGS) $(TEX_PLOTDATA) $(GRAPHICS) $(EXTRA_DEPS)

devel: final-loop

draft: $(DRAFT).pdf
final: $(NAME).pdf
mobile: $(NAME)_mobile.pdf

upload: $(NAME).pdf
@echo -n "Uploading $< ."
@while ! timeout 120s scp -B $< lxpool.gsi.de:web-docs/$(UPLOADNAME); do echo -n .; done
@echo .

loop-internal:
@screenTitle() { case "$$TERM" in screen*|tmux*) printf '\ek%s\e\\' "$$*";; *) printf '\e]1;%s:q\a' "$$*";; esac }; \
while true; do \
while true; do \
screenTitle 'LaTeX waiting: $(loopinternaltarget)'; \
if ! $(MAKE) -q $(loopinternaltarget).pdf>/dev/null; then \
screenTitle 'LaTeX build: $(loopinternaltarget)'; \
ls -lt $(ALL_DEPS) | head -n1 > ._stamp; \
nice ionice -c idle $(MAKE) $(loopinternaltarget).pdf || break; \
fi; \
sleep 1s; \
done; \
screenTitle 'failed'; \
kdialog --passivepopup "LaTeX ($(NAME)) failed" 1; \
echo -e '\a'; \
ls -lt $(ALL_DEPS) $(MORE_DEPS) | head -n1 > ._stamp.new; \
while diff -q ._stamp ._stamp.new; do \
sleep 1s; \
ls -lt $(ALL_DEPS) $(MORE_DEPS) | head -n1 > ._stamp.new; \
done; \
done

draft-loop:
$(MAKE) loopinternaltarget=$(DRAFT) MORE_DEPS=../draft.tex loop-internal

final-loop:
$(MAKE) loopinternaltarget=$(NAME) MORE_DEPS=../final.tex loop-internal

%-loop:
$(MAKE) loopinternaltarget=$(NAME)_$* MORE_DEPS=../$*.tex loop-internal

final-figure%-loop:
@while true; do $(MAKE) -q final-figure$*.pdf || $(MAKE) final-figure$*.pdf && sleep 1s; done

clean:
rm -f $(NAME).pdf $(DRAFT).pdf *.aux *.bbl *.blg *.brf *.lof *.log *.lol *.lot *.out *.toc */*.aux *.auxlock ._aux-md5sums *.bcf *.run.xml ._stamp ._stamp.new

ALL_DEPS=$(TEX_INPUTS) $(TEX_LISTINGS) $(EXTRA_DEPS) $(TEX_PLOTDATA)

$(DRAFT).pdf: ../draft.tex $(ALL_DEPS)
$(PDFLATEX) ../draft
@test -s draft.pdf && mv draft.pdf $@
$(BIBER) draft || true

$(NAME).pdf: ../final.tex $(ALL_DEPS)
@$(CREATEMD5)
$(PDFLATEX) ../final
@test -s final.pdf && mv final.pdf $@
$(BIBER) final || true
@while ! $(CHECKMD5); do \
$(CREATEMD5); \
$(PDFLATEX) ../final; \
test -s final.pdf && mv final.pdf $@; \
done
test "$(USER)" = "mkretz" && timeout 20s scp -B $@ lxpool.gsi.de:web-docs/$(UPLOADNAME) &

$(NAME)_%.pdf: ../%.tex $(ALL_DEPS)
@$(CREATEMD5)
$(PDFLATEX) ../$*
@test -s $*.pdf && mv $*.pdf $@
test -f $*.bcf && $(BIBER) $* || true
test -f $*.ind && $(MAKEINDEX) $* || true
while ! $(CHECKMD5); do \
$(CREATEMD5); \
$(PDFLATEX) ../$*; \
test -s $*.pdf && mv $*.pdf $@; \
test -f $*.ind && $(MAKEINDEX) $*; \
done

final-figure%.pdf: final.tex $(ALL_DEPS)
$(PDFLATEX) --halt-on-error --interaction=nonstopmode --jobname "final-figure$*" "\def\tikzexternalrealjob{final}\input{final}"

autocommit:
@screenTitle() { echo $$TERM|grep -q screen && printf '\ek%s\e\\' "$$*"; }; \
screenTitle 'autocommit' \
while true; do \
git commit -am "auto: `git status --porcelain|grep -v '^??'|cut -c4-|paste -s -d' '`" && \
screenTitle 'committed' && \
git push && \
screenTitle 'committed & pushed'; \
sleep 5s; \
screenTitle 'autocommit'; \
sleep 55s; \
done

.PHONY: clean
5 changes: 5 additions & 0 deletions P3275_replace_simd_subscript_operators/changelog.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
\section{Changelog}
(placeholder)
%\begin{revision}
% \todo Everything
%\end{revision}
Loading

0 comments on commit 1cd964d

Please sign in to comment.