commit 655faa15f262bbb8765c2b611ff4b477036130a0 Author: Alexis Pereda Date: Mon Jul 19 14:59:37 2021 +0200 thesis version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4f63e1a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,78 @@ +cmake_minimum_required(VERSION 3.1) + +project(defense) + +set(LATEX_COMPILER_FLAGS "-interaction=batchmode -file-line-error -shell-escape" + CACHE STRING "Flags passed to latex.") +include(UseLATEX.cmake) + +# Global +set(LATEX_USE_SYNCTEX ON) +set(imgdir img) + +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pdf) + +# Functions +macro(subdirlist result curdir) + file(GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${curdir}/*) + foreach(child ${children}) + if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${child}) + subdirlist(${result} ${child}) + list(APPEND ${result} ${child}) + endif() + endforeach() +endmacro() + +set(imgdirs ${imgdir}) +subdirlist(imgdirs ${imgdir}) + +# Document +set(modes default notes) +set(srcdir src) +set(stydir sty) + +file(GLOB_RECURSE src RELATIVE ${CMAKE_SOURCE_DIR} ${srcdir}/*.tex) +file(GLOB_RECURSE bib RELATIVE ${CMAKE_SOURCE_DIR} ${srcdir}/*.bib) +file(GLOB_RECURSE sty RELATIVE ${CMAKE_SOURCE_DIR} ${stydir}/*.sty) +set(other_in raw/cpplogo.pdf_tex raw/cpplogo.pdf) + +set(latex_document_options) +set(custom_command_options ALL) + +foreach(mode ${modes}) + set(maintex main_${mode}) + + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink + ${CMAKE_CURRENT_BINARY_DIR}/${srcdir}/${maintex}.tex + ${CMAKE_CURRENT_BINARY_DIR}/${maintex}.tex + ) + + add_latex_document( + ${srcdir}/main_${mode}.tex + INPUTS ${src} ${lst} ${sty} ${other_in} + # BIBFILES ${bib} + IMAGE_DIRS ${imgdirs} + # USE_BIBLATEX + # USE_GLOSSARY + ${latex_document_options} + ) + + if(NOT ${mode} STREQUAL genfigures) + set(synctex_file ${CMAKE_PROJECT_NAME}_${mode}.synctex.gz) + add_custom_target(pdf_${synctex_file} ${custom_command_options} + DEPENDS ${maintex}.pdf + COMMAND ${CMAKE_COMMAND} -E copy ${maintex}.synctex.gz pdf/${synctex_file} + ) + + set(pdf_file ${CMAKE_PROJECT_NAME}_${mode}.pdf) + add_custom_target(pdf_${pdf_file} ${custom_command_options} + DEPENDS ${maintex}.pdf + COMMAND ${CMAKE_COMMAND} -E copy ${maintex}.pdf pdf/${pdf_file} + ) + + add_custom_target(pdf_${CMAKE_PROJECT_NAME}_${mode} DEPENDS pdf_${synctex_file} pdf_${pdf_file}) + endif() + + set(latex_document_options EXCLUDE_FROM_ALL) + set(custom_command_options) +endforeach() diff --git a/README.md b/README.md new file mode 100644 index 0000000..6d97a43 --- /dev/null +++ b/README.md @@ -0,0 +1,101 @@ +# About + +Thesis title: using template metaprogramming to design active libraries for assisted parallelisation. + +(French: *application de la métaprogrammation template à la conception de bibliothèques actives +de parallélisation assitée*) + +## Download + +- [Slides](https://phd.pereda.fr/assets/thesis/alexis_pereda_defense.pdf). + +## Abstract + +
+Hardware performance has been increasing through the addition of computing cores rather than through +increasing their frequency since the early 2000s. +This means that parallel programming is no longer optional should you need to make the best use of +the hardware at your disposal. +Yet many programs are still written sequentially: parallel programming introduces numerous +difficulties. +Amongst these, it is notably hard to determine whether a sequence of a program can be executed in +parallel, i.e. preserving its behaviour as well as its overall result. +Even knowing that it is possible to parallelise a piece of code, doing it correctly is another +problem. +In this thesis, we present two approaches to make writing parallel software easier. + +We present an active library (using C++ template metaprogramming to operate during the compilation +process) whose purpose is to analyse and parallelise loops. +To do so, it builds a representation of each processed loop using expression templates through an +embedded language. +This allows to know which variables are used and how they are used. +For the case of arrays, which are common within loops, it also acquires the index functions. +The analysis of this information enables the library to identify which instructions in the loop can +be run in parallel. +Interdependent instructions are detected by knowing the variables and their access mode for each +instruction. +Given a group of interdependent instructions and the known index functions, the library decides if +the instructions can be run in parallel or not. +We want this library to help developers writing loops that will be automatically parallelised +whenever possible and run sequentially as without the library otherwise. +Another focus is to provide this to serve as a framework to integrate new methods for parallelising +programs and extended analysis rules. + +We introduce another active library that aims to help developers by assisting them in writing +parallel software instead of fully automating it. +This library uses algorithmic skeletons to let the developer describe its algorithms with both its +sequential and parallel parts by assembling atomic execution patterns such as a series of tasks or a +parallel execution of a repeated task. +This description includes the data flow, that is how parameters and function returns are +transmitted. +Usually, this is automatically set by the algorithmic skeleton library, however it gives the +developer greater flexibility and it makes it possible, amongst other things, for our library to +automatically transmit special parameters that must not be shared between parallel tasks. +One feature that this allows is to ensure repeatability from one execution to another even for +stochastic algorithms. +Considering the distribution of tasks on the different cores, we even reduce the number of these +non-shared parameters. +Once again, this library provides a framework at several levels. +Low-level extensions consist of the implementation of new execution patterns to be used to build +skeletons. +Another low-level axis is the integration of new execution policies that decide how tasks are +distributed on the available computing cores. +High-level additions will be libraries using ours to offer ready-to-use algorithmic skeletons for +various fields. +
+ +Keywords: template metaprogramming; assisted parallelisation; automatic parallelisation; active libraries; algorithmic skeletons; repeatability. + +## Related publications + +- "Repeatability with Random Numbers Using Algorithmic Skeletons", ESM 2020 (https://hal.archives-ouvertes.fr/hal-02980472); +- "Modeling Algorithmic Skeletons for Automatic Parallelization Using Template Metaprogramming", HPCS 2019 (IEEE) [10.1109/HPCS48598.2019.9188128](https://doi.org/10.1109/HPCS48598.2019.9188128); +- "Processing Algorithmic Skeletons at Compile-Time", ROADEF 2020 (https://hal.archives-ouvertes.fr/hal-02573660); +- "Algorithmic Skeletons Using Template Metaprogramming", ICAST 2019; +- "Parallel Algorithmic Skeletons for Metaheuristics", ROADEF 2019 (https://hal.archives-ouvertes.fr/hal-02059533); +- "Static Loop Parallelization Decision Using Template Metaprogramming", HPCS 2018 (IEEE) [10.1109/HPCS.2018.00159](https://doi.org/10.1109/HPCS.2018.00159). + +## Related projects + +- [AlSk](https://phd.pereda.fr/dev/alsk), an algorithmic skeletons active library; +- [pfor](https://phd.pereda.fr/dev/pfor), an automatic parallelisation active library; +- [ROSA](https://phd.pereda.fr/dev/rosa), an algorithmic skeletons collection for [OR](https://en.wikipedia.org/wiki/Operations_research) algorithms; +- [TMP](https://phd.pereda.fr/dev/tmp), template metaprogramming library used to implement this library. + +## Usage + +To produce the `Makefile`: +```bash +mkdir build +cd build +cmake .. +``` + +Compilation has been tested with `texlive-full` version 2020.20210202-3. + +To build the project: +``` +make +``` + +PDF files are generated in `build/pdf/`. diff --git a/UseLATEX.cmake b/UseLATEX.cmake new file mode 100644 index 0000000..bb1fd9e --- /dev/null +++ b/UseLATEX.cmake @@ -0,0 +1,2074 @@ +# File: UseLATEX.cmake +# CMAKE commands to actually use the LaTeX compiler +# Version: 2.7.0 +# Author: Kenneth Moreland +# +# Copyright 2004, 2015 Sandia Corporation. +# Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive +# license for use of this work by or on behalf of the U.S. Government. +# +# This software is released under the BSD 3-Clause License. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# +# The following function is defined: +# +# add_latex_document( +# [BIBFILES ] +# [INPUTS ] +# [IMAGE_DIRS ] +# [IMAGES ] +# [CONFIGURE ] +# [DEPENDS ] +# [MULTIBIB_NEWCITES ] +# [USE_BIBLATEX] +# [USE_INDEX] +# [INDEX_NAMES ] +# [USE_GLOSSARY] [USE_NOMENCL] +# [FORCE_PDF] [FORCE_DVI] [FORCE_HTML] +# [TARGET_NAME ] +# [INCLUDE_DIRECTORIES ] +# [EXCLUDE_FROM_ALL] +# [EXCLUDE_FROM_DEFAULTS]) +# Adds targets that compile . The latex output is placed +# in LATEX_OUTPUT_PATH or CMAKE_CURRENT_BINARY_DIR if the former is +# not set. The latex program is picky about where files are located, +# so all input files are copied from the source directory to the +# output directory. This includes the target tex file, any tex file +# listed with the INPUTS option, the bibliography files listed with +# the BIBFILES option, and any .cls, .bst, .clo, .sty, .ist, and .fd +# files found in the current source directory. Images found in the +# IMAGE_DIRS directories or listed by IMAGES are also copied to the +# output directory and converted to an appropriate format if necessary. +# Any tex files also listed with the CONFIGURE option are also processed +# with the CMake CONFIGURE_FILE command (with the @ONLY flag). Any file +# listed in CONFIGURE but not the target tex file or listed with INPUTS +# has no effect. DEPENDS can be used to specify generated files that are +# needed to compile the latex target. +# +# The following targets are made. The name prefix is based off of the +# base name of the tex file unless TARGET_NAME is specified. If +# TARGET_NAME is specified, then that name is used for the targets. +# +# name_dvi: Makes .dvi +# name_pdf: Makes .pdf using pdflatex. +# name_safepdf: Makes .pdf using ps2pdf. If using the +# default program arguments, this will ensure all fonts +# are embedded and no lossy compression has been +# performed on images. +# name_ps: Makes .ps +# name_html: Makes .html +# name_auxclean: Deletes .aux and other auxiliary files. +# This is sometimes necessary if a LaTeX error occurs +# and writes a bad aux file. Unlike the regular clean +# target, it does not delete other input files, such as +# converted images, to save time on the rebuild. +# +# Unless the EXCLUDE_FROM_ALL option is given, one of these targets +# is added to the ALL target and built by default. Which target is +# determined by the LATEX_DEFAULT_BUILD CMake variable. See the +# documentation of that variable for more details. +# +# Unless the EXCLUDE_FROM_DEFAULTS option is given, all these targets +# are added as dependencies to targets named dvi, pdf, safepdf, ps, +# html, and auxclean, respectively. +# +# USE_BIBLATEX enables the use of biblatex/biber as an alternative to +# bibtex. Bibtex remains the default if USE_BIBLATEX is not +# specified. +# +# If the argument USE_INDEX is given, then commands to build an index +# are made. If the argument INDEX_NAMES is given, an index file is +# generated for each name in this list. See the LaTeX package multind +# for more information about how to generate multiple indices. +# +# If the argument USE_GLOSSARY is given, then commands to +# build a glossary are made. If the argument MULTIBIB_NEWCITES is +# given, then additional bibtex calls are added to the build to +# support the extra auxiliary files created with the \newcite command +# in the multibib package. +# +# INCLUDE_DIRECTORIES provides a list of directories in which LaTeX +# should look for input files. It accepts both files relative to the +# binary directory and absolute paths. +# +# History: +# +# 2.7.0 Add INCLUDE_DIRECTORIES parameters. (Thanks to Eric Dönges.) +# +# 2.6.1 Fix issue with detecting long undefined reference warnings that +# LaTeX "helpfully" split across lines (and which fowled up our +# regex). +# +# 2.6.0 Skip image conversion targets that are not used when a force option +# is given. This helps prevent errors for missing conversion programs +# that are not needed. (Thanks to Martin Wetzel.) +# +# 2.5.0 Parse biber output for warnings. +# +# For regular bibtex, you get warnings about undefined references +# when you run latex. However, when using biber, biber itself prints +# out the said warning and latex sees nothing. Thus, when using biber +# the regular output is now suppressed and the log file is scanned +# for potential issues. +# +# 2.4.9 Use biblatex.cfg file if it exists and the USE_BIBLATEX option is ON. +# +# 2.4.8 Fix synctex issue with absolute paths not being converted. +# +# 2.4.7 Fix some issues with spaces in the path of the working directory where +# LaTeX is executed. +# +# 2.4.6 Fix parse issue with older versions of CMake. +# +# 2.4.5 Fix issues with files and paths containing spaces. +# +# 2.4.4 Improve error reporting message when LaTeX fails. +# +# When LaTeX fails, delete the output file, which is invalid. +# +# Add warnings for "missing characters." These usually mean that a +# non-ASCII character is in the document and will not be printed +# correctly. +# +# 2.4.3 Check for warnings from the natbib package. When using natbib, +# warnings for missing bibliography references look different. So +# far, natbib seems to be quiet unless something is important, so +# look for all natbib warnings. (We can change this later if +# necessary.) +# +# 2.4.2 Fix an issue where new versions of ImageMagick expect the order of +# options in command line execution of magick/convert. (See, for +# example, http://www.imagemagick.org/Usage/basics/#why.) +# +# 2.4.1 Add ability to dump LaTeX log file when using batch mode. Batch +# mode suppresses most output, often including error messages. To +# make sure critical error messages get displayed, show the full log +# on failures. +# +# 2.4.0 Remove "-r 600" from the default PDFTOPS_CONVERTER_FLAGS. The -r flag +# is available from the Poppler version of pdftops, but not the Xpdf +# version. +# +# Fix an issue with the flags for the different programs not being +# properly separated. +# +# Fix an issue on windows where the = character is not allowed for +# ps2pdf arguments. +# +# Change default arguments for latex and pdflatex commands. Makes the +# output more quiet and prints out the file/line where errors occur. +# (Thanks to Nikos Koukis.) +# +# After a LaTeX build, check the log file for warnings that are +# indicative of problems with the build. +# +# Remove support for latex2html. Instead, use the htlatex program. +# This is now part of TeX Live and most other distributions. It also +# behaves much more like the other LaTeX programs. Also fixed some +# nasty issues with the htlatex arguments. +# +# 2.3.2 Declare LaTeX input files as sources for targets so that they show +# up in IDEs like QtCreator. +# +# Fix issue where main tex files in subdirectories were creating +# invalid targets for building HTML. Just disable the HTML targets in +# this case. +# +# 2.3.1 Support use of magick command instead of convert command for +# ImageMagick 7. +# +# 2.3.0 Add USE_BIBLATEX option to support the biblatex package, which +# requires using the program biber as a replacement for bibtex +# (thanks to David Tracey). +# +# 2.2.1 Add STRINGS property to LATEX_DEFAULT_BUILD to make it easier to +# select the default build in the CMake GUI. +# +# 2.2.0 Add TARGET_NAME option. +# +# 2.1.1 Support for finding bmp, ppm, and other image files. +# +# 2.1.0 Fix an error where the pdf target and others were defined multiple +# times if UseLATEX.cmake was included multiple times. +# +# Added INDEX_NAMES option to support multiple indexes in a single +# document from the multind package (thanks to Dan Lipsa). +# +# 2.0.0 First major revision of UseLATEX.cmake updates to more recent features +# of CMake and some non-backward compatible changes. +# +# Changed all function and macro names to lower case. CMake's identifiers +# are case insensitive, but the convention moved from all upper case to +# all lower case somewhere around the release of CMake 2. (The original +# version of UseLATEX.cmake predates that.) +# +# Remove condition matching in if statements. They are no longer necessary +# and are even discouraged (because else clauses get confusing). +# +# Use "new" features available in CMake such as list and argument parsing. +# +# Remove some code that has been deprecated for a while. +# +# Mark variables for compiler and converter executables as advanced to +# match the more conventional CMake behavior. +# +# Changed how default builds are specified and add the ability to force +# a particular build. +# +# Made the base targets (pdf, dvi, etc.) global. add_latex_document +# always mangles its target names and these base targets depend on +# the targets with mangled names. +# +# 1.10.5 Fix for Window's convert check (thanks to Martin Baute). +# +# 1.10.4 Copy font files to binary directory for packages that come with +# their own fonts. +# +# 1.10.3 Check for Windows version of convert being used instead of +# ImageMagick's version (thanks to Martin Baute). +# +# 1.10.2 Use htlatex as a fallback when latex2html is not available (thanks +# to Tomasz Grzegurzko). +# +# 1.10.1 Make convert program mandatory only if actually used (thanks to +# Julien Schueller). +# +# 1.10.0 Added NO_DEFAULT and DEFAULT_PS options. +# Fixed issue with cleaning files for LaTeX documents originating in +# a subdirectory. +# +# 1.9.6 Fixed problem with LATEX_SMALL_IMAGES. +# Strengthened check to make sure the output directory does not contain +# the source files. +# +# 1.9.5 Add support for image types not directly supported by either latex +# or pdflatex. (Thanks to Jorge Gerardo Pena Pastor for SVG support.) +# +# 1.9.4 Fix issues with filenames containing multiple periods. +# +# 1.9.3 Hide some variables that are now cached but should not show up in +# the ccmake list of variables. +# +# 1.9.2 Changed MACRO declarations to FUNCTION declarations. The better +# FUNCTION scoping will hopefully avoid some common but subtle bugs. +# This implicitly increases the minimum CMake version to 4.6 (although +# I honestly only test it with the latest 4.8 version). +# +# Since we are updating the minimum CMake version, I'm going to start +# using the builtin LIST commands that are now available. +# +# Favor using pdftops from the Poppler package to convert from pdf to +# eps. It does a much better job than ImageMagick or ghostscript. +# +# 1.9.1 Fixed typo that caused the LATEX_SMALL_IMAGES option to fail to +# activate. +# +# 1.9.0 Add support for the multibib package (thanks to Antonio LaTorre). +# +# 1.8.2 Fix corner case when an argument name was also a variable containing +# the text of an argument. In this case, the CMake IF was matching +# the argument text with the contents of the variable with the same +# argument name. +# +# 1.8.1 Fix problem where ps2pdf was not getting the appropriate arguments. +# +# 1.8.0 Add support for synctex. +# +# 1.7.7 Support calling xindy when making glossaries. +# +# Improved make clean support. +# +# 1.7.6 Add support for the nomencl package (thanks to Myles English). +# +# 1.7.5 Fix issue with bibfiles being copied two different ways, which causes +# Problems with dependencies (thanks to Edwin van Leeuwen). +# +# 1.7.4 Added the DEFAULT_SAFEPDF option (thanks to Raymond Wan). +# +# Added warnings when image directories are not found (and were +# probably not given relative to the source directory). +# +# 1.7.3 Fix some issues with interactions between makeglossaries and bibtex +# (thanks to Mark de Wever). +# +# 1.7.2 Use ps2pdf to convert eps to pdf to get around the problem with +# ImageMagick dropping the bounding box (thanks to Lukasz Lis). +# +# 1.7.1 Fixed some dependency issues. +# +# 1.7.0 Added DEPENDS options (thanks to Theodore Papadopoulo). +# +# 1.6.1 Ported the makeglossaries command to CMake and embedded the port +# into UseLATEX.cmake. +# +# 1.6.0 Allow the use of the makeglossaries command. Thanks to Oystein +# S. Haaland for the patch. +# +# 1.5.0 Allow any type of file in the INPUTS lists, not just tex file +# (suggested by Eric Noulard). As a consequence, the ability to +# specify tex files without the .tex extension is removed. The removed +# function is of dubious value anyway. +# +# When copying input files, skip over any file that exists in the +# binary directory but does not exist in the source directory with the +# assumption that these files were added by some other mechanism. I +# find this useful when creating large documents with multiple +# chapters that I want to build separately (for speed) as I work on +# them. I use the same boilerplate as the starting point for all +# and just copy it with different configurations. This was what the +# separate ADD_LATEX_DOCUMENT method was supposed to originally be for. +# Since its external use is pretty much deprecated, I removed that +# documentation. +# +# 1.4.1 Copy .sty files along with the other class and package files. +# +# 1.4.0 Added a MANGLE_TARGET_NAMES option that will mangle the target names. +# +# Fixed problem with copying bib files that became apparent with +# CMake 2.4. +# +# 1.3.0 Added a LATEX_OUTPUT_PATH variable that allows you or the user to +# specify where the built latex documents to go. This is especially +# handy if you want to do in-source builds. +# +# Removed the ADD_LATEX_IMAGES macro and absorbed the functionality +# into ADD_LATEX_DOCUMENT. The old interface was always kind of +# clunky anyway since you had to specify the image directory in both +# places. It also made supporting LATEX_OUTPUT_PATH problematic. +# +# Added support for jpeg files. +# +# 1.2.0 Changed the configuration options yet again. Removed the NO_CONFIGURE +# Replaced it with a CONFIGURE option that lists input files for which +# configure should be run. +# +# The pdf target no longer depends on the dvi target. This allows you +# to build latex documents that require pdflatex. Also added an option +# to make the pdf target the default one. +# +# 1.1.1 Added the NO_CONFIGURE option. The @ character can be used when +# specifying table column separators. If two or more are used, then +# will incorrectly substitute them. +# +# 1.1.0 Added ability include multiple bib files. Added ability to do copy +# sub-tex files for multipart tex files. +# +# 1.0.0 If both ps and pdf type images exist, just copy the one that +# matches the current render mode. Replaced a bunch of STRING +# commands with GET_FILENAME_COMPONENT commands that were made to do +# the desired function. +# +# 0.4.0 First version posted to CMake Wiki. +# + +if(__USE_LATEX_INCLUDED) + return() +endif() +set(__USE_LATEX_INCLUDED TRUE) + +############################################################################# +# Find the location of myself while originally executing. If you do this +# inside of a macro, it will recode where the macro was invoked. +############################################################################# +set(LATEX_USE_LATEX_LOCATION ${CMAKE_CURRENT_LIST_FILE} + CACHE INTERNAL "Location of UseLATEX.cmake file." FORCE + ) + +############################################################################# +# Generic helper functions +############################################################################# + +include(CMakeParseArguments) + +function(latex_list_contains var value) + set(input_list ${ARGN}) + list(FIND input_list "${value}" index) + if(index GREATER -1) + set(${var} TRUE PARENT_SCOPE) + else() + set(${var} PARENT_SCOPE) + endif() +endfunction(latex_list_contains) + +# Match the contents of a file to a regular expression. +function(latex_file_match variable filename regexp default) + # The FILE STRINGS command would be a bit better, but I'm not totally sure + # the match will always be to a whole line, and I don't want to break things. + file(READ ${filename} file_contents) + string(REGEX MATCHALL "${regexp}" + match_result ${file_contents} + ) + if(match_result) + set(${variable} "${match_result}" PARENT_SCOPE) + else() + set(${variable} "${default}" PARENT_SCOPE) + endif() +endfunction(latex_file_match) + +# A version of GET_FILENAME_COMPONENT that treats extensions after the last +# period rather than the first. To the best of my knowledge, all filenames +# typically used by LaTeX, including image files, have small extensions +# after the last dot. +function(latex_get_filename_component varname filename type) + set(result) + if("${type}" STREQUAL "NAME_WE") + get_filename_component(name ${filename} NAME) + string(REGEX REPLACE "\\.[^.]*\$" "" result "${name}") + elseif("${type}" STREQUAL "EXT") + get_filename_component(name ${filename} NAME) + string(REGEX MATCH "\\.[^.]*\$" result "${name}") + else() + get_filename_component(result ${filename} ${type}) + endif() + set(${varname} "${result}" PARENT_SCOPE) +endfunction(latex_get_filename_component) + +############################################################################# +# Functions that perform processing during a LaTeX build. +############################################################################# +function(latex_execute_latex) + if(NOT LATEX_WORKING_DIRECTORY) + message(SEND_ERROR "Need to define LATEX_WORKING_DIRECTORY") + endif() + + if(NOT LATEX_FULL_COMMAND) + message(SEND_ERROR "Need to define LATEX_FULL_COMMAND") + endif() + + if(NOT LATEX_OUTPUT_FILE) + message(SEND_ERROR "Need to define LATEX_OUTPUT_FILE") + endif() + + if(NOT LATEX_LOG_FILE) + message(SEND_ERROR "Need to define LATEX_LOG_FILE") + endif() + + set(full_command_original "${LATEX_FULL_COMMAND}") + + # Chose the native method for parsing command arguments. Newer versions of + # CMake allow you to just use NATIVE_COMMAND. + if (CMAKE_VERSION VERSION_GREATER 3.8) + set(separate_arguments_mode NATIVE_COMMAND) + else() + if (WIN32) + set(separate_arguments_mode WINDOWS_COMMAND) + else() + set(separate_arguments_mode UNIX_COMMAND) + endif() + endif() + + # Preps variables for use in execute_process. + # Even though we expect LATEX_WORKING_DIRECTORY to have a single "argument," + # we also want to make sure that we strip out any escape characters that can + # foul up the WORKING_DIRECTORY argument. + separate_arguments(LATEX_FULL_COMMAND UNIX_COMMAND "${LATEX_FULL_COMMAND}") + separate_arguments(LATEX_WORKING_DIRECTORY_SEP UNIX_COMMAND "${LATEX_WORKING_DIRECTORY}") + + execute_process( + COMMAND ${LATEX_FULL_COMMAND} + WORKING_DIRECTORY "${LATEX_WORKING_DIRECTORY_SEP}" + RESULT_VARIABLE execute_result + OUTPUT_VARIABLE ignore + ERROR_VARIABLE ignore + ) + + if(NOT ${execute_result} EQUAL 0) + # LaTeX tends to write a file when a failure happens. Delete that file so + # that LaTeX will run again. + file(REMOVE "${LATEX_WORKING_DIRECTORY}/${LATEX_OUTPUT_FILE}") + + message("\n\nLaTeX command failed") + message("${full_command_original}") + message("Log output:") + file(READ "${LATEX_WORKING_DIRECTORY}/${LATEX_LOG_FILE}" log_output) + message("${log_output}") + message(FATAL_ERROR "Executed LaTeX, but LaTeX returned an error.") + endif() +endfunction(latex_execute_latex) + +function(latex_makeglossaries) + # This is really a bare bones port of the makeglossaries perl script into + # CMake scripting. + message("**************************** In makeglossaries") + if(NOT LATEX_TARGET) + message(SEND_ERROR "Need to define LATEX_TARGET") + endif() + + set(aux_file ${LATEX_TARGET}.aux) + + if(NOT EXISTS ${aux_file}) + message(SEND_ERROR "${aux_file} does not exist. Run latex on your target file.") + endif() + + latex_file_match(newglossary_lines ${aux_file} + "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" + "@newglossary{main}{glg}{gls}{glo}" + ) + + latex_file_match(istfile_line ${aux_file} + "@istfilename[ \t]*{([^}]*)}" + "@istfilename{${LATEX_TARGET}.ist}" + ) + string(REGEX REPLACE "@istfilename[ \t]*{([^}]*)}" "\\1" + istfile ${istfile_line} + ) + + string(REGEX MATCH ".*\\.xdy" use_xindy "${istfile}") + if(use_xindy) + message("*************** Using xindy") + if(NOT XINDY_COMPILER) + message(SEND_ERROR "Need to define XINDY_COMPILER") + endif() + else() + message("*************** Using makeindex") + if(NOT MAKEINDEX_COMPILER) + message(SEND_ERROR "Need to define MAKEINDEX_COMPILER") + endif() + endif() + + foreach(newglossary ${newglossary_lines}) + string(REGEX REPLACE + "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" + "\\1" glossary_name ${newglossary} + ) + string(REGEX REPLACE + "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" + "${LATEX_TARGET}.\\2" glossary_log ${newglossary} + ) + string(REGEX REPLACE + "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" + "${LATEX_TARGET}.\\3" glossary_out ${newglossary} + ) + string(REGEX REPLACE + "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" + "${LATEX_TARGET}.\\4" glossary_in ${newglossary} + ) + + if(use_xindy) + latex_file_match(xdylanguage_line ${aux_file} + "@xdylanguage[ \t]*{${glossary_name}}{([^}]*)}" + "@xdylanguage{${glossary_name}}{english}" + ) + string(REGEX REPLACE + "@xdylanguage[ \t]*{${glossary_name}}{([^}]*)}" + "\\1" + language + ${xdylanguage_line} + ) + # What crazy person makes a LaTeX index generator that uses different + # identifiers for language than babel (or at least does not support + # the old ones)? + if(${language} STREQUAL "frenchb") + set(language "french") + elseif(${language} MATCHES "^n?germanb?$") + set(language "german") + elseif(${language} STREQUAL "magyar") + set(language "hungarian") + elseif(${language} STREQUAL "lsorbian") + set(language "lower-sorbian") + elseif(${language} STREQUAL "norsk") + set(language "norwegian") + elseif(${language} STREQUAL "portuges") + set(language "portuguese") + elseif(${language} STREQUAL "russianb") + set(language "russian") + elseif(${language} STREQUAL "slovene") + set(language "slovenian") + elseif(${language} STREQUAL "ukraineb") + set(language "ukrainian") + elseif(${language} STREQUAL "usorbian") + set(language "upper-sorbian") + endif() + if(language) + set(language_flags "-L ${language}") + else() + set(language_flags "") + endif() + + latex_file_match(codepage_line ${aux_file} + "@gls@codepage[ \t]*{${glossary_name}}{([^}]*)}" + "@gls@codepage{${glossary_name}}{utf}" + ) + string(REGEX REPLACE + "@gls@codepage[ \t]*{${glossary_name}}{([^}]*)}" + "\\1" + codepage + ${codepage_line} + ) + if(codepage) + set(codepage_flags "-C ${codepage}") + else() + # Ideally, we would check that the language is compatible with the + # default codepage, but I'm hoping that distributions will be smart + # enough to specify their own codepage. I know, it's asking a lot. + set(codepage_flags "") + endif() + + message("${XINDY_COMPILER} ${MAKEGLOSSARIES_COMPILER_ARGS} ${language_flags} ${codepage_flags} -I xindy -M ${glossary_name} -t ${glossary_log} -o ${glossary_out} ${glossary_in}" + ) + exec_program(${XINDY_COMPILER} + ARGS ${MAKEGLOSSARIES_COMPILER_ARGS} + ${language_flags} + ${codepage_flags} + -I xindy + -M ${glossary_name} + -t ${glossary_log} + -o ${glossary_out} + ${glossary_in} + OUTPUT_VARIABLE xindy_output + ) + message("${xindy_output}") + + # So, it is possible (perhaps common?) for aux files to specify a + # language and codepage that are incompatible with each other. Check + # for that condition, and if it happens run again with the default + # codepage. + if("${xindy_output}" MATCHES "^Cannot locate xindy module for language (.+) in codepage (.+)\\.$") + message("*************** Retrying xindy with default codepage.") + exec_program(${XINDY_COMPILER} + ARGS ${MAKEGLOSSARIES_COMPILER_ARGS} + ${language_flags} + -I xindy + -M ${glossary_name} + -t ${glossary_log} + -o ${glossary_out} + ${glossary_in} + ) + endif() + + else() + message("${MAKEINDEX_COMPILER} ${MAKEGLOSSARIES_COMPILER_ARGS} -s ${istfile} -t ${glossary_log} -o ${glossary_out} ${glossary_in}") + exec_program(${MAKEINDEX_COMPILER} ARGS ${MAKEGLOSSARIES_COMPILER_ARGS} + -s ${istfile} -t ${glossary_log} -o ${glossary_out} ${glossary_in} + ) + endif() + + endforeach(newglossary) +endfunction(latex_makeglossaries) + +function(latex_makenomenclature) + message("**************************** In makenomenclature") + if(NOT LATEX_TARGET) + message(SEND_ERROR "Need to define LATEX_TARGET") + endif() + + if(NOT MAKEINDEX_COMPILER) + message(SEND_ERROR "Need to define MAKEINDEX_COMPILER") + endif() + + set(nomencl_out ${LATEX_TARGET}.nls) + set(nomencl_in ${LATEX_TARGET}.nlo) + + exec_program(${MAKEINDEX_COMPILER} ARGS ${MAKENOMENCLATURE_COMPILER_ARGS} + ${nomencl_in} -s "nomencl.ist" -o ${nomencl_out} + ) +endfunction(latex_makenomenclature) + +function(latex_correct_synctex) + message("**************************** In correct SyncTeX") + if(NOT LATEX_TARGET) + message(SEND_ERROR "Need to define LATEX_TARGET") + endif() + + if(NOT GZIP) + message(SEND_ERROR "Need to define GZIP") + endif() + + if(NOT LATEX_SOURCE_DIRECTORY) + message(SEND_ERROR "Need to define LATEX_SOURCE_DIRECTORY") + endif() + + if(NOT LATEX_BINARY_DIRECTORY) + message(SEND_ERROR "Need to define LATEX_BINARY_DIRECTORY") + endif() + message("${LATEX_BINARY_DIRECTORY}") + message("${LATEX_SOURCE_DIRECTORY}") + + set(synctex_file ${LATEX_BINARY_DIRECTORY}/${LATEX_TARGET}.synctex) + set(synctex_file_gz ${synctex_file}.gz) + + if(EXISTS ${synctex_file_gz}) + + message("Making backup of synctex file.") + configure_file(${synctex_file_gz} ${synctex_file}.bak.gz COPYONLY) + + message("Uncompressing synctex file.") + exec_program(${GZIP} + ARGS --decompress ${synctex_file_gz} + ) + + message("Reading synctex file.") + file(READ ${synctex_file} synctex_data) + + message("Replacing output paths with input paths.") + foreach(extension tex cls bst clo sty ist fd) + # Relative paths + string(REGEX REPLACE + "(Input:[0-9]+:)([^/\n][^\n]\\.${extension}*)" + "\\1${LATEX_SOURCE_DIRECTORY}/\\2" + synctex_data + "${synctex_data}" + ) + + # Absolute paths + string(REGEX REPLACE + "(Input:[0-9]+:)${LATEX_BINARY_DIRECTORY}([^\n]*\\.${extension})" + "\\1${LATEX_SOURCE_DIRECTORY}\\2" + synctex_data + "${synctex_data}" + ) + endforeach(extension) + + message("Writing synctex file.") + file(WRITE ${synctex_file} "${synctex_data}") + + message("Compressing synctex file.") + exec_program(${GZIP} + ARGS ${synctex_file} + ) + + else() + + message(SEND_ERROR "File ${synctex_file_gz} not found. Perhaps synctex is not supported by your LaTeX compiler.") + + endif() + +endfunction(latex_correct_synctex) + +function(latex_check_important_warnings) + # Check for biber warnings/errors if that was run + set(bib_log_file ${LATEX_TARGET}.blg) + if(EXISTS ${bib_log_file}) + file(READ ${bib_log_file} bib_log) + if(bib_log MATCHES "INFO - This is Biber") + message("\nChecking ${bib_log_file} for Biber warnings/errors.") + + string(REGEX MATCHALL + "[A-Z]+ - [^\n]*" + biber_messages + "${bib_log}") + + set(found_error) + foreach(message ${biber_messages}) + if(NOT message MATCHES "^INFO - ") + set(found_error TRUE) + message("${message}") + endif() + endforeach(message) + + if(found_error) + latex_get_filename_component(log_file_path ${bib_log_file} ABSOLUTE) + message("\nConsult ${log_file_path} for more information on Biber output.") + else() + message("No known important Biber output found.") + endif(found_error) + else() # Biber output not in log file + message("Skipping biber checks (biber not used)") + endif() + else() # No bib log file + message("Skipping bibliography checks (not run)") + endif() + + set(log_file ${LATEX_TARGET}.log) + + message("\nChecking ${log_file} for important warnings.") + if(NOT LATEX_TARGET) + message(SEND_ERROR "Need to define LATEX_TARGET") + endif() + + if(NOT EXISTS ${log_file}) + message("Could not find log file: ${log_file}") + return() + endif() + + set(found_error) + + file(READ ${log_file} log) + + # Check for declared LaTeX warnings + string(REGEX MATCHALL + "\nLaTeX Warning:[^\n]*" + latex_warnings + "${log}") + if(latex_warnings) + set(found_error TRUE) + message("\nFound declared LaTeX warnings.") + foreach(warning ${latex_warnings}) + string(STRIP "${warning}" warning_no_newline) + message("${warning_no_newline}") + endforeach(warning) + endif() + + # Check for natbib warnings + string(REGEX MATCHALL + "\nPackage natbib Warning:[^\n]*" + natbib_warnings + "${log}") + if(natbib_warnings) + set(found_error TRUE) + message("\nFound natbib package warnings.") + foreach(warning ${natbib_warnings}) + string(STRIP "${warning}" warning_no_newline) + message("${warning_no_newline}") + endforeach(warning) + endif() + + # Check for overfull + string(REGEX MATCHALL + "\nOverfull[^\n]*" + overfull_warnings + "${log}") + if(overfull_warnings) + set(found_error TRUE) + message("\nFound overfull warnings. These are indicative of layout errors.") + foreach(warning ${overfull_warnings}) + string(STRIP "${warning}" warning_no_newline) + message("${warning_no_newline}") + endforeach(warning) + endif() + + # Check for invalid characters + string(REGEX MATCHALL + "\nMissing character:[^\n]*" + invalid_character_warnings + "${log}") + if(invalid_character_warnings) + set(found_error TRUE) + message("\nFound invalid character warnings. These characters are likely not printed correctly.") + foreach(warning ${invalid_character_warnings}) + string(STRIP "${warning}" warning_no_newline) + message("${warning_no_newline}") + endforeach(warning) + endif() + + if(found_error) + latex_get_filename_component(log_file_path ${log_file} ABSOLUTE) + message("\nConsult ${log_file_path} for more information on LaTeX build.") + else() + message("No known important warnings found.") + endif(found_error) +endfunction(latex_check_important_warnings) + +############################################################################# +# Helper functions for establishing LaTeX build. +############################################################################# + +function(latex_needit VAR NAME) + if(NOT ${VAR}) + message(SEND_ERROR "I need the ${NAME} command.") + endif() +endfunction(latex_needit) + +function(latex_wantit VAR NAME) + if(NOT ${VAR}) + message(STATUS "I could not find the ${NAME} command.") + endif() +endfunction(latex_wantit) + +function(latex_setup_variables) + set(LATEX_OUTPUT_PATH "${LATEX_OUTPUT_PATH}" + CACHE PATH "If non empty, specifies the location to place LaTeX output." + ) + + find_package(LATEX) + + find_program(XINDY_COMPILER + NAME xindy + PATHS ${MIKTEX_BINARY_PATH} /usr/bin + ) + + find_package(UnixCommands) + + find_program(PDFTOPS_CONVERTER + NAMES pdftops + DOC "The pdf to ps converter program from the Poppler package." + ) + + find_program(HTLATEX_COMPILER + NAMES htlatex + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin + ) + + mark_as_advanced( + LATEX_COMPILER + PDFLATEX_COMPILER + BIBTEX_COMPILER + BIBER_COMPILER + MAKEINDEX_COMPILER + XINDY_COMPILER + DVIPS_CONVERTER + PS2PDF_CONVERTER + PDFTOPS_CONVERTER + LATEX2HTML_CONVERTER + HTLATEX_COMPILER + ) + + latex_needit(LATEX_COMPILER latex) + latex_wantit(PDFLATEX_COMPILER pdflatex) + latex_wantit(HTLATEX_COMPILER htlatex) + latex_needit(BIBTEX_COMPILER bibtex) + latex_wantit(BIBER_COMPILER biber) + latex_needit(MAKEINDEX_COMPILER makeindex) + latex_wantit(DVIPS_CONVERTER dvips) + latex_wantit(PS2PDF_CONVERTER ps2pdf) + latex_wantit(PDFTOPS_CONVERTER pdftops) + + set(LATEX_COMPILER_FLAGS "-interaction=batchmode -file-line-error" + CACHE STRING "Flags passed to latex.") + set(PDFLATEX_COMPILER_FLAGS ${LATEX_COMPILER_FLAGS} + CACHE STRING "Flags passed to pdflatex.") + set(HTLATEX_COMPILER_TEX4HT_FLAGS "html" + CACHE STRING "Options for the tex4ht.sty and *.4ht style files.") + set(HTLATEX_COMPILER_TEX4HT_POSTPROCESSOR_FLAGS "" + CACHE STRING "Options for the text4ht postprocessor.") + set(HTLATEX_COMPILER_T4HT_POSTPROCESSOR_FLAGS "" + CACHE STRING "Options for the t4ht postprocessor.") + set(HTLATEX_COMPILER_LATEX_FLAGS ${LATEX_COMPILER_FLAGS} + CACHE STRING "Flags passed from htlatex to the LaTeX compiler.") + set(LATEX_SYNCTEX_FLAGS "-synctex=1" + CACHE STRING "latex/pdflatex flags used to create synctex file.") + set(BIBTEX_COMPILER_FLAGS "" + CACHE STRING "Flags passed to bibtex.") + set(BIBER_COMPILER_FLAGS "" + CACHE STRING "Flags passed to biber.") + set(MAKEINDEX_COMPILER_FLAGS "" + CACHE STRING "Flags passed to makeindex.") + set(MAKEGLOSSARIES_COMPILER_FLAGS "" + CACHE STRING "Flags passed to makeglossaries.") + set(MAKENOMENCLATURE_COMPILER_FLAGS "" + CACHE STRING "Flags passed to makenomenclature.") + set(DVIPS_CONVERTER_FLAGS "-Ppdf -G0 -t letter" + CACHE STRING "Flags passed to dvips.") + if(NOT WIN32) + set(PS2PDF_CONVERTER_FLAGS "-dMaxSubsetPct=100 -dCompatibilityLevel=1.3 -dSubsetFonts=true -dEmbedAllFonts=true -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dMonoImageFilter=/FlateEncode" + CACHE STRING "Flags passed to ps2pdf.") + else() + # Most windows ports of ghostscript utilities use .bat files for ps2pdf + # commands. bat scripts interpret "=" as a special character and separate + # those arguments. To get around this, the ghostscript utilities also + # support using "#" in place of "=". + set(PS2PDF_CONVERTER_FLAGS "-dMaxSubsetPct#100 -dCompatibilityLevel#1.3 -dSubsetFonts#true -dEmbedAllFonts#true -dAutoFilterColorImages#false -dAutoFilterGrayImages#false -dColorImageFilter#/FlateEncode -dGrayImageFilter#/FlateEncode -dMonoImageFilter#/FlateEncode" + CACHE STRING "Flags passed to ps2pdf.") + endif() + set(PDFTOPS_CONVERTER_FLAGS "" + CACHE STRING "Flags passed to pdftops.") + mark_as_advanced( + LATEX_COMPILER_FLAGS + PDFLATEX_COMPILER_FLAGS + HTLATEX_COMPILER_TEX4HT_FLAGS + HTLATEX_COMPILER_TEX4HT_POSTPROCESSOR_FLAGS + HTLATEX_COMPILER_T4HT_POSTPROCESSOR_FLAGS + HTLATEX_COMPILER_LATEX_FLAGS + LATEX_SYNCTEX_FLAGS + BIBTEX_COMPILER_FLAGS + BIBER_COMPILER_FLAGS + MAKEINDEX_COMPILER_FLAGS + MAKEGLOSSARIES_COMPILER_FLAGS + MAKENOMENCLATURE_COMPILER_FLAGS + DVIPS_CONVERTER_FLAGS + PS2PDF_CONVERTER_FLAGS + PDFTOPS_CONVERTER_FLAGS + ) + + # Because it is easier to type, the flags variables are entered as + # space-separated strings much like you would in a shell. However, when + # using a CMake command to execute a program, it works better to hold the + # arguments in semicolon-separated lists (otherwise the whole string will + # be interpreted as a single argument). Use the separate_arguments to + # convert the space-separated strings to semicolon-separated lists. + separate_arguments(LATEX_COMPILER_FLAGS) + separate_arguments(PDFLATEX_COMPILER_FLAGS) + separate_arguments(HTLATEX_COMPILER_LATEX_FLAGS) + separate_arguments(LATEX_SYNCTEX_FLAGS) + separate_arguments(BIBTEX_COMPILER_FLAGS) + separate_arguments(BIBER_COMPILER_FLAGS) + separate_arguments(MAKEINDEX_COMPILER_FLAGS) + separate_arguments(MAKEGLOSSARIES_COMPILER_FLAGS) + separate_arguments(MAKENOMENCLATURE_COMPILER_FLAGS) + separate_arguments(DVIPS_CONVERTER_FLAGS) + separate_arguments(PS2PDF_CONVERTER_FLAGS) + separate_arguments(PDFTOPS_CONVERTER_FLAGS) + + # Not quite done. When you call separate_arguments on a cache variable, + # the result is written to a local variable. That local variable goes + # away when this function returns (which is before any of them are used). + # So, copy these variables with local scope to cache variables with + # global scope. + set(LATEX_COMPILER_ARGS "${LATEX_COMPILER_FLAGS}" CACHE INTERNAL "") + set(PDFLATEX_COMPILER_ARGS "${PDFLATEX_COMPILER_FLAGS}" CACHE INTERNAL "") + set(HTLATEX_COMPILER_ARGS "${HTLATEX_COMPILER_LATEX_FLAGS}" CACHE INTERNAL "") + set(LATEX_SYNCTEX_ARGS "${LATEX_SYNCTEX_FLAGS}" CACHE INTERNAL "") + set(BIBTEX_COMPILER_ARGS "${BIBTEX_COMPILER_FLAGS}" CACHE INTERNAL "") + set(BIBER_COMPILER_ARGS "${BIBER_COMPILER_FLAGS}" CACHE INTERNAL "") + set(MAKEINDEX_COMPILER_ARGS "${MAKEINDEX_COMPILER_FLAGS}" CACHE INTERNAL "") + set(MAKEGLOSSARIES_COMPILER_ARGS "${MAKEGLOSSARIES_COMPILER_FLAGS}" CACHE INTERNAL "") + set(MAKENOMENCLATURE_COMPILER_ARGS "${MAKENOMENCLATURE_COMPILER_FLAGS}" CACHE INTERNAL "") + set(DVIPS_CONVERTER_ARGS "${DVIPS_CONVERTER_FLAGS}" CACHE INTERNAL "") + set(PS2PDF_CONVERTER_ARGS "${PS2PDF_CONVERTER_FLAGS}" CACHE INTERNAL "") + set(PDFTOPS_CONVERTER_ARGS "${PDFTOPS_CONVERTER_FLAGS}" CACHE INTERNAL "") + + find_program(IMAGEMAGICK_CONVERT + NAMES magick convert + DOC "The convert program that comes with ImageMagick (available at http://www.imagemagick.org)." + ) + mark_as_advanced(IMAGEMAGICK_CONVERT) + + if(DEFINED ENV{LATEX_DEFAULT_BUILD}) + set(default_build $ENV{LATEX_DEFAULT_BUILD}) + else() + set(default_build pdf) + endif() + + set(LATEX_DEFAULT_BUILD "${default_build}" CACHE STRING + "Choose the default type of LaTeX build. Valid options are pdf, dvi, ps, safepdf, html" + ) + set_property(CACHE LATEX_DEFAULT_BUILD + PROPERTY STRINGS pdf dvi ps safepdf html + ) + + option(LATEX_USE_SYNCTEX + "If on, have LaTeX generate a synctex file, which WYSIWYG editors can use to correlate output files like dvi and pdf with the lines of LaTeX source that generates them. In addition to adding the LATEX_SYNCTEX_FLAGS to the command line, this option also adds build commands that \"corrects\" the resulting synctex file to point to the original LaTeX files rather than those generated by UseLATEX.cmake." + OFF + ) + + option(LATEX_SMALL_IMAGES + "If on, the raster images will be converted to 1/6 the original size. This is because papers usually require 600 dpi images whereas most monitors only require at most 96 dpi. Thus, smaller images make smaller files for web distribution and can make it faster to read dvi files." + OFF) + if(LATEX_SMALL_IMAGES) + set(LATEX_RASTER_SCALE 16 PARENT_SCOPE) + set(LATEX_OPPOSITE_RASTER_SCALE 100 PARENT_SCOPE) + else() + set(LATEX_RASTER_SCALE 100 PARENT_SCOPE) + set(LATEX_OPPOSITE_RASTER_SCALE 16 PARENT_SCOPE) + endif() + + # Just holds extensions for known image types. They should all be lower case. + # For historical reasons, these are all declared in the global scope. + set(LATEX_DVI_VECTOR_IMAGE_EXTENSIONS .eps CACHE INTERNAL "") + set(LATEX_DVI_RASTER_IMAGE_EXTENSIONS CACHE INTERNAL "") + set(LATEX_DVI_IMAGE_EXTENSIONS + ${LATEX_DVI_VECTOR_IMAGE_EXTENSIONS} + ${LATEX_DVI_RASTER_IMAGE_EXTENSIONS} + CACHE INTERNAL "" + ) + + set(LATEX_PDF_VECTOR_IMAGE_EXTENSIONS .pdf CACHE INTERNAL "") + set(LATEX_PDF_RASTER_IMAGE_EXTENSIONS .jpeg .jpg .png CACHE INTERNAL "") + set(LATEX_PDF_IMAGE_EXTENSIONS + ${LATEX_PDF_VECTOR_IMAGE_EXTENSIONS} + ${LATEX_PDF_RASTER_IMAGE_EXTENSIONS} + CACHE INTERNAL "" + ) + + set(LATEX_OTHER_VECTOR_IMAGE_EXTENSIONS .ai .dot .svg CACHE INTERNAL "") + set(LATEX_OTHER_RASTER_IMAGE_EXTENSIONS + .bmp .bmp2 .bmp3 .dcm .dcx .ico .gif .pict .ppm .tif .tiff + CACHE INTERNAL "") + set(LATEX_OTHER_IMAGE_EXTENSIONS + ${LATEX_OTHER_VECTOR_IMAGE_EXTENSIONS} + ${LATEX_OTHER_RASTER_IMAGE_EXTENSIONS} + CACHE INTERNAL "" + ) + + set(LATEX_VECTOR_IMAGE_EXTENSIONS + ${LATEX_DVI_VECTOR_IMAGE_EXTENSIONS} + ${LATEX_PDF_VECTOR_IMAGE_EXTENSIONS} + ${LATEX_OTHER_VECTOR_IMAGE_EXTENSIONS} + CACHE INTERNAL "" + ) + set(LATEX_RASTER_IMAGE_EXTENSIONS + ${LATEX_DVI_RASTER_IMAGE_EXTENSIONS} + ${LATEX_PDF_RASTER_IMAGE_EXTENSIONS} + ${LATEX_OTHER_RASTER_IMAGE_EXTENSIONS} + CACHE INTERNAL "" + ) + set(LATEX_IMAGE_EXTENSIONS + ${LATEX_DVI_IMAGE_EXTENSIONS} + ${LATEX_PDF_IMAGE_EXTENSIONS} + ${LATEX_OTHER_IMAGE_EXTENSIONS} + CACHE INTERNAL "" + ) +endfunction(latex_setup_variables) + +function(latex_setup_targets) + if(NOT TARGET pdf) + add_custom_target(pdf) + endif() + if(NOT TARGET dvi) + add_custom_target(dvi) + endif() + if(NOT TARGET ps) + add_custom_target(ps) + endif() + if(NOT TARGET safepdf) + add_custom_target(safepdf) + endif() + if(NOT TARGET html) + add_custom_target(html) + endif() + if(NOT TARGET auxclean) + add_custom_target(auxclean) + endif() +endfunction(latex_setup_targets) + +function(latex_get_output_path var) + set(latex_output_path) + if(LATEX_OUTPUT_PATH) + get_filename_component( + LATEX_OUTPUT_PATH_FULL "${LATEX_OUTPUT_PATH}" ABSOLUTE + ) + if("${LATEX_OUTPUT_PATH_FULL}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + message(SEND_ERROR "You cannot set LATEX_OUTPUT_PATH to the same directory that contains LaTeX input files.") + else() + set(latex_output_path "${LATEX_OUTPUT_PATH_FULL}") + endif() + else() + if("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + message(SEND_ERROR "LaTeX files must be built out of source or you must set LATEX_OUTPUT_PATH.") + else() + set(latex_output_path "${CMAKE_CURRENT_BINARY_DIR}") + endif() + endif() + set(${var} ${latex_output_path} PARENT_SCOPE) +endfunction(latex_get_output_path) + +function(latex_add_convert_command + output_path + input_path + output_extension + input_extension + flags + ) + set(require_imagemagick_convert TRUE) + set(convert_flags "") + if(${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf") + # ImageMagick has broken eps to pdf conversion + # use ps2pdf instead + if(PS2PDF_CONVERTER) + set(require_imagemagick_convert FALSE) + set(converter ${PS2PDF_CONVERTER}) + set(convert_flags -dEPSCrop ${PS2PDF_CONVERTER_ARGS}) + else() + message(SEND_ERROR "Using postscript files with pdflatex requires ps2pdf for conversion.") + endif() + elseif(${input_extension} STREQUAL ".pdf" AND ${output_extension} STREQUAL ".eps") + # ImageMagick can also be sketchy on pdf to eps conversion. Not good with + # color spaces and tends to unnecessarily rasterize. + # use pdftops instead + if(PDFTOPS_CONVERTER) + set(require_imagemagick_convert FALSE) + set(converter ${PDFTOPS_CONVERTER}) + set(convert_flags -eps ${PDFTOPS_CONVERTER_ARGS}) + else() + message(STATUS "Consider getting pdftops from Poppler to convert PDF images to EPS images.") + set(convert_flags ${flags}) + endif() + else() + set(convert_flags ${flags}) + endif() + + if(require_imagemagick_convert) + if(IMAGEMAGICK_CONVERT) + string(TOLOWER ${IMAGEMAGICK_CONVERT} IMAGEMAGICK_CONVERT_LOWERCASE) + if(${IMAGEMAGICK_CONVERT_LOWERCASE} MATCHES "system32[/\\\\]convert\\.exe") + message(SEND_ERROR "IMAGEMAGICK_CONVERT set to Window's convert.exe for changing file systems rather than ImageMagick's convert for changing image formats. Please make sure ImageMagick is installed (available at http://www.imagemagick.org). If you have a recent version of ImageMagick (7.0 or higher), use the magick program instead of convert for IMAGEMAGICK_CONVERT.") + else() + set(converter ${IMAGEMAGICK_CONVERT}) + # ImageMagick requires a special order of arguments where resize and + # arguments of that nature must be placed after the input image path. + add_custom_command(OUTPUT ${output_path} + COMMAND ${converter} + ARGS ${input_path} ${convert_flags} ${output_path} + DEPENDS ${input_path} + ) + endif() + else() + message(SEND_ERROR "Could not find convert program. Please download ImageMagick from http://www.imagemagick.org and install.") + endif() + else() # Not ImageMagick convert + add_custom_command(OUTPUT ${output_path} + COMMAND ${converter} + ARGS ${convert_flags} ${input_path} ${output_path} + DEPENDS ${input_path} + ) + endif() +endfunction(latex_add_convert_command) + +# Makes custom commands to convert a file to a particular type. +function(latex_convert_image + output_files_var + input_file + output_extension + convert_flags + output_extensions + other_files + ) + set(output_file_list) + set(input_dir ${CMAKE_CURRENT_SOURCE_DIR}) + latex_get_output_path(output_dir) + + latex_get_filename_component(extension "${input_file}" EXT) + + # Check input filename for potential problems with LaTeX. + latex_get_filename_component(name "${input_file}" NAME_WE) + set(suggested_name "${name}") + if(suggested_name MATCHES ".*\\..*") + string(REPLACE "." "-" suggested_name "${suggested_name}") + endif() + if(suggested_name MATCHES ".* .*") + string(REPLACE " " "-" suggested_name "${suggested_name}") + endif() + if(NOT suggested_name STREQUAL name) + message(WARNING "Some LaTeX distributions have problems with image file names with multiple extensions or spaces. Consider changing ${name}${extension} to something like ${suggested_name}${extension}.") + endif() + + string(REGEX REPLACE "\\.[^.]*\$" ${output_extension} output_file + "${input_file}") + + latex_list_contains(is_type ${extension} ${output_extensions}) + if(is_type) + if(convert_flags) + latex_add_convert_command(${output_dir}/${output_file} + ${input_dir}/${input_file} ${output_extension} ${extension} + "${convert_flags}") + set(output_file_list ${output_dir}/${output_file}) + else() + # As a shortcut, we can just copy the file. + add_custom_command(OUTPUT ${output_dir}/${input_file} + COMMAND ${CMAKE_COMMAND} + ARGS -E copy ${input_dir}/${input_file} ${output_dir}/${input_file} + DEPENDS ${input_dir}/${input_file} + ) + set(output_file_list ${output_dir}/${input_file}) + endif() + else() + set(do_convert TRUE) + # Check to see if there is another input file of the appropriate type. + foreach(valid_extension ${output_extensions}) + string(REGEX REPLACE "\\.[^.]*\$" ${output_extension} try_file + "${input_file}") + latex_list_contains(has_native_file "${try_file}" ${other_files}) + if(has_native_file) + set(do_convert FALSE) + endif() + endforeach(valid_extension) + + # If we still need to convert, do it. + if(do_convert) + latex_add_convert_command(${output_dir}/${output_file} + ${input_dir}/${input_file} ${output_extension} ${extension} + "${convert_flags}") + set(output_file_list ${output_dir}/${output_file}) + endif() + endif() + + set(${output_files_var} ${output_file_list} PARENT_SCOPE) +endfunction(latex_convert_image) + +# Adds custom commands to process the given files for dvi and pdf builds. +# Adds the output files to the given variables (does not replace). +function(latex_process_images dvi_outputs_var pdf_outputs_var) + latex_get_output_path(output_dir) + set(dvi_outputs) + set(pdf_outputs) + foreach(file ${ARGN}) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + latex_get_filename_component(extension "${file}" EXT) + set(convert_flags) + + # Check to see if we need to downsample the image. + latex_list_contains(is_raster "${extension}" + ${LATEX_RASTER_IMAGE_EXTENSIONS}) + if(LATEX_SMALL_IMAGES) + if(is_raster) + set(convert_flags -resize ${LATEX_RASTER_SCALE}%) + endif() + endif() + + # Make sure the output directory exists. + latex_get_filename_component(path "${output_dir}/${file}" PATH) + make_directory("${path}") + + # Do conversions for dvi. + if(NOT LATEX_FORCE_PDF) + latex_convert_image(output_files "${file}" .eps "${convert_flags}" + "${LATEX_DVI_IMAGE_EXTENSIONS}" "${ARGN}") + list(APPEND dvi_outputs ${output_files}) + endif () + + # Do conversions for pdf. + if(NOT LATEX_FORCE_DVI AND NOT LATEX_FORCE_HTML) + if(is_raster) + latex_convert_image(output_files "${file}" .png "${convert_flags}" + "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}") + list(APPEND pdf_outputs ${output_files}) + else() + latex_convert_image(output_files "${file}" .pdf "${convert_flags}" + "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}") + list(APPEND pdf_outputs ${output_files}) + endif() + endif() + else() + message(WARNING "Could not find file ${CMAKE_CURRENT_SOURCE_DIR}/${file}. Are you sure you gave relative paths to IMAGES?") + endif() + endforeach(file) + + set(${dvi_outputs_var} ${dvi_outputs} PARENT_SCOPE) + set(${pdf_outputs_var} ${pdf_outputs} PARENT_SCOPE) +endfunction(latex_process_images) + +function(latex_copy_globbed_files pattern dest) + file(GLOB file_list ${pattern}) + foreach(in_file ${file_list}) + latex_get_filename_component(out_file ${in_file} NAME) + configure_file(${in_file} ${dest}/${out_file} COPYONLY) + endforeach(in_file) +endfunction(latex_copy_globbed_files) + +function(latex_copy_input_file file) + latex_get_output_path(output_dir) + + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + latex_get_filename_component(path ${file} PATH) + file(MAKE_DIRECTORY ${output_dir}/${path}) + + latex_list_contains(use_config ${file} ${LATEX_CONFIGURE}) + if(use_config) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${file} + ${output_dir}/${file} + @ONLY + ) + add_custom_command(OUTPUT ${output_dir}/${file} + COMMAND ${CMAKE_COMMAND} + ARGS ${CMAKE_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} + ) + else() + add_custom_command(OUTPUT ${output_dir}/${file} + COMMAND ${CMAKE_COMMAND} + ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${output_dir}/${file} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} + ) + endif() + else() + if(EXISTS ${output_dir}/${file}) + # Special case: output exists but input does not. Assume that it was + # created elsewhere and skip the input file copy. + else() + message("Could not find input file ${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif() + endif() +endfunction(latex_copy_input_file) + +############################################################################# +# Commands provided by the UseLATEX.cmake "package" +############################################################################# + +function(latex_usage command message) + message(SEND_ERROR + "${message}\n Usage: ${command}(\n [BIBFILES ...]\n [INPUTS ...]\n [IMAGE_DIRS ...]\n [IMAGES \n [CONFIGURE ...]\n [DEPENDS ...]\n [MULTIBIB_NEWCITES] \n [USE_BIBLATEX] [USE_INDEX] [USE_GLOSSARY] [USE_NOMENCL]\n [FORCE_PDF] [FORCE_DVI] [FORCE_HTML]\n [TARGET_NAME] \n [EXCLUDE_FROM_ALL]\n [EXCLUDE_FROM_DEFAULTS])" + ) +endfunction(latex_usage command message) + +# Parses arguments to add_latex_document and ADD_LATEX_TARGETS and sets the +# variables LATEX_TARGET, LATEX_IMAGE_DIR, LATEX_BIBFILES, LATEX_DEPENDS, and +# LATEX_INPUTS. +function(parse_add_latex_arguments command latex_main_input) + set(options + USE_BIBLATEX + USE_INDEX + USE_GLOSSARY + USE_NOMENCL + FORCE_PDF + FORCE_DVI + FORCE_HTML + EXCLUDE_FROM_ALL + EXCLUDE_FROM_DEFAULTS + # Deprecated options + USE_GLOSSARIES + DEFAULT_PDF + DEFAULT_SAFEPDF + DEFAULT_PS + NO_DEFAULT + MANGLE_TARGET_NAMES + ) + set(oneValueArgs + TARGET_NAME + ) + set(multiValueArgs + BIBFILES + MULTIBIB_NEWCITES + INPUTS + IMAGE_DIRS + IMAGES + CONFIGURE + DEPENDS + INDEX_NAMES + INCLUDE_DIRECTORIES + ) + cmake_parse_arguments( + LATEX "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + # Handle invalid and deprecated arguments + if(LATEX_UNPARSED_ARGUMENTS) + latex_usage(${command} "Invalid or deprecated arguments: ${LATEX_UNPARSED_ARGUMENTS}") + endif() + if(LATEX_USE_GLOSSARIES) + latex_usage(${command} "USE_GLOSSARIES option removed in version 1.6.1. Use USE_GLOSSARY instead.") + endif() + if(LATEX_DEFAULT_PDF) + latex_usage(${command} "DEFAULT_PDF option removed in version 2.0. Use FORCE_PDF option or LATEX_DEFAULT_BUILD CMake variable instead.") + endif() + if(LATEX_DEFAULT_SAFEPDF) + latex_usage(${command} "DEFAULT_SAFEPDF option removed in version 2.0. Use LATEX_DEFAULT_BUILD CMake variable instead.") + endif() + if(LATEX_DEFAULT_DVI) + latex_usage(${command} "DEFAULT_DVI option removed in version 2.0. Use FORCE_DVI option or LATEX_DEFAULT_BUILD CMake variable instead.") + endif() + if(LATEX_NO_DEFAULT) + latex_usage(${command} "NO_DEFAULT option removed in version 2.0. Use EXCLUDE_FROM_ALL instead.") + endif() + if(LATEX_MANGLE_TARGET_NAMES) + latex_usage(${command} "MANGLE_TARGET_NAMES option removed in version 2.0. All LaTeX targets use mangled names now.") + endif() + + # Capture the first argument, which is the main LaTeX input. + latex_get_filename_component(latex_target ${latex_main_input} NAME_WE) + set(LATEX_MAIN_INPUT ${latex_main_input} PARENT_SCOPE) + set(LATEX_TARGET ${latex_target} PARENT_SCOPE) + + # Propagate the result variables to the caller + foreach(arg_name ${options} ${oneValueArgs} ${multiValueArgs}) + set(var_name LATEX_${arg_name}) + set(${var_name} ${${var_name}} PARENT_SCOPE) + endforeach(arg_name) +endfunction(parse_add_latex_arguments) + +function(add_latex_targets_internal) + latex_get_output_path(output_dir) + + if(LATEX_USE_SYNCTEX) + set(synctex_flags ${LATEX_SYNCTEX_ARGS}) + else() + set(synctex_flags) + endif() + + # The commands to run LaTeX. They are repeated multiple times. + set(latex_build_command + ${LATEX_COMPILER} ${LATEX_COMPILER_ARGS} ${synctex_flags} ${LATEX_MAIN_INPUT} + ) + if(LATEX_COMPILER_ARGS MATCHES ".*batchmode.*") + # Wrap command in script that dumps the log file on error. This makes sure + # errors can be seen. + set(latex_build_command + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=execute_latex + -D LATEX_WORKING_DIRECTORY="${output_dir}" + -D LATEX_FULL_COMMAND="${latex_build_command}" + -D LATEX_OUTPUT_FILE="${LATEX_TARGET}.dvi" + -D LATEX_LOG_FILE="${LATEX_TARGET}.log" + -P "${LATEX_USE_LATEX_LOCATION}" + ) + endif() + set(pdflatex_build_command + ${PDFLATEX_COMPILER} ${PDFLATEX_COMPILER_ARGS} ${synctex_flags} ${LATEX_MAIN_INPUT} + ) + if(PDFLATEX_COMPILER_ARGS MATCHES ".*batchmode.*") + # Wrap command in script that dumps the log file on error. This makes sure + # errors can be seen. + set(pdflatex_build_command + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=execute_latex + -D LATEX_WORKING_DIRECTORY="${output_dir}" + -D LATEX_FULL_COMMAND="${pdflatex_build_command}" + -D LATEX_OUTPUT_FILE="${LATEX_TARGET}.pdf" + -D LATEX_LOG_FILE="${LATEX_TARGET}.log" + -P "${LATEX_USE_LATEX_LOCATION}" + ) + endif() + + if(LATEX_INCLUDE_DIRECTORIES) + # The include directories needs to start with the build directory so + # that the copied files can be found. It also needs to end with an + # empty directory so that the standard system directories are included + # after any specified. + set(LATEX_INCLUDE_DIRECTORIES . ${LATEX_INCLUDE_DIRECTORIES} "") + + # CMake separates items in a list with a semicolon. Lists of + # directories on most systems are separated by colons, so we can do a + # simple text replace. On Windows, directories are separated by + # semicolons, but we replace them with the $ generator + # expression to make sure CMake treats it as a single string. + if(CMAKE_HOST_WIN32) + string(REPLACE ";" "$" TEXINPUTS "${LATEX_INCLUDE_DIRECTORIES}") + else() + string(REPLACE ";" ":" TEXINPUTS "${LATEX_INCLUDE_DIRECTORIES}") + endif() + + # Set the TEXINPUTS environment variable + set(latex_build_command + ${CMAKE_COMMAND} -E env TEXINPUTS=${TEXINPUTS} ${latex_build_command}) + set(pdflatex_build_command + ${CMAKE_COMMAND} -E env TEXINPUTS=${TEXINPUTS} ${pdflatex_build_command}) + endif() + + if(NOT LATEX_TARGET_NAME) + # Use the main filename (minus the .tex) as the target name. Remove any + # spaces since CMake cannot have spaces in its target names. + string(REPLACE " " "_" LATEX_TARGET_NAME ${LATEX_TARGET}) + endif() + + # Some LaTeX commands may need to be modified (or may not work) if the main + # tex file is in a subdirectory. Make a flag for that. + get_filename_component(LATEX_MAIN_INPUT_SUBDIR ${LATEX_MAIN_INPUT} DIRECTORY) + + # Set up target names. + set(dvi_target ${LATEX_TARGET_NAME}_dvi) + set(pdf_target ${LATEX_TARGET_NAME}_pdf) + set(ps_target ${LATEX_TARGET_NAME}_ps) + set(safepdf_target ${LATEX_TARGET_NAME}_safepdf) + set(html_target ${LATEX_TARGET_NAME}_html) + set(auxclean_target ${LATEX_TARGET_NAME}_auxclean) + + # Probably not all of these will be generated, but they could be. + # Note that the aux file is added later. + set(auxiliary_clean_files + ${output_dir}/${LATEX_TARGET}.aux + ${output_dir}/${LATEX_TARGET}.bbl + ${output_dir}/${LATEX_TARGET}.blg + ${output_dir}/${LATEX_TARGET}-blx.bib + ${output_dir}/${LATEX_TARGET}.glg + ${output_dir}/${LATEX_TARGET}.glo + ${output_dir}/${LATEX_TARGET}.gls + ${output_dir}/${LATEX_TARGET}.idx + ${output_dir}/${LATEX_TARGET}.ilg + ${output_dir}/${LATEX_TARGET}.ind + ${output_dir}/${LATEX_TARGET}.ist + ${output_dir}/${LATEX_TARGET}.log + ${output_dir}/${LATEX_TARGET}.out + ${output_dir}/${LATEX_TARGET}.toc + ${output_dir}/${LATEX_TARGET}.lof + ${output_dir}/${LATEX_TARGET}.xdy + ${output_dir}/${LATEX_TARGET}.synctex.gz + ${output_dir}/${LATEX_TARGET}.synctex.bak.gz + ${output_dir}/${LATEX_TARGET}.dvi + ${output_dir}/${LATEX_TARGET}.ps + ${output_dir}/${LATEX_TARGET}.pdf + ) + + set(image_list ${LATEX_IMAGES}) + + # For each directory in LATEX_IMAGE_DIRS, glob all the image files and + # place them in LATEX_IMAGES. + foreach(dir ${LATEX_IMAGE_DIRS}) + if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}) + message(WARNING "Image directory ${CMAKE_CURRENT_SOURCE_DIR}/${dir} does not exist. Are you sure you gave relative directories to IMAGE_DIRS?") + endif() + foreach(extension ${LATEX_IMAGE_EXTENSIONS}) + file(GLOB files ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*${extension}) + foreach(file ${files}) + latex_get_filename_component(filename ${file} NAME) + list(APPEND image_list ${dir}/${filename}) + endforeach(file) + endforeach(extension) + endforeach(dir) + + latex_process_images(dvi_images pdf_images ${image_list}) + + set(make_dvi_command + ${CMAKE_COMMAND} -E chdir ${output_dir} + ${latex_build_command}) + set(make_pdf_command + ${CMAKE_COMMAND} -E chdir ${output_dir} + ${pdflatex_build_command} + ) + + set(make_dvi_depends ${LATEX_DEPENDS} ${dvi_images}) + set(make_pdf_depends ${LATEX_DEPENDS} ${pdf_images}) + foreach(input ${LATEX_MAIN_INPUT} ${LATEX_INPUTS}) + list(APPEND make_dvi_depends ${output_dir}/${input}) + list(APPEND make_pdf_depends ${output_dir}/${input}) + if(${input} MATCHES "\\.tex$") + # Dependent .tex files might have their own .aux files created. Make + # sure these get cleaned as well. This might replicate the cleaning + # of the main .aux file, which is OK. + string(REGEX REPLACE "\\.tex$" "" input_we ${input}) + list(APPEND auxiliary_clean_files + ${output_dir}/${input_we}.aux + ${output_dir}/${input}.aux + ) + endif() + endforeach(input) + + set(all_latex_sources ${LATEX_MAIN_INPUT} ${LATEX_INPUTS} ${image_list}) + + if(LATEX_USE_GLOSSARY) + foreach(dummy 0 1) # Repeat these commands twice. + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=makeglossaries + -D LATEX_TARGET=${LATEX_TARGET} + -D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER} + -D XINDY_COMPILER=${XINDY_COMPILER} + -D MAKEGLOSSARIES_COMPILER_ARGS=${MAKEGLOSSARIES_COMPILER_ARGS} + -P ${LATEX_USE_LATEX_LOCATION} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${latex_build_command} + ) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=makeglossaries + -D LATEX_TARGET=${LATEX_TARGET} + -D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER} + -D XINDY_COMPILER=${XINDY_COMPILER} + -D MAKEGLOSSARIES_COMPILER_ARGS=${MAKEGLOSSARIES_COMPILER_ARGS} + -P ${LATEX_USE_LATEX_LOCATION} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${pdflatex_build_command} + ) + endforeach(dummy) + endif() + + if(LATEX_USE_NOMENCL) + foreach(dummy 0 1) # Repeat these commands twice. + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=makenomenclature + -D LATEX_TARGET=${LATEX_TARGET} + -D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER} + -D MAKENOMENCLATURE_COMPILER_ARGS=${MAKENOMENCLATURE_COMPILER_ARGS} + -P ${LATEX_USE_LATEX_LOCATION} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${latex_build_command} + ) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=makenomenclature + -D LATEX_TARGET=${LATEX_TARGET} + -D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER} + -D MAKENOMENCLATURE_COMPILER_ARGS=${MAKENOMENCLATURE_COMPILER_ARGS} + -P ${LATEX_USE_LATEX_LOCATION} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${pdflatex_build_command} + ) + endforeach(dummy) + endif() + + if(LATEX_BIBFILES) + set(suppress_bib_output) + if(LATEX_USE_BIBLATEX) + if(NOT BIBER_COMPILER) + message(SEND_ERROR "I need the biber command.") + endif() + set(bib_compiler ${BIBER_COMPILER}) + set(bib_compiler_flags ${BIBER_COMPILER_ARGS}) + + if(NOT BIBER_COMPILER_ARGS MATCHES ".*-q.*") + # Only suppress bib output if the quiet option is not specified. + set(suppress_bib_output TRUE) + endif() + + if(LATEX_USE_BIBLATEX_CONFIG) + list(APPEND auxiliary_clean_files ${output_dir}/biblatex.cfg) + list(APPEND make_dvi_depends ${output_dir}/biblatex.cfg) + list(APPEND make_pdf_depends ${output_dir}/biblatex.cfg) + endif() + else() + set(bib_compiler ${BIBTEX_COMPILER}) + set(bib_compiler_flags ${BIBTEX_COMPILER_ARGS}) + endif() + if(LATEX_MULTIBIB_NEWCITES) + # Suppressed bib output currently not supported for multibib + foreach (multibib_auxfile ${LATEX_MULTIBIB_NEWCITES}) + latex_get_filename_component(multibib_target ${multibib_auxfile} NAME_WE) + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${bib_compiler} ${bib_compiler_flags} ${multibib_target}) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${bib_compiler} ${bib_compiler_flags} ${multibib_target}) + set(auxiliary_clean_files ${auxiliary_clean_files} + ${output_dir}/${multibib_target}.aux) + endforeach (multibib_auxfile ${LATEX_MULTIBIB_NEWCITES}) + else() + set(full_bib_command + ${bib_compiler} ${bib_compiler_flags} ${LATEX_TARGET}) + if(suppress_bib_output) + set(full_bib_command + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=execute_latex + -D LATEX_WORKING_DIRECTORY="${output_dir}" + -D LATEX_FULL_COMMAND="${full_bib_command}" + -D LATEX_OUTPUT_FILE="${LATEX_TARGET}.bbl" + -D LATEX_LOG_FILE="${LATEX_TARGET}.blg" + -P "${LATEX_USE_LATEX_LOCATION}" + ) + endif() + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${full_bib_command}) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${full_bib_command}) + endif() + + foreach (bibfile ${LATEX_BIBFILES}) + list(APPEND make_dvi_depends ${output_dir}/${bibfile}) + list(APPEND make_pdf_depends ${output_dir}/${bibfile}) + endforeach (bibfile ${LATEX_BIBFILES}) + else() + if(LATEX_MULTIBIB_NEWCITES) + message(WARNING "MULTIBIB_NEWCITES has no effect without BIBFILES option.") + endif() + endif() + + if(LATEX_USE_INDEX) + if(LATEX_INDEX_NAMES) + set(INDEX_NAMES ${LATEX_INDEX_NAMES}) + else() + set(INDEX_NAMES ${LATEX_TARGET}) + endif() + foreach(idx_name ${INDEX_NAMES}) + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${latex_build_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${MAKEINDEX_COMPILER} ${MAKEINDEX_COMPILER_ARGS} ${idx_name}.idx) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${pdflatex_build_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${MAKEINDEX_COMPILER} ${MAKEINDEX_COMPILER_ARGS} ${idx_name}.idx) + set(auxiliary_clean_files ${auxiliary_clean_files} + ${output_dir}/${idx_name}.idx + ${output_dir}/${idx_name}.ilg + ${output_dir}/${idx_name}.ind) + endforeach() + else() + if(LATEX_INDEX_NAMES) + message(WARNING "INDEX_NAMES has no effect without USE_INDEX option.") + endif() + endif() + + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${latex_build_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${latex_build_command}) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${pdflatex_build_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${pdflatex_build_command}) + + # Need to run one more time to remove biblatex' warning + # about page breaks that have changed. + if(LATEX_USE_BIBLATEX) + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${latex_build_command}) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${pdflatex_build_command}) + endif() + + if(LATEX_USE_SYNCTEX) + if(NOT GZIP) + message(SEND_ERROR "UseLATEX.cmake: USE_SYNTEX option requires gzip program. Set GZIP variable.") + endif() + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=correct_synctex + -D LATEX_TARGET=${LATEX_TARGET} + -D GZIP=${GZIP} + -D "LATEX_SOURCE_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR}" + -D "LATEX_BINARY_DIRECTORY=${output_dir}" + -P ${LATEX_USE_LATEX_LOCATION} + ) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=correct_synctex + -D LATEX_TARGET=${LATEX_TARGET} + -D GZIP=${GZIP} + -D "LATEX_SOURCE_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR}" + -D "LATEX_BINARY_DIRECTORY=${output_dir}" + -P ${LATEX_USE_LATEX_LOCATION} + ) + endif() + + # Check LaTeX output for important warnings at end of build + set(make_dvi_command ${make_dvi_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=check_important_warnings + -D LATEX_TARGET=${LATEX_TARGET} + -P ${LATEX_USE_LATEX_LOCATION} + ) + set(make_pdf_command ${make_pdf_command} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${CMAKE_COMMAND} + -D LATEX_BUILD_COMMAND=check_important_warnings + -D LATEX_TARGET=${LATEX_TARGET} + -P ${LATEX_USE_LATEX_LOCATION} + ) + + # Capture the default build. + string(TOLOWER "${LATEX_DEFAULT_BUILD}" default_build) + + if((NOT LATEX_FORCE_PDF) AND (NOT LATEX_FORCE_DVI) AND (NOT LATEX_FORCE_HTML)) + set(no_force TRUE) + endif() + + # Add commands and targets for building pdf outputs (with pdflatex). + if(LATEX_FORCE_PDF OR no_force) + if(LATEX_FORCE_PDF) + set(default_build pdf) + endif() + + if(PDFLATEX_COMPILER) + add_custom_command(OUTPUT ${output_dir}/${LATEX_TARGET}.pdf + COMMAND ${make_pdf_command} + DEPENDS ${make_pdf_depends} + ) + add_custom_target(${pdf_target} + DEPENDS ${output_dir}/${LATEX_TARGET}.pdf + SOURCES ${all_latex_sources} + ) + if(NOT LATEX_EXCLUDE_FROM_DEFAULTS) + add_dependencies(pdf ${pdf_target}) + endif() + endif() + endif() + + # Add commands and targets for building dvi outputs. + if(LATEX_FORCE_DVI OR LATEX_FORCE_HTML OR no_force) + if(LATEX_FORCE_DVI) + if((NOT default_build STREQUAL dvi) AND + (NOT default_build STREQUAL ps) AND + (NOT default_build STREQUAL safepdf)) + set(default_build dvi) + endif() + endif() + + add_custom_command(OUTPUT ${output_dir}/${LATEX_TARGET}.dvi + COMMAND ${make_dvi_command} + DEPENDS ${make_dvi_depends} + ) + add_custom_target(${dvi_target} + DEPENDS ${output_dir}/${LATEX_TARGET}.dvi + SOURCES ${all_latex_sources} + ) + if(NOT LATEX_EXCLUDE_FROM_DEFAULTS) + add_dependencies(dvi ${dvi_target}) + endif() + + if(DVIPS_CONVERTER) + add_custom_command(OUTPUT ${output_dir}/${LATEX_TARGET}.ps + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${DVIPS_CONVERTER} ${DVIPS_CONVERTER_ARGS} -o ${LATEX_TARGET}.ps ${LATEX_TARGET}.dvi + DEPENDS ${output_dir}/${LATEX_TARGET}.dvi) + add_custom_target(${ps_target} + DEPENDS ${output_dir}/${LATEX_TARGET}.ps + SOURCES ${all_latex_sources} + ) + if(NOT LATEX_EXCLUDE_FROM_DEFAULTS) + add_dependencies(ps ${ps_target}) + endif() + if(PS2PDF_CONVERTER) + # Since both the pdf and safepdf targets have the same output, we + # cannot properly do the dependencies for both. When selecting safepdf, + # simply force a recompile every time. + add_custom_target(${safepdf_target} + ${CMAKE_COMMAND} -E chdir ${output_dir} + ${PS2PDF_CONVERTER} ${PS2PDF_CONVERTER_ARGS} ${LATEX_TARGET}.ps ${LATEX_TARGET}.pdf + DEPENDS ${ps_target} + ) + if(NOT LATEX_EXCLUDE_FROM_DEFAULTS) + add_dependencies(safepdf ${safepdf_target}) + endif() + endif() + endif() + endif() + + if(LATEX_FORCE_HTML OR no_force) + if (LATEX_FORCE_HTML) + set(default_build html) + endif() + + if(HTLATEX_COMPILER AND LATEX_MAIN_INPUT_SUBDIR) + message(STATUS + "Disabling HTML build for ${LATEX_TARGET_NAME}.tex because the main file is in subdirectory ${LATEX_MAIN_INPUT_SUBDIR}" + ) + # The code below to run HTML assumes that LATEX_TARGET.tex is in the + # current directory. I have tried to specify that LATEX_TARGET.tex is + # in a subdirectory. That makes the build targets correct, but the + # HTML build still fails (at least for htlatex) because files are not + # generated where expected. I am getting around the problem by simply + # disabling HTML in this case. If someone really cares, they can fix + # this, but make sure it runs on many platforms and build programs. + elseif(HTLATEX_COMPILER) + # htlatex places the output in a different location + set(HTML_OUTPUT "${output_dir}/${LATEX_TARGET}.html") + add_custom_command(OUTPUT ${HTML_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${HTLATEX_COMPILER} ${LATEX_MAIN_INPUT} + "${HTLATEX_COMPILER_TEX4HT_FLAGS}" + "${HTLATEX_COMPILER_TEX4HT_POSTPROCESSOR_FLAGS}" + "${HTLATEX_COMPILER_T4HT_POSTPROCESSOR_FLAGS}" + ${HTLATEX_COMPILER_ARGS} + DEPENDS + ${output_dir}/${LATEX_TARGET}.tex + ${output_dir}/${LATEX_TARGET}.dvi + VERBATIM + ) + add_custom_target(${html_target} + DEPENDS ${HTML_OUTPUT} ${dvi_target} + SOURCES ${all_latex_sources} + ) + if(NOT LATEX_EXCLUDE_FROM_DEFAULTS) + add_dependencies(html ${html_target}) + endif() + endif() + endif() + + # Set default targets. + if("${default_build}" STREQUAL "pdf") + add_custom_target(${LATEX_TARGET_NAME} DEPENDS ${pdf_target}) + elseif("${default_build}" STREQUAL "dvi") + add_custom_target(${LATEX_TARGET_NAME} DEPENDS ${dvi_target}) + elseif("${default_build}" STREQUAL "ps") + add_custom_target(${LATEX_TARGET_NAME} DEPENDS ${ps_target}) + elseif("${default_build}" STREQUAL "safepdf") + add_custom_target(${LATEX_TARGET_NAME} DEPENDS ${safepdf_target}) + elseif("${default_build}" STREQUAL "html") + add_custom_target(${LATEX_TARGET_NAME} DEPENDS ${html_target}) + else() + message(SEND_ERROR "LATEX_DEFAULT_BUILD set to an invalid value. See the documentation for that variable.") + endif() + + if(NOT LATEX_EXCLUDE_FROM_ALL) + add_custom_target(_${LATEX_TARGET_NAME} ALL DEPENDS ${LATEX_TARGET_NAME}) + endif() + + set_directory_properties(. + ADDITIONAL_MAKE_CLEAN_FILES "${auxiliary_clean_files}" + ) + + add_custom_target(${auxclean_target} + COMMENT "Cleaning auxiliary LaTeX files." + COMMAND ${CMAKE_COMMAND} -E remove ${auxiliary_clean_files} + ) + add_dependencies(auxclean ${auxclean_target}) +endfunction(add_latex_targets_internal) + +function(add_latex_targets latex_main_input) + latex_get_output_path(output_dir) + parse_add_latex_arguments(ADD_LATEX_TARGETS ${latex_main_input} ${ARGN}) + + add_latex_targets_internal() +endfunction(add_latex_targets) + +function(add_latex_document latex_main_input) + latex_get_output_path(output_dir) + if(output_dir) + parse_add_latex_arguments(add_latex_document ${latex_main_input} ${ARGN}) + + latex_copy_input_file(${LATEX_MAIN_INPUT}) + + foreach (bib_file ${LATEX_BIBFILES}) + latex_copy_input_file(${bib_file}) + endforeach (bib_file) + + if (LATEX_USE_BIBLATEX AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/biblatex.cfg) + latex_copy_input_file(biblatex.cfg) + set(LATEX_USE_BIBLATEX_CONFIG TRUE) + endif() + + foreach (input ${LATEX_INPUTS}) + latex_copy_input_file(${input}) + endforeach(input) + + latex_copy_globbed_files(${CMAKE_CURRENT_SOURCE_DIR}/*.cls ${output_dir}) + latex_copy_globbed_files(${CMAKE_CURRENT_SOURCE_DIR}/*.bst ${output_dir}) + latex_copy_globbed_files(${CMAKE_CURRENT_SOURCE_DIR}/*.clo ${output_dir}) + latex_copy_globbed_files(${CMAKE_CURRENT_SOURCE_DIR}/*.sty ${output_dir}) + latex_copy_globbed_files(${CMAKE_CURRENT_SOURCE_DIR}/*.ist ${output_dir}) + latex_copy_globbed_files(${CMAKE_CURRENT_SOURCE_DIR}/*.fd ${output_dir}) + + add_latex_targets_internal() + endif() +endfunction(add_latex_document) + +############################################################################# +# Actually do stuff +############################################################################# + +if(LATEX_BUILD_COMMAND) + set(command_handled) + + if("${LATEX_BUILD_COMMAND}" STREQUAL execute_latex) + latex_execute_latex() + set(command_handled TRUE) + endif() + + if("${LATEX_BUILD_COMMAND}" STREQUAL makeglossaries) + latex_makeglossaries() + set(command_handled TRUE) + endif() + + if("${LATEX_BUILD_COMMAND}" STREQUAL makenomenclature) + latex_makenomenclature() + set(command_handled TRUE) + endif() + + if("${LATEX_BUILD_COMMAND}" STREQUAL correct_synctex) + latex_correct_synctex() + set(command_handled TRUE) + endif() + + if("${LATEX_BUILD_COMMAND}" STREQUAL check_important_warnings) + latex_check_important_warnings() + set(command_handled TRUE) + endif() + + if(NOT command_handled) + message(SEND_ERROR "Unknown command: ${LATEX_BUILD_COMMAND}") + endif() + +else() + # Must be part of the actual configure (included from CMakeLists.txt). + latex_setup_variables() + latex_setup_targets() +endif() diff --git a/img/exec/rt_graspels_qa194_12_20_20_speedup.pdf b/img/exec/rt_graspels_qa194_12_20_20_speedup.pdf new file mode 100644 index 0000000..f765e31 Binary files /dev/null and b/img/exec/rt_graspels_qa194_12_20_20_speedup.pdf differ diff --git a/img/exec/rt_graspels_qa194_16_20_20_speedup.pdf b/img/exec/rt_graspels_qa194_16_20_20_speedup.pdf new file mode 100644 index 0000000..68f0628 Binary files /dev/null and b/img/exec/rt_graspels_qa194_16_20_20_speedup.pdf differ diff --git a/img/exec/rt_graspels_qa194_20_20_20_speedup.pdf b/img/exec/rt_graspels_qa194_20_20_20_speedup.pdf new file mode 100644 index 0000000..d85794c Binary files /dev/null and b/img/exec/rt_graspels_qa194_20_20_20_speedup.pdf differ diff --git a/img/exec/rt_graspels_qa194_24_20_20_par.pdf b/img/exec/rt_graspels_qa194_24_20_20_par.pdf new file mode 100644 index 0000000..96c25d6 Binary files /dev/null and b/img/exec/rt_graspels_qa194_24_20_20_par.pdf differ diff --git a/img/exec/rt_graspels_qa194_24_20_20_seq.pdf b/img/exec/rt_graspels_qa194_24_20_20_seq.pdf new file mode 100644 index 0000000..b138862 Binary files /dev/null and b/img/exec/rt_graspels_qa194_24_20_20_seq.pdf differ diff --git a/img/exec/rt_graspels_qa194_4_20_20_speedup.pdf b/img/exec/rt_graspels_qa194_4_20_20_speedup.pdf new file mode 100644 index 0000000..f987fb9 Binary files /dev/null and b/img/exec/rt_graspels_qa194_4_20_20_speedup.pdf differ diff --git a/img/exec/rt_graspels_qa194_8_20_20_speedup.pdf b/img/exec/rt_graspels_qa194_8_20_20_speedup.pdf new file mode 100644 index 0000000..3fcd73b Binary files /dev/null and b/img/exec/rt_graspels_qa194_8_20_20_speedup.pdf differ diff --git a/img/pfor/ct.pdf b/img/pfor/ct.pdf new file mode 100644 index 0000000..ae79f86 Binary files /dev/null and b/img/pfor/ct.pdf differ diff --git a/img/pfor/rt_par_1.pdf b/img/pfor/rt_par_1.pdf new file mode 100644 index 0000000..ef56f06 Binary files /dev/null and b/img/pfor/rt_par_1.pdf differ diff --git a/img/pfor/rt_par_10.pdf b/img/pfor/rt_par_10.pdf new file mode 100644 index 0000000..dcf1742 Binary files /dev/null and b/img/pfor/rt_par_10.pdf differ diff --git a/img/pfor/rt_par_12.pdf b/img/pfor/rt_par_12.pdf new file mode 100644 index 0000000..72e2aa2 Binary files /dev/null and b/img/pfor/rt_par_12.pdf differ diff --git a/img/pfor/rt_par_14.pdf b/img/pfor/rt_par_14.pdf new file mode 100644 index 0000000..b1e7727 Binary files /dev/null and b/img/pfor/rt_par_14.pdf differ diff --git a/img/pfor/rt_par_16.pdf b/img/pfor/rt_par_16.pdf new file mode 100644 index 0000000..f8fac2d Binary files /dev/null and b/img/pfor/rt_par_16.pdf differ diff --git a/img/pfor/rt_par_18.pdf b/img/pfor/rt_par_18.pdf new file mode 100644 index 0000000..b919ecb Binary files /dev/null and b/img/pfor/rt_par_18.pdf differ diff --git a/img/pfor/rt_par_2.pdf b/img/pfor/rt_par_2.pdf new file mode 100644 index 0000000..6571483 Binary files /dev/null and b/img/pfor/rt_par_2.pdf differ diff --git a/img/pfor/rt_par_4.pdf b/img/pfor/rt_par_4.pdf new file mode 100644 index 0000000..e4a980d Binary files /dev/null and b/img/pfor/rt_par_4.pdf differ diff --git a/img/pfor/rt_par_6.pdf b/img/pfor/rt_par_6.pdf new file mode 100644 index 0000000..bbcc718 Binary files /dev/null and b/img/pfor/rt_par_6.pdf differ diff --git a/img/pfor/rt_par_8.pdf b/img/pfor/rt_par_8.pdf new file mode 100644 index 0000000..8459b7a Binary files /dev/null and b/img/pfor/rt_par_8.pdf differ diff --git a/img/pfor/rt_seq.pdf b/img/pfor/rt_seq.pdf new file mode 100644 index 0000000..a8c84c0 Binary files /dev/null and b/img/pfor/rt_seq.pdf differ diff --git a/img/repeat/exp_0.pdf b/img/repeat/exp_0.pdf new file mode 100644 index 0000000..cd8b522 Binary files /dev/null and b/img/repeat/exp_0.pdf differ diff --git a/img/repeat/exp_1.pdf b/img/repeat/exp_1.pdf new file mode 100644 index 0000000..c864d9d Binary files /dev/null and b/img/repeat/exp_1.pdf differ diff --git a/img/repeat/exp_2.pdf b/img/repeat/exp_2.pdf new file mode 100644 index 0000000..0f3b891 Binary files /dev/null and b/img/repeat/exp_2.pdf differ diff --git a/raw/cpplogo.pdf b/raw/cpplogo.pdf new file mode 100644 index 0000000..3fc8b23 Binary files /dev/null and b/raw/cpplogo.pdf differ diff --git a/raw/cpplogo.pdf_tex b/raw/cpplogo.pdf_tex new file mode 100644 index 0000000..f2b166a --- /dev/null +++ b/raw/cpplogo.pdf_tex @@ -0,0 +1,58 @@ +%% Creator: Inkscape 1.0.2 (e86c870879, 2021-01-15), www.inkscape.org +%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010 +%% Accompanies image file 'cpplogo.pdf' (pdf, eps, ps) +%% +%% To include the image in your LaTeX document, write +%% \input{.pdf_tex} +%% instead of +%% \includegraphics{.pdf} +%% To scale the image, write +%% \def\svgwidth{} +%% \input{.pdf_tex} +%% instead of +%% \includegraphics[width=]{.pdf} +%% +%% Images with a different path to the parent latex file can +%% be accessed with the `import' package (which may need to be +%% installed) using +%% \usepackage{import} +%% in the preamble, and then including the image with +%% \import{}{.pdf_tex} +%% Alternatively, one can specify +%% \graphicspath{{/}} +%% +%% For more information, please see info/svg-inkscape on CTAN: +%% http://tug.ctan.org/tex-archive/info/svg-inkscape +%% +\begingroup% + \makeatletter% + \providecommand\color[2][]{% + \errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}% + \renewcommand\color[2][]{}% + }% + \providecommand\transparent[1]{% + \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}% + \renewcommand\transparent[1]{}% + }% + \providecommand\rotatebox[2]{#2}% + \newcommand*\fsize{\dimexpr\f@size pt\relax}% + \newcommand*\lineheight[1]{\fontsize{\fsize}{#1\fsize}\selectfont}% + \ifx\svgwidth\undefined% + \setlength{\unitlength}{229.5bp}% + \ifx\svgscale\undefined% + \relax% + \else% + \setlength{\unitlength}{\unitlength * \real{\svgscale}}% + \fi% + \else% + \setlength{\unitlength}{\svgwidth}% + \fi% + \global\let\svgwidth\undefined% + \global\let\svgscale\undefined% + \makeatother% + \begin{picture}(1,1.12532353)% + \lineheight{1}% + \setlength\tabcolsep{0pt}% + \put(0,0){\includegraphics[width=\unitlength,page=1]{raw/cpplogo.pdf}}% + \end{picture}% +\endgroup% diff --git a/src/acronyms.tex b/src/acronyms.tex new file mode 100644 index 0000000..6ee048a --- /dev/null +++ b/src/acronyms.tex @@ -0,0 +1,80 @@ +\newacronym{ABI}{ABI}{\en{Application Binary Interface}} +\newacronym{API}{API}{\en{Application Programming Interface}} +\newacronym{ASA}{ASA}{arbre syntaxique abstrait} +\newacronym{AST}{AST}{\en{Abstract Syntax Tree}} +\newacronym{AVX}{AVX}{\en{Advanced Vector eXtensions}} + +\newacronym{BLP}{BLP}{\en{Bit-Level Parallelism}} + +\newacronym{C++ AMP}{C++ AMP}{C++ {\en{Accelerated Massive Parallelism}}} +\newacronym{CPP}{CPP}{\en{C PreProcessor}} +\newacronym{CPU}{CPU}{\en{Central Processing Unit}} +\newacronym{CTAD}{CTAD}{\en{Class Template Argument Deduction}} +\newacronym{CUDA}{CUDA}{\en{Compute Unified Device Architecture}} + +\newacronym{DSL}{DSL}{\en{Domain Specific Language}} +\newacronym{DSP}{DSP}{\en{Digital Signal Processor}} + +\newacronym{EBO}{EBO}{\en{Empty Base Optimization}} +\newacronym{EDSL}{EDSL}{\en{Embedded Domain Specific Language}} +\newacronym{ELS}{ELS}{\en{Evolutionary Local Search}} +\newacronym{ET}{ET}{\en{Expression Templates}} + +\newacronym{FIFO}{FIFO}{\en{First In, First Out}} +\newacronym{FPGA}{FPGA}{\en{Field-Programmable Gate Array}} + +\newacronym{GPGPU}{GPGPU}{\en{General-Purpose computing on \gls{GPU}}} +\newacronym{GPPL}{GPPL}{\en{General Purpose Programming Language}} +\newacronym{GPU}{GPU}{\en{Graphics Processing Unit}} +\newacronym{GRASP}{GRASP}{\en{Greedy Randomized Adaptive Search Procedure}} + +\newacronym{HPC}{HPC}{\en{High Performance Computing}} + +\newacronym{ID}{ID}{\en{Instruction Decode}} +\newacronym{IEEE}{IEEE}{\en{Institute of Electrical and Electronics Engineers}} +\newacronym{IF}{IF}{\en{Instruction Fetch}} +\newacronym{ILP}{ILP}{\en{Instruction-Level Parallelism}} +\newacronym{ILS}{ILS}{\en{Iterative Local Search}} +\newacronym{IPC}{IPC}{\en{Inter-Process Communication}} + +\newacronym{MA}{MA}{\en{Memory Access}} +\newacronym{MIMD}{MIMD}{\en{Multiple-Instruction stream -- Multiple-Data stream}} +\newacronym{MISD}{MISD}{\en{Multiple-Instruction stream -- Single-Data stream}} +\newacronym{MMX}{MMX}{\en{multimedia extensions}} +\newacronym{MPI}{MPI}{\en{Message Passing Interface}} +\newacronym{MPT}{MPT}{métaprogrammation template} + +\newacronym{NUMA}{NUMA}{\en{Non-Uniform Memory Access}} + +\newacronym{OpenCL}{OpenCL}{\en{Open Computing Language}} +\newacronym{OpenMP}{OpenMP}{\en{Open Multi-Processing}} + +\newacronym{PEPS}{PEPS}{Premier Entré, Premier Sorti} +\newacronym{PGCD}{PGCD}{plus grand commun diviseur} +\newacronym{POO}{POO}{Programmation Orientée Objet} +\newacronym{POSIX}{POSIX}{\en{Portable Operating System Interface}} +\newacronym{PRNG}{PRNG}{\en{Pseudorandom Number Generator}} + +\newacronym{RAII}{RAII}{\en{Resource Acquisition Is Initialisation}} +\newacronym{RAW}{RAW}{\en{Read After Write}} +\newacronym{RO}{RO}{Recherche Opérationnelle} +\newacronym{RRID}{RRID}{\en{Resource Release Is Destruction}} + +\newacronym{SFINAE}{SFINAE}{\en{Substitution Failure Is Not An Error}} +\newacronym{SIMD}{SIMD}{\en{Single-Instruction stream -- Multiple-Data stream}} +\newacronym{SISD}{SISD}{\en{Single-Instruction stream -- Single-Data stream}} +\newacronym{SMP}{SMP}{\en{Symmetric MultiProcessing}} +\newacronym{SSE}{SSE}{\en{Streaming \gls{SIMD} Extension}} + +\newacronym{TAD}{TAD}{\en{Template Argument Deduction}} +\newacronym{TBB}{TBB}{\en{Threading Building Blocks}} +\newacronym{TMP}{TMP}{\en{template metaprogramming}} +\newacronym{TSP}{TSP}{\en{Travelling Salesman Problem}} + +\newacronym{UAL}{UAL}{Unité Arithmétique et Logique} +\newacronym{UMA}{UMA}{\en{Uniform Memory Access}} +\newacronym{UVF}{UVF}{Unité de calcul en Virgule Flottante} + +\newacronym{WAR}{WAR}{\en{Write After Read}} +\newacronym{WAW}{WAW}{\en{Write After Write}} +\newacronym{WB}{WB}{\en{WriteBack}} diff --git a/src/alg/alsk/grasp.tex b/src/alg/alsk/grasp.tex new file mode 100644 index 0000000..69fe8d4 --- /dev/null +++ b/src/alg/alsk/grasp.tex @@ -0,0 +1,10 @@ +\begin{algorithmic} + \Function{GRASP}{$\textcolor<4>{colLinkIn}{N}, \textcolor<4>{colLinkIn}{P}$} + \For{$i = 1..N$} + \State $\textcolor<4>{colLinkOut}{S_i} \gets \Call{\textcolor<2>{colMuscle!80!black}{heuristiqueConstructive}}{\textcolor<4>{colLinkIn}{P}}$ + \State $\textcolor<4>{colLinkOut}{S_i} \gets \Call{\textcolor<2>{colMuscle!80!black}{rechercheLocale}}{\textcolor<4>{colLinkIn}{P}, \textcolor<4>{colLinkIn}{S_i}}$ + \EndFor + \State $\textcolor<4>{colLinkOut}{S^*} \gets \Call{\textcolor<2>{colMuscle!80!black}{sélection}}{\{\textcolor<4>{colLinkIn}{S_1}, \textcolor<4>{colLinkIn}{S_2}, \dots, \textcolor<4>{colLinkIn}{S_{N}}\}}$ + \State \Return $\textcolor<4>{colLinkOut}{S^*}$ + \EndFunction +\end{algorithmic} diff --git a/src/alg/app/els.tex b/src/alg/app/els.tex new file mode 100644 index 0000000..a1d02ba --- /dev/null +++ b/src/alg/app/els.tex @@ -0,0 +1,20 @@ +\begin{algorithmic} + \Function{ELS}{$P, S, N, M$} + \State $S \gets \Call{rechercheLocaleInitiale}{P, S}$ + \State $S^* \gets S$ + + \For{$i = 1..N$} + \For{$j = 1..M$} + \State $S_j \gets \Call{mutation}{S}$ + \State $S_j \gets \Call{rechercheLocale}{P, S_j}$ + \EndFor + \State $S' \gets \Call{sélection1}{\{S_1, S_2, \dots, S_{M}\}}$ + \State $S^* \gets \Call{sélection2}{S^*, S'}$ + + \If{\Call{critèreAcceptation}{$S'$}} + \State $S \gets S'$ + \EndIf + \EndFor + \State \Return $S^*$ + \EndFunction +\end{algorithmic} diff --git a/src/alg/app/grasp.tex b/src/alg/app/grasp.tex new file mode 100644 index 0000000..6f7ce85 --- /dev/null +++ b/src/alg/app/grasp.tex @@ -0,0 +1,10 @@ +\begin{algorithmic} + \Function{GRASP}{$N, P$} + \For{$i = 1..N$} + \State $S_i \gets \Call{heuristiqueConstructive}{P}$ + \State $S_i \gets \Call{rechercheLocale}{P, S_i}$ + \EndFor + \State $S^* \gets \Call{sélection}{\{S_1, S_2, \dots, S_{N}\}}$ + \State \Return $S^*$ + \EndFunction +\end{algorithmic} diff --git a/src/alg/app/graspels.tex b/src/alg/app/graspels.tex new file mode 100644 index 0000000..8774fc7 --- /dev/null +++ b/src/alg/app/graspels.tex @@ -0,0 +1,10 @@ +\begin{algorithmic} + \Function{GRASP\textcolor{red}{$\times$ELS}}{$N, P$} + \For{$i = 1..N$} + \State $S_i \gets \Call{heuristiqueConstructive}{P}$ + \State $S_i \gets \Call{\textcolor{red}{ELS}}{P, S_i}$ + \EndFor + \State $S^* \gets \Call{sélection}{\{S_1, S_2, \dots, S_{N}\}}$ + \State \Return $S^*$ + \EndFunction +\end{algorithmic} diff --git a/src/alg/app/greedy.tex b/src/alg/app/greedy.tex new file mode 100644 index 0000000..20a798c --- /dev/null +++ b/src/alg/app/greedy.tex @@ -0,0 +1,12 @@ +\begin{algorithmic} + \Function{glouton}{$P$} + \State $S \gets \emptyset$ + \State Construire la liste $L$ des éléments insérables dans $S$ à partir de $P$ + \While{$L \neq \emptyset$} + \State Évaluer le coût d'insertion de chaque élément de $L$ + \State Retirer de $L$ l'élément de coût minimal + \State Insérer cet élément dans $S$ + \EndWhile + \State \Return $S$ + \EndFunction +\end{algorithmic} diff --git a/src/commands.tex b/src/commands.tex new file mode 100644 index 0000000..813ae8b --- /dev/null +++ b/src/commands.tex @@ -0,0 +1,4 @@ +%{{{ alsk " +\newcommand*{\graspils}{GRASP\raisebox{.175ex}{\texttimes}ILS} +\newcommand*{\graspels}{GRASP\raisebox{.175ex}{\texttimes}ELS} +%}}} diff --git a/src/defense/0_intro.tex b/src/defense/0_intro.tex new file mode 100644 index 0000000..94d414c --- /dev/null +++ b/src/defense/0_intro.tex @@ -0,0 +1,25 @@ +\section*{Introduction} + +\begin{frame}{Introduction} + %{{{ frame " + \begin{itemize} + \item[] Performances $\propto$ nombre de cœurs + \item[$\implies$] besoin de bénéficier du parallélisme des cœurs + \item[mais] difficile donc sous-exploité + \end{itemize} + + \vspace{5ex} + + Problématique : + \begin{itemize} + \item[] expertise parallélisation $\neq$ expertise métier + \item[$\implies$] besoin d'outils pour assister la parallélisation + \end{itemize} + %}}} +\end{frame} + +\begin{frame}{Plan} + %{{{ frame " + \tableofcontents[sectionstyle=show,subsectionstyle=show] + %}}} +\end{frame} diff --git a/src/defense/1_context.tex b/src/defense/1_context.tex new file mode 100644 index 0000000..9c8afa6 --- /dev/null +++ b/src/defense/1_context.tex @@ -0,0 +1,5 @@ +\section{Contexte} + +\input{src/defense/1_context/0_par} +\input{src/defense/1_context/1_app} +\input{src/defense/1_context/2_mp} diff --git a/src/defense/1_context/0_par.tex b/src/defense/1_context/0_par.tex new file mode 100644 index 0000000..71251e0 --- /dev/null +++ b/src/defense/1_context/0_par.tex @@ -0,0 +1,56 @@ +\subsection{Parallélisation} + +%{{{ +\begin{frame}{Idée générale} + %{{{ frame " + \framesubtitle<1-2>{Exécution séquentielle} + \framesubtitle<3>{Exécution parallèle idéale} + + \begin{columns} + \begin{column}{.1\paperwidth}\end{column} + \begin{column}{.4\paperwidth} + \fig{context/seq} + \end{column} + \begin{column}<2>{.5\paperwidth} + \begin{itemize} + \item matériel multicœur + \item tâches m\textsubscript{\{0..N-1\}} indépendantes + \end{itemize} + \end{column} + \end{columns} + \figonly<3>{context/par} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Difficultés de la parallélisation} + %{{{ frame " + \begin{alertblock}{Difficultés et inconvénients} + \begin{itemize} + \item<+-> déterminer les parties parallélisables + \begin{itemize} + \item[$\to$] analyse de dépendances + \end{itemize} + \vspace{.5ex} + \item<+-> parallélisation correcte et maintenable + \begin{itemize} + \item[$\to$] composition de fonctions parallèles + \item[$\to$] séparation des domaines d'expertise + \end{itemize} + \vspace{.5ex} + \item<+-> besoin de synchronisation + \begin{itemize} + \item[$\to$] attente de la fin de tâches + \item[$\to$] partage de ressources + \end{itemize} + \vspace{.5ex} + \item<+-> non répétabilité des exécutions + \begin{itemize} + \item[$\to$] cas des nombres pseudo-aléatoires + \end{itemize} + \end{itemize} + \end{alertblock} + %}}} +\end{frame} +%}}} diff --git a/src/defense/1_context/1_app.tex b/src/defense/1_context/1_app.tex new file mode 100644 index 0000000..b5da19f --- /dev/null +++ b/src/defense/1_context/1_app.tex @@ -0,0 +1,106 @@ +\subsection{Application : \graspels} + +%{{{ +\begin{frame}{Problème du voyageur de commerce} + \framesubtitle<1>{Instance} + \framesubtitle<2>{Solution quelconque} + \framesubtitle<3>{Solution optimale} + + %{{{ frame " + \begin{columns} + \begin{column}{.4\paperwidth} + \figonly<1>{app/tspinstance} + \figonly<2>{app/tspsolution} + \figonly<3>{app/tspopti} + \end{column} + \begin{column}{.5\paperwidth} + \begin{itemize} + \item<1-> Graphe $G = (V, A, c)$ + \item<2-> coût $c_s = \displaystyle\sum_{i=2}^{\vert V \vert}{c((s[i-1], s[i]))}$ + \item<3-> Problème d'optimisation + \item<3-> NP-difficile + \end{itemize} + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Algorithme stochastique glouton} + %{{{ frame " + \begin{columns} + \begin{column}{.5\paperwidth} + \alg{app/greedy} + \end{column} + \begin{column}{.5\paperwidth} + \def\tspstart{0} + \def\istep{9} + \only<1>{\def\istep{0}} + \only<2>{\def\istep{1}} + \only<3>{\def\istep{2}} + \only<4>{\def\istep{3}} + \only<5>{\def\istep{4}} + \only<6>{\def\istep{5}} + \only<7>{\def\istep{6}} + \only<8>{\def\istep{7}} + \only<9>{\def\istep{8}} + \only<10>{\def\istep{9}} + \only<11>{\def\tspstart{1}} + \only<12>{\def\tspstart{2}} + \only<13>{\def\tspstart{3}} + \fig{app/tspgreedysolution} + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Métaheuristique \graspels} + \setbeamercovered{still covered={\opaqueness<1->{15}},again covered={\opaqueness<1->{50}}} + + %{{{ frame " + \begin{columns} + \begin{column}{.5\paperwidth} + \begin{overprint} + \onslide+<1> + \vspace*{7ex} + \scriptsize + \alg{app/grasp} + + \onslide+<2-7> + \fig{app/tspels} + + \onslide+<8> + \vspace*{7ex} + \scriptsize + \alg{app/graspels} + \end{overprint} + \end{column} + \begin{column}{.5\paperwidth} + \uncover<2->{ + \scriptsize + \alg{app/els} + } + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Points clés} + %{{{ frame " + \begin{block}{Intérêt de cette application} + \begin{itemize} + \item Plusieurs niveaux de parallélisation possible + \vspace{1ex} + \item Stochastique $\implies$ répétabilité difficile + \vspace{1ex} + \item Composabilité (exemple : \graspils) + \end{itemize} + \end{block} + %}}} +\end{frame} +%}}} diff --git a/src/defense/1_context/2_mp.tex b/src/defense/1_context/2_mp.tex new file mode 100644 index 0000000..d6b1b5d --- /dev/null +++ b/src/defense/1_context/2_mp.tex @@ -0,0 +1,249 @@ +\subsection{Métaprogrammation template} + +%{{{ +\begin{frame}{Métaprogrammation} + %{{{ frame " + \begin{block}{Définition de métaprogramme} + programme dont les données traitées sont des programmes + \end{block} + + En C++ : + \begin{itemize} + \item notamment basé sur les templates + \item exécution du métaprogramme durant la compilation + \item génération d'un programme C++ + \end{itemize} + + \fig{mp/metaprogram} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Métaprogrammation template} + \framesubtitle{Généricité} + + %{{{ frame " + \begin{block}{Résultats d'un template} + \begin{itemize} + \item structure / classe / union + \item fonction + \item variable + \end{itemize} + \end{block} + + \lstvisible<2->{mp/tmptype} + + \visible<3->{ + \begin{columns} + \begin{column}{.33\paperwidth} + \lst{mp/tmptype_int_5} + \end{column} + \begin{column}{.33\paperwidth} + \lst{mp/tmptype_float_3} + \end{column} + \begin{column}{.33\paperwidth} + \lst{mp/tmptype_Foo_256} + \end{column} + \end{columns} + + + \tikz[remember picture,overlay]\draw[->,>=stealth] + (mp tmptype) -- node[midway,left]{\cppinline{Array}} (mp tmptype int 5); + \tikz[remember picture,overlay]\draw[->,>=stealth] + (mp tmptype) -- node[midway]{\cppinline{Array}} (mp tmptype float 3); + \tikz[remember picture,overlay]\draw[->,>=stealth] + (mp tmptype) -- node[midway,right]{\cppinline{Array}} (mp tmptype Foo 256); + } + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Puissance avec exposant connu} + %{{{ frame " + \vspace*{-3ex} + \begin{columns} + \begin{column}{.25\paperwidth}\end{column} + \begin{column}{.5\paperwidth} + \only<-9>{\center Fonction puissance\vspace{-2ex}} + \lstonly<-9>{mp/pow.rt} + \only<10-12>{\setminted{highlightcolor=yellow!80!black!30,highlightlines={1-4}}} + \only<13>{\setminted{highlightcolor=yellow!80!black!30,highlightlines={6-9}}} + \only<9->{\center Métafonction puissance\vspace{-2ex}} + \lstonly<9->{mp/pow.ct} + \end{column} + \begin{column}{.25\paperwidth}\end{column} + \end{columns} + \vspace{-2ex} + \begin{columns}[t] + \begin{column}{.066\paperwidth}\end{column} + \begin{column}{.4\paperwidth} + \only<2-8,10->{\center Exemple d'appel\vspace{-2ex}} + \only<-8>{\lstvisible<2-8>{mp/pow.rt.call}} + \only<8>{ + \vspace{2ex} + \begin{itemize} + \item $n$ multiplications + \item $n$ soustractions + \item structures de contrôle + \end{itemize} + } + \lstvisible<10->{mp/pow.ct.call} + \end{column} + \begin{column}{.066\paperwidth}\end{column} + \begin{column}{.4\paperwidth} + \visible<3-8,15->{\center Assembleur produit\vspace{-2ex}} + \only<-8>{\lstvisible<3-8>{mp/pow.rt.asm}} + \lstonly<15>{mp/pow.ct.asm} + \only<15->{\vspace{7pt}} + \end{column} + \begin{column}{.066\paperwidth}\end{column} + \end{columns} + + \only<10-14>{\center C++ généré\\\vspace{-1pt}} + \only<10>{\small\center\texttt{\hlbox{yellow!80!black!30}{pow<24>(x)}}} + \only<11>{\small\center\texttt{x*\hlbox{yellow!80!black!30}{pow<23>(x)}}} + \only<12>{\small\center\texttt{x*x*\hlbox{yellow!80!black!30}{pow<22>(x)}}} + \only<13>{\small\center\texttt{x*\dots*x*\hlbox{yellow!80!black!30}{pow<0>(x)}}} + \only<14>{% + \small\center\texttt{\phantom{p}\tikzmark{powx0}x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x\tikzmark{powxn}*1\phantom{p}}% + \tikz[remember picture,overlay]{% + \draw[decorate,decoration={brace,amplitude=4pt,raise=2pt,mirror}] + (pic cs:powx0) -- node[below=4pt]{\num{24} occurrences de \texttt{x}} (pic cs:powxn); + }% + } + \only<10-14>{\vspace{11pt}} + + \only<15>{\vspace{-3ex}\center $\implies$ exponentiation rapide par le compilateur} + + \tikz[remember picture,overlay,->,>=stealth,rounded corners,thick]{% + \only<4>{ + \draw[<-] ([shift={(-.1em,.5ex)}]pic cs:powimul) -- +(-10mm,0) node[left]{\texttt{r *= x}}; + } + \only<5>{ + \draw[<-] ([shift={(-.1em,.5ex)}]pic cs:powsub) -- +(-10mm,0) node[left]{\texttt{n-{}-}}; + } + \only<6>{ + \draw ([shift={(-.1em,.5ex)}]pic cs:powjend) -- ++(-12mm,0) + |- node[pos=.25,left]{si \textcolor[rgb]{.53,0,0}{\texttt{esi}} $\leqslant 0$} ([shift={(-.1em,.5ex)}]pic cs:powlend); + \draw ([shift={(-.1em,.5ex)}]pic cs:powjloop) -- ++(-8mm,0) |- ([shift={(-.1em,.5ex)}]pic cs:powlloop); + } + \only<7>{ + \draw ([shift={(-.1em,.5ex)}]pic cs:powjloop) -- ++(-8mm,0) + |- node[pos=.25,left]{tant que \textcolor[rgb]{.53,0,0}{\texttt{eax}} $>0$} ([shift={(-.1em,.5ex)}]pic cs:powlloop); + } + }% + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Patrons d'expression} + %{{{ frame " + \framesubtitle{Concept} + + \begin{itemize} + \item traitement d'arbre syntaxiques abstraits + \item acquisition avec un langage embarqué + \end{itemize} + + \begin{columns} + \begin{column}{.32\paperwidth} + \vspace{1mm} + \lstvisible<2->{mp/edsl_basic} + \lstvisible<4->{mp/et_basic} + \end{column} + \begin{column}{.56\paperwidth} + \figonly<3-4>{mp/et_basic} + \only<5>{\vspace{1mm}} + \lstonly<5>{mp/opmul} + \lstonly<5>{mp/opadd} + \end{column} + \end{columns} + + \only<6->{\vspace{15.75mm}}% fix v pos + \begin{exampleblock}{Applications} + \begin{itemize} + \item Eigen : optimisation de calculs matriciels + \item Adept : optimisation de dérivées de fonctions + \item Parallélisation assistée/automatique + \end{itemize} + \end{exampleblock} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Patrons d'expression} + %{{{ frame " + \framesubtitle{Exemple d'optimisation} + + \only<-3>{\vspace{-2ex}} + + \begin{columns} + \begin{column}{.4\paperwidth} + \lst{mp/edsl_linexpr} + \lstvisible<2->{mp/et} + \end{column} + \begin{column}{.55\paperwidth} + % \vspace{-39mm} + \visible<3>{ + \center Motif \og affine \fg\vspace{-1ex} + \lst{mp/et_pattern_lin} + + \center Motif \og constante \texttimes{} affine \fg\vspace{-1ex} + \lst{mp/et_pattern_mulcstlin} + + \center Motif \og affine $-$ affine \fg\vspace{-1ex} + \lst{mp/et_pattern_sublinlin} + } + \end{column} + \end{columns} + + \begin{columns} + \begin{column}{.3995\paperwidth} + \lst{mp/edsl_linexpr} + \end{column} + \end{columns} + \begin{columns} + \begin{column}{.3275\paperwidth} + \lst{mp/edsl_linexpr_opti0} + \end{column} + \end{columns} + \begin{columns} + \begin{column}{.17\paperwidth} + \lst{mp/edsl_linexpr_opti} + \end{column} + \end{columns} + \begin{overprint} + \onslide+<4> + \fig{mp/et_linexpr} + \onslide+<5> + \fig{mp/et_linexpr_opti0} + \onslide+<6-> + \fig{mp/et_linexpr_opti1} + \only<7>{ + \begin{itemize} + \item code effectif produit + \item analyse durant la compilation + \end{itemize} + } + \end{overprint} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Atouts de la métaprogrammation template} + %{{{ frame " + \begin{itemize} + \item Analyse et génération de code durant la compilation + \vspace{1ex} + \item Possibilité de le faire sans surcoût + \vspace{1ex} + \item C++ standard + \end{itemize} + %}}} +\end{frame} +%}}} diff --git a/src/defense/2_alsk.tex b/src/defense/2_alsk.tex new file mode 100644 index 0000000..1bfb245 --- /dev/null +++ b/src/defense/2_alsk.tex @@ -0,0 +1,6 @@ +\section{Parallélisation assistée} + +\input{src/defense/2_alsk/0_alsk} +\input{src/defense/2_alsk/1_exec} +\input{src/defense/2_alsk/2_repeat} +\input{src/defense/2_alsk/3_conclusion} diff --git a/src/defense/2_alsk/0_alsk.tex b/src/defense/2_alsk/0_alsk.tex new file mode 100644 index 0000000..1dfc896 --- /dev/null +++ b/src/defense/2_alsk/0_alsk.tex @@ -0,0 +1,154 @@ +\subsection{Squelettes algorithmiques} + +%{{{ +\begin{frame}{Concept} + %{{{ frame " + \begin{itemize} + \item Motifs d'exécution parallèle + \item Composition + \item<3>[$\to$] \graspels + \end{itemize} + + \vspace{-4ex} + \begin{overprint} + \onslide+<2> + \fig{alsk/forkjoin} + \onslide+<3> + \vspace{-4ex} + \begin{columns} + \begin{column}{.2\paperwidth} + \vspace*{2ex} + \center Serial\vspace{-6ex} + \fig{alsk/seq} + \end{column} + \begin{column}{.5\paperwidth} + \vspace*{2ex} + \center FarmSel\vspace{-6ex} + \fig{alsk/farmsel} + \end{column} + \end{columns} + \end{overprint} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{\graspels} + %{{{ frame " + \fig{alsk/graspels} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Composition} + %{{{ frame " + \begin{columns} + \begin{column}{.33\paperwidth} + \fig{alsk/grasp} + \end{column} + \begin{column}{.66\paperwidth} + \only<1-4>{ + \begin{itemize}[] + \item Muscles\visible<2->{~: fonctions \og domaine \fg{}} + \item Structure\visible<3->{~: motifs d'exécution} + \item Liens\visible<4->{~: flux de données} + \end{itemize} + \vspace{1cm} + \alg{alsk/grasp}% + \visible<3>{% + \tikz[overlay,colStruct]{% + \fill[rounded corners,opacity=.2] (9mm,23.5mm) rectangle +(33mm,4.25mm);% + \draw[decorate,decoration={brace,amplitude=4pt}] (3mm,5mm) -- +(0mm,27mm);% + \draw[decorate,decoration={brace,amplitude=3pt}] (9mm,9.5mm) -- +(0mm,18mm);% + \draw[decorate,decoration={brace,amplitude=2pt}] (15mm,14.75mm) -- +(0mm,8mm);% + }% + }% + } + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Structure} + %{{{ frame " + \begin{columns} + \begin{column}{.33\paperwidth} + \fig{alsk/grasp_struct} + \end{column} + \begin{column}{.62\paperwidth} + \only<2>{\setminted{highlightcolor=colStruct!30,highlightlines={5,10}}} + \only<3>{\setminted{highlightcolor=colMuscle!30,highlightlines={6-8,9}}} + \only<4>{\setminted{highlightcolor=colStruct!30,highlightlines={6,8}}} + \only<5>{\setminted{highlightcolor=colMuscle!30,highlightlines={7}}} + \lst{alsk/grasp_struct} + \end{column} + \begin{column}{.04\paperwidth}\end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Liens} + %{{{ frame " + \begin{columns} + \begin{column}{.33\paperwidth} + \fig{alsk/grasp_links} + \end{column} + \begin{column}{.62\paperwidth} + \colorletonly<2>{colFSr}{colLinkOut} \colorletonly<2>{colFSp0}{colLinkIn} + \colorletonly<3>{colFSp0}{colLinkIn} \colorletonly<3>{colSp0}{colLinkIn} + \colorletonly<4>{colSp0}{colLinkIn} \colorletonly<4>{colCHp0}{colLinkIn} + \colorletonly<5>{colCHr}{colLinkOut} \colorletonly<5>{colLSp0}{colLinkIn} + \colorletonly<6>{colSr}{colLinkOut} \colorletonly<6>{colLSr}{colLinkOut} + \colorletonly<7>{colSr}{colLinkOut} \colorletonly<7>{colSelp}{colLinkIn} + \colorletonly<8>{colFSr}{colLinkOut} \colorletonly<8>{colSelr}{colLinkOut} + \colorletonly<9>{colCHp1}{colLinkCtx} \colorletonly<9>{colLSp1}{colLinkCtx} + + \begin{itemize} + \item[\texttt{P}] paramètre d'indice \texttt{i} + \item[\texttt{R}] résultat d'indice \texttt{i} + \item[\texttt{RNG}] générateur de nombres pseudo-aléatoires + \end{itemize} + + \lst{alsk/grasp_links} + \end{column} + \begin{column}{.04\paperwidth}\end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Corps : instanciation d'un squelette} + %{{{ frame " + \texttt{SkelEls} $=$ \texttt{SkelElsStruct} $+$ \texttt{SkelElsLinks} + + \bigskip + + \only<2>{\setminted{highlightlines={2},highlightcolor=colStruct!30}} + \only<3>{\setminted{highlightlines={3},highlightcolor=colStruct!30}} + + \lstvisible<1->{alsk/elsbody} + \lstvisible<4->{alsk/graspbody} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Exécution} + %{{{ frame " + \only<1>{\setminted{lastline={1}}} + \only<2>{\setminted{lastline={5}}} + \only<3>{\setminted{lastline={7}}} + \only<4>{\setminted{lastline={9}}} + + \vbox to 4cm { + \lst{alsk/graspexec} + } + %}}} +\end{frame} +%}}} diff --git a/src/defense/2_alsk/1_exec.tex b/src/defense/2_alsk/1_exec.tex new file mode 100644 index 0000000..ea6b03c --- /dev/null +++ b/src/defense/2_alsk/1_exec.tex @@ -0,0 +1,121 @@ +\subsection{Politiques d'exécution} + +%{{{ +\begin{frame}{\texttt{DynamicPool} : \en{Thread pool}} + %{{{ frame " + \fig{exec/threadpool} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Répartition équilibrée} + %{{{ frame " + \only<1>{\def\N{12}\def\T{4}} + \only<2>{\def\N{10}\def\T{4}} + \fig{exec/firstlevel} + \only<1>{ + \vspace{-1ex} + \[ + 12\text{ tâches} = 3\text{ tâches/\en{thread}} \times 4\text{ \en{threads}} + 0\text{ tâche} + \] + \[ + \implies \text{accélération idéale : }4 + \] + } + \only<2>{ + \vspace{-1ex} + \[ + 10\text{ tâches} = 2\text{ tâches/\en{thread}} \times 4\text{ \en{threads}} + 2\text{ tâches} + \] + \[ + \implies \text{accélération idéale : }3.\overline{3} + \] + } + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Répartition équilibrée multi-niveaux} + %{{{ frame " + \def\N{10}\def\T{4} + \figonly<1>{exec/firstleveldetails} + \only<2>{ + \fig{exec/multilevel} + \vspace{6.5mm} + } + \only<1>{ + \vspace{-1ex} + \[ + 10 \times 2\text{ tâches} = 2 \times 2\text{ tâches/\en{thread}} \times 4\text{ \en{threads}} + + 2 \times 2\text{ tâches} + \] + \[ + \implies \text{accélération idéale : }3.\overline{3} + \] + } + \only<2>{ + \vspace{-1ex} + \[ + 10 \times 2\text{ tâches} = (2 \times 2 + 1)\text{ tâches/\en{thread}} \times 4\text{ \en{threads}} + \] + \[ + \implies \text{accélération idéale : }4 + \] + } + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Performances} + %{{{ frame " + \framesubtitle<2>{Temps moyen (exécutions séquentielles)} + \framesubtitle<3>{Temps moyen (exécutions parallèles)} + \framesubtitle<4>{Accélération (exécutions parallèles)} + + \only<1>{ + Contexte matériel et logiciel : + \vspace{1ex} + \begin{itemize} + \item Intel Xeon E7-8890 v3 -- \SI{2.5}{\GHz} + \vspace{1ex} + \item \num{18} cœurs + \vspace{1ex} + \item GCC 8.2.0 -- \texttt{-O2} + \vspace{1ex} + \item Résolution de \graspels{} (194 sommets) + \vspace{1ex} + \item moyennes sur \num{20} exécutions + \vspace{1ex} + \item exécutions répétables + \end{itemize} + } + + \only<2>{ + \begin{columns} + \begin{column}{.7\paperwidth} + \includegraphics{img/exec/rt_graspels_qa194_24_20_20_seq.pdf} + \end{column} + \begin{column}{.25\paperwidth} + \begin{itemize} + \item[hw\_\ldots] \og à la main \fg + \item[sk\_\ldots] avec squelettes + \end{itemize} + \end{column} + \end{columns} + } + \only<3>{ + \includegraphics{img/exec/rt_graspels_qa194_20_20_20_speedup.pdf} + \vspace{-2ex} + \center Nombre d'itérations du GRASP : \num{20} + } + \only<4>{ + \includegraphics{img/exec/rt_graspels_qa194_4_20_20_speedup.pdf} + \vspace{-2.5ex} + \center Nombre d'itérations du GRASP : \num{4} + } + %}}} +\end{frame} +%}}} diff --git a/src/defense/2_alsk/2_repeat.tex b/src/defense/2_alsk/2_repeat.tex new file mode 100644 index 0000000..3fa1621 --- /dev/null +++ b/src/defense/2_alsk/2_repeat.tex @@ -0,0 +1,314 @@ +\subsection{Répétabilité} + +%{{{ +\begin{frame}{Problème} + %{{{ frame " + \framesubtitle{Exécution séquentielle} + + \colorlet{a}{colThread0} + \colorlet{b}{colThread1} + + \begin{columns} + \begin{column}{\paperwidth} + \fig{repeat/prng/seq} + \end{column} + \end{columns} + + \vfill + + \begin{columns} + \begin{column}{.47\paperwidth} + \begin{itemize} + \item \textcolor{a}{$\frac{\text{tâche }0}{\text{\en{thread }0}} \to $ \visible<2->{12}% + \foreach[count=\i from 3] \n in {2,34,85,4,91} {\visible<\i->{, \n}}} + \vspace{1em} + \item<8-> \textcolor{b}{$\frac{\text{tâche }1}{\text{\en{thread }0}} \to $ \visible<8->{29}% + \foreach[count=\i from 9] \n in {85,98,3,35,65} {\visible<\i->{, \n}}} + \end{itemize} + \end{column} + \begin{column}{.37\paperwidth}% fix alignment with next frame + \end{column} + \begin{column}{.12\paperwidth} + \end{column} + \end{columns} + \only<14>{}% create overlay + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Problème} + %{{{ frame " + \framesubtitle{Exécution parallèle} + + \colorlet{a}{colThread0} + \colorlet{b}{colThread1} + + \begin{columns} + \begin{column}{\paperwidth} + \fig{repeat/prng/par} + \end{column} + \end{columns} + + \vfill + + \begin{columns} + \begin{column}{.47\paperwidth} + \begin{itemize} + \item \textcolor{a}{$\frac{\text{tâche }0}{\text{\en{thread }0}} \to $ \visible<2->{12}% + \foreach \n/\os in {34/4,4/6,29/8,98/10,65/13} {\visible<\os->{, \n}}} + \vspace{1em} + \item<3-> \textcolor{b}{$\frac{\text{tâche }1}{\text{\en{thread }0}} \to $ \visible<3->{2}% + \foreach[count=\i from 9] \n/\os in {85/5,91/7,85/9,3/11,35/12} {\visible<\os->{, \n}}} + \end{itemize} + \end{column} + \begin{column}{.37\paperwidth} + \only<14->{ + \begin{itemize} + \setbeamertemplate{itemize items}{\raisebox{.4ex}{\textit{ou}}} + \item \raisebox{.4ex}{\textcolor{a}{34, 85, 91, 29, 98, 35}} + \vspace{1em} + \setbeamertemplate{itemize items}{\raisebox{.1ex}{\textit{ou}}} + \item \raisebox{.1ex}{\textcolor{b}{12, 2, 4, 85, 3, 65}} + \end{itemize} + } + \end{column} + \begin{column}{.12\paperwidth} + \only<15->{ + \begin{itemize} + \setbeamertemplate{itemize items}{\raisebox{.4ex}{\textit{ou}}} + \item \raisebox{.4ex}{\dots} + \vspace{1em} + \setbeamertemplate{itemize items}{\raisebox{.1ex}{\textit{ou}}} + \item \raisebox{.1ex}{\dots} + \end{itemize} + } + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Solutions possibles} + %{{{ frame " + \begin{itemize} + \item un PRNG global $\implies$ aucune répétabilité + \vspace{1em} + \item un PRNG par \en{thread} $\implies$ répétabilité partielle + \vspace{1em} + \item un PRNG par tâche parallèle $\implies$ répétabilité totale + \end{itemize} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Solutions possibles} + %{{{ frame " + \framesubtitle{$\to$ Un PRNG par \en{thread}} + + \colorlet{a}{colThread0} + \colorlet{b}{colThread1} + \colorlet{c}{b} + \only<1>{\colorlet{c}{black}} + + \begin{columns} + \begin{column}{\paperwidth} + \fig{repeat/prng/parthread} + \end{column} + \end{columns} + + \vfill + + \begin{columns} + \begin{column}{.47\paperwidth} + \begin{itemize} + \item \textcolor{a}{$\frac{\text{tâche }0}{\text{\en{thread }0}} \to $ 12, 2, 34, 85, 4, 91} + \vspace{1em} + \item \textcolor{b}{$\frac{\text{tâche }1}{\text{\en{thread }1}} \to $ 42, 8, 9, 54, 95, 80} + \end{itemize} + \end{column} + \begin{column}{.47\paperwidth} + \only<2>{ + \begin{itemize} + \setbeamertemplate{itemize items}{{$=$}} + \item \hspace{.5em}{\textcolor{a}{$\frac{\text{tâche }0}{\text{\en{thread }0}} \to $ 12, 2, 34, 85, 4, 91}} + \vspace{1em} + \setbeamertemplate{itemize items}{{$\neq$}} + \item \hspace{.5em}{\textcolor{b}{$\frac{\text{tâche }1}{\text{\en{thread }0}} \to $ 29, 85, 98, 3, 35, 65}} + \end{itemize} + } + \end{column} + \begin{column}{.02\paperwidth} + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Solutions possibles} + %{{{ frame " + \framesubtitle{$\to$ Un PRNG par tâche parallèle} + + \begin{block}{Pré-requis} + \begin{itemize} + \item Système de liens (\texttt{RNG}) + \item Identifier les tâches parallèles + \begin{itemize} + \item parcours de l'arbre du squelette algorithmique + \item connaissance de la nature des motifs d'exécution + \end{itemize} + \end{itemize} + \end{block} + + \begin{alertblock}{Inconvénient} + \begin{itemize} + \item Beaucoup de PRNG créés + \begin{itemize} + \item[$\to$] réduction grâce à la connaissance des politiques d'exécution + \end{itemize} + \end{itemize} + \end{alertblock} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}<0>[noframenumbering]{Identification des tâches} + %{{{ frame " + \vspace*{-1.5ex} + \begin{columns} + \begin{column}{\paperwidth} + \fig{repeat/identify} + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Optimiser le nombre de PRNG} + %{{{ frame " + \def\N{9} + \begin{columns} + \begin{column}{.3\paperwidth} + \figonly<1>{repeat/seq} + \only<2>{\vspace*{-2.8ex}\def\T{2}\fig{repeat/par}} + \end{column} + \begin{column}{.6\paperwidth} + \only<1>{ + \vspace*{-5ex} + Contraintes \#\en{threads} $\implies$ moins de PRNG + \vspace{4ex} + } + + \only<2>{\vspace*{-3.25ex}} + \[ + \only<1>{S_1 = \{\{m_0, m_1, m_2, m_3, m_4, m_5, m_6, m_7, m_8\}\}} + \only<2>{S_2 = \{\{m_0, m_1, m_2, m_3, m_4\}, \{m_5, m_6, m_7, m_8\}\}} + \] + \end{column} + \end{columns} + \only<3>{ + \def\T{3}\fig{repeat/par} + \[ + S_3 = \{\{m_0, m_1, m_2\},\{m_3, m_4, m_5\}, \{m_6, m_7, m_8\}\} + \] + } + \only<4>{ + \def\T{4}\fig{repeat/par} + \[ + S_4 = \{\{m_0, m_1, m_2\},\{m_3, m_4\},\{m_5, m_6\}, \{m_7, m_8\}\} + \] + } + \only<5>{ + \def\T{5}\fig{repeat/par} + \vspace{13mm} + \[ + S_5 = \{\{m_0, m_1\},\{m_2, m_3\},\{m_4, m_5\},\{m_6, m_7\},\{m_8\}\} + \] + } + \only<6>{ + \def\T{6}\fig{repeat/par} + \vspace{13mm} + \[ + S_6 = \{\{m_0, m_1\},\{m_2, m_3\},\{m_4, m_5\},\{m_6\},\{m_7\},\{m_8\}\} + \] + } + \only<7>{ + \def\T{7}\fig{repeat/par} + \vspace{13mm} + \[ + S_7 = \{\{m_0, m_1\},\{m_2,m_3\},\{m_4\},\{m_5\},\{m_6\},\{m_7\},\{m_8\}\} + \] + } + \only<8>{ + \def\T{8}\fig{repeat/par} + \vspace{13mm} + \[ + S_8 = \{\{m_0, m_1\},\{m_2\},\{m_3\},\{m_4\},\{m_5\},\{m_6\},\{m_7\},\{m_8\}\} + \] + } + \only<9>{ + \begin{columns} + \begin{column}{\paperwidth} + \def\T{9}\fig{repeat/par} + \end{column} + \end{columns} + \vspace{25.8mm} + \[ + S_9 = \{\{m_0\},\{m_1\},\{m_2\},\{m_3\},\{m_4\},\{m_5\},\{m_6\},\{m_7\},\{m_8\}\} + \] + } + % \begin{align*} + % \visible<1->{S_1 &= \{\{m_0, m_1, m_2, m_3, m_4, m_5, m_6, m_7, m_8\}\}} + % \visible<2->{\\S_2 &= \{\{m_0, m_1, m_2, m_3, m_4\}, \{m_5, m_6, m_7, m_8\}\}} + % \visible<3->{\\S_3 &= \{\{m_0, m_1, m_2\},\{m_3, m_4, m_5\}, \{m_6, m_7, m_8\}\}} + % \visible<4->{\\S_4 &= \{\{m_0, m_1, m_2\},\{m_3, m_4\},\{m_5, m_6\}, \{m_7, m_8\}\}} + % \end{align*} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Optimiser le nombre de PRNG} + %{{{ frame " + \begin{align*} + S_1 &= \{\{\tikzmark{s1e0b}m_0, m_1, m_2\tikzmark{s1e0e}, \tikzmark{s1e1b}m_3, m_4\tikzmark{s1e1e}, \tikzmark{s1e2b}m_5\tikzmark{s1e2e}, \tikzmark{s1e3b}m_6\tikzmark{s1e3e}, \tikzmark{s1e4b}m_7, m_8\tikzmark{s1e4e}\}\}\\ + S_2 &= \{\{\tikzmark{s2e0b}m_0, m_1, m_2\tikzmark{s2e0e}, \tikzmark{s2e1b}m_3, m_4\tikzmark{s2e1e}\},\{\tikzmark{s2e2b}m_5\tikzmark{s2e2e}, \tikzmark{s2e3b}m_6\tikzmark{s2e3e}, \tikzmark{s2e4b}m_7, m_8\tikzmark{s2e4e}\}\}\\ + S_3 &= \{\{\tikzmark{s3e0b}m_0, m_1, m_2\tikzmark{s3e0e}\},\{\tikzmark{s3e1b}m_3, m_4\tikzmark{s3e1e}, \tikzmark{s3e2b}m_5\tikzmark{s3e2e}\},\{\tikzmark{s3e3b}m_6\tikzmark{s3e3e}, \tikzmark{s3e4b}m_7, m_8\tikzmark{s3e4e}\}\}\\ + S_4 &= \{\{\tikzmark{s4e0b}m_0, m_1, m_2\tikzmark{s4e0e}\},\{\tikzmark{s4e1b}m_3, m_4\tikzmark{s4e1e}\},\{\tikzmark{s4e2b}m_5\tikzmark{s4e2e}, \tikzmark{s4e3b}m_6\tikzmark{s4e3e}\},\{\tikzmark{s4e4b}m_7, m_8\tikzmark{s4e4e}\}\} + \end{align*} + + \visible<2->{ + \[ + S = \{\{\tikzmark{se0b}m_0, m_1, m_2\tikzmark{se0e}\},\{\tikzmark{se1b}m_3, m_4\tikzmark{se1e}\},\{\tikzmark{se2b}m_5\tikzmark{se2e}\},\{\tikzmark{se3b}m_6\tikzmark{se3e}\},\{\tikzmark{se4b}m_7, m_8\tikzmark{se4e}\}\} + \] + } + + \foreach[count=\s from 0] \col in + {red!90!black,yellow!80!black,green!90!black,cyan!80!black,blue!90!black} {% + \visible<+(2),8>{% + \tikz[remember picture,overlay,every node/.append style={common/rhl=\col}]{% + \foreach \i in {1,...,4} {% + \node[fit=(pic cs:s\i e\s b)(pic cs:s\i e\s e)]{}; + }% + \node[fit=(pic cs:se\s b)(pic cs:se\s e)]{}; + }% + }% + }% + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Nombre de PRNG nécessaires} + %{{{ frame " + \only<1>{\includegraphics{img/repeat/exp_0.pdf}} + \only<2>{\includegraphics{img/repeat/exp_1.pdf}} + \only<3>{\includegraphics{img/repeat/exp_2.pdf}} + %}}} +\end{frame} +%}}} diff --git a/src/defense/2_alsk/3_conclusion.tex b/src/defense/2_alsk/3_conclusion.tex new file mode 100644 index 0000000..241ed89 --- /dev/null +++ b/src/defense/2_alsk/3_conclusion.tex @@ -0,0 +1,26 @@ +\subsection*{Résumé} + +%{{{ +\begin{frame} + %{{{ frame " + Plusieurs niveaux d'utilisation : + \begin{itemize} + \item conception de motifs d'exécution + \vspace{1ex} + \item implémentation de politiques d'exécution + \vspace{1ex} + \item définition de squelettes (bibliothèques spécialisées) + \vspace{1ex} + \item utilisation finale d'un squelette existant + \end{itemize} + + \bigskip + + Répétabilité : + \begin{itemize} + \item indépendante du nombre de \en{threads} + \item optimisée en fonction de la politique d'exécution + \end{itemize} + %}}} +\end{frame} +%}}} diff --git a/src/defense/3_pfor.tex b/src/defense/3_pfor.tex new file mode 100644 index 0000000..88e35a7 --- /dev/null +++ b/src/defense/3_pfor.tex @@ -0,0 +1,5 @@ +\section{Parallélisation automatique de boucles} + +\input{src/defense/3_pfor/0_ctanalysis} +\input{src/defense/3_pfor/1_edsl} +\input{src/defense/3_pfor/2_results} diff --git a/src/defense/3_pfor/0_ctanalysis.tex b/src/defense/3_pfor/0_ctanalysis.tex new file mode 100644 index 0000000..3659d2d --- /dev/null +++ b/src/defense/3_pfor/0_ctanalysis.tex @@ -0,0 +1,98 @@ +\subsection{Analyse durant la compilation} + +\tikzset{local/rhl/.style={common/rhl=#1,minimum height=2.3ex,rounded corners=.5mm}} + +%{{{ +\begin{frame}{Besoin} + %{{{ frame " + Temps d'exécution concentré dans les boucles + + $\implies$ parallélisation des boucles + + \bigskip + + \begin{columns} + \begin{column}{.5\paperwidth} + \lstvisible<2->{intro/loop_par} + \lstvisible<3->{intro/loop_seq} + \lstvisible<4->{intro/loop_par_hard} + \end{column} + \end{columns} + + \bigskip + + \visible<5>{ + Objectif de la bibliothèque : + \begin{itemize} + \item analyse automatique durant la compilation + \item génération automatique + \end{itemize} + } + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Analyse} + %{{{ frame " + \framesubtitle<-5>{Conditions de Bernstein} + \framesubtitle<6-7>{Identification des boucles parallélisables} + \framesubtitle<8>{Résultat} + + \begin{columns} + \begin{column}{.5\paperwidth} + \begin{overprint} + \onslide+<1-5> + \lst{pfor/loop} + \def\x{x}\def\y{y} + \only<4>{\def\x{2}\def\y{4}} + \only<5>{\def\x{3}\def\y{5}} + \begin{exampleblock}<2-4>{Indépendance de deux instructions x et y selon Bernstein} + \vspace{-3ex} + \begin{align*} + \only<3-4>{\color{red!80!black}}W_\y \cap R_\x &\only<3-4>{\color{red!80!black}}= \alt<3-4>{\{\alt<3>{b}{d}\}}{\emptyset}\\ + \only<4>{\color{red!80!black}}R_\y \cap W_\x &\only<4>{\color{red!80!black}}= \alt<4>{\{c\}}{\emptyset}\\ + W_\x \cap W_\y &= \emptyset + \end{align*} + \end{exampleblock} + \foreach \l/\os/\col in {b/3/red,c/4/green!60!red,d/4/green!60!blue} { + \visible<\os>{ + \tikz[remember picture,overlay,every node/.append style={local/rhl=\col}]{ + \node[fit=(pic cs:pforloop\l rb)(pic cs:pforloop\l re)]{}; + \node[fit=(pic cs:pforloop\l wb)(pic cs:pforloop\l we)]{}; + } + } + } + \visible<5>{ + \tikz[remember picture,overlay]{ + \foreach \l/\col in {2/red,3/green,4/red,5/green,6/blue} { + \node[fit=(pic cs:pforloopl\l b)(pic cs:pforloopl\l e),local/rhl=\col]{}; + \node[fit=(pic cs:pforloopl\l b)(pic cs:pforloopl\l e),local/rhl=\col]{}; + } + } + + \vspace{-39pt} + \begin{itemize} + \item[$\to$] analyse des variables + \end{itemize} + } + \onslide+<6-7> + \lst{pfor/loop_split} + \visible<7>{ + \tikz[remember picture,overlay,every node/.append style={local/rhl=red}]{ + \node[fit=(pic cs:pforloopsplitcrb)(pic cs:pforloopsplitcre)]{}; + \node[fit=(pic cs:pforloopsplitcwb)(pic cs:pforloopsplitcwe)]{}; + } + + \begin{itemize} + \item[$\to$] analyse des fonctions d'indice + \end{itemize} + } + \onslide+<8> + \lst{pfor/loop_par} + \end{overprint} + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} diff --git a/src/defense/3_pfor/1_edsl.tex b/src/defense/3_pfor/1_edsl.tex new file mode 100644 index 0000000..0705527 --- /dev/null +++ b/src/defense/3_pfor/1_edsl.tex @@ -0,0 +1,18 @@ +\subsection{Syntaxe du langage embarqué} + +%{{{ +\begin{frame}{Utilisation} + %{{{ frame " + \begin{columns} + \begin{column}{.49\paperwidth} + \center Boucle originale + \lst{pfor/loop_noanim} + \end{column} + \begin{column}{.49\paperwidth} + \center Boucle active + \lst{pfor/loop_pfor} + \end{column} + \end{columns} + %}}} +\end{frame} +%}}} diff --git a/src/defense/3_pfor/2_results.tex b/src/defense/3_pfor/2_results.tex new file mode 100644 index 0000000..5638a46 --- /dev/null +++ b/src/defense/3_pfor/2_results.tex @@ -0,0 +1,37 @@ +\subsection*{Performances} + +%{{{ +\begin{frame}{Performances} + %{{{ frame " + \framesubtitle<2>{Exécutions séquentielles} + \framesubtitle<3>{Exécutions parallèles} + + \only<1>{ + Contexte matériel et logiciel : + \vspace{1ex} + \begin{itemize} + \item Intel Xeon E7-8890 v3 -- \SI{2.5}{\GHz} + \vspace{1ex} + \item \num{18} cœurs + \vspace{1ex} + \item GCC 8.2.0 -- \texttt{-O2} + \vspace{1ex} + \item moyennes sur \num{20} exécutions + \vspace{1ex} + \item exécutions répétables + \end{itemize} + } + + \only<2>{\includegraphics{img/pfor/rt_seq.pdf}} + \only<3>{\includegraphics{img/pfor/rt_par_18.pdf}} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Performances -- compilation} + %{{{ frame " + \includegraphics{img/pfor/ct.pdf} + %}}} +\end{frame} +%}}} diff --git a/src/defense/4_conclusion.tex b/src/defense/4_conclusion.tex new file mode 100644 index 0000000..484077b --- /dev/null +++ b/src/defense/4_conclusion.tex @@ -0,0 +1,59 @@ +\section*{Conclusion} + +%{{{ +\begin{frame}{Bilan} + %{{{ frame " + \num{2} bibliothèques actives de parallélisation : + \begin{itemize} + \item abstraction sans surcoût à l'exécution + \item parallélisation assistée ou automatique + \end{itemize} + + \bigskip + + \begin{itemize} + \item Bibliothèque active de parallélisation assistée : + \begin{itemize} + \item squelettes algorithmiques + \item choix de la politique d'exécution + \item répétabilité garantie automatiquement + \item quelques squelettes pour la recherche opérationnelle + \end{itemize} + \vspace{1ex} + \item Bibliothèque active de parallélisation automatique de boucles : + \begin{itemize} + \item analyse à la compilation de l'AST + \begin{itemize} + \item \dots des variables pour les dépendances + \item \dots des fonctions d'indice pour la parallélisabilité + \end{itemize} + \end{itemize} + \end{itemize} + %}}} +\end{frame} +%}}} + +%{{{ +\begin{frame}{Limites et perspectives} + %{{{ frame " + Bibliothèque de parallélisation assistée : + \begin{itemize} + \item nouveaux motifs : + \begin{itemize} + \item \en{pipeline} + \item \en{divide and conquer} + \item \dots + \end{itemize} + \item politique d'exécution équilibrée pondérée + \end{itemize} + + \bigskip + + Bibliothèque de parallélisation automatique de boucles : + \begin{itemize} + \item généralisation de l'analyse des fonctions d'indice + \item transformation d'un code non parallélisable + \end{itemize} + %}}} +\end{frame} +%}}} diff --git a/src/document.tex b/src/document.tex new file mode 100644 index 0000000..c80d9c1 --- /dev/null +++ b/src/document.tex @@ -0,0 +1,23 @@ +\begin{document} + \begin{frame}[plain] + \titlepage + \end{frame} + + { + \input{src/defense/0_intro} + + { + \AtBeginSection{ + \begin{frame} + \frametitle{Plan} + \tableofcontents[currentsection] + \end{frame} + } + + \input{src/defense/1_context} + \input{src/defense/2_alsk} + \input{src/defense/3_pfor} + } + \input{src/defense/4_conclusion} + } +\end{document} diff --git a/src/fig/alsk/farmsel.tex b/src/fig/alsk/farmsel.tex new file mode 100644 index 0000000..3f944a8 --- /dev/null +++ b/src/fig/alsk/farmsel.tex @@ -0,0 +1,26 @@ +\begin{tikzpicture} + \input{src/tikz/parallel} + + \begin{scope}[node distance=6mm] + \begin{scope}[start chain=going below,every node/.style={on chain,join},parallel/arrow] + \node[parallel/block] (input) {}; + \node[parallel/point] (fork) {}; + \node[parallel/task] (main) {\dots}; + \node[parallel/point] (join) {}; + \node[parallel/task] (select) {T\textsubscript{S}}; + \node[parallel/block] (output) {}; + \end{scope} + + \node[parallel/task,left=of main] (thread 0) {T\textsubscript{0}}; + \node[parallel/task,right=of main] (thread n) {T\textsubscript{n-1}}; + \end{scope} + + \begin{scope}[on background layer] + \node[parallel/region=(thread 0)(main)(thread n)] {}; + \end{scope} + + \begin{scope}[parallel/arrow] + \draw (fork) -| (thread 0) |- (join); + \draw (fork) -| (thread n) |- (join); + \end{scope} +\end{tikzpicture} diff --git a/src/fig/alsk/forkjoin.tex b/src/fig/alsk/forkjoin.tex new file mode 100644 index 0000000..a5924ec --- /dev/null +++ b/src/fig/alsk/forkjoin.tex @@ -0,0 +1,23 @@ +\begin{tikzpicture} + \input{src/tikz/parallel} + + \begin{scope}[node distance=8mm] + \begin{scope}[start chain=going below,every node/.style={on chain,join},parallel/arrow] + \node[parallel/block] (input) {}; + \node[parallel/point] (fork) {}; + \node[parallel/task] (main) {T\textsubscript{0}}; + \node[parallel/point] (join) {}; + \node[parallel/block] (output) {}; + \end{scope} + + \node[parallel/task,right=of main] (thread) {T\textsubscript{1}}; + \end{scope} + + \begin{scope}[on background layer] + \node[parallel/region=(main)(thread)] {}; + \end{scope} + + \begin{scope}[parallel/arrow] + \draw (fork) -| node[above,pos=.2]{\en{fork}} (thread) |- node[below,pos=.8]{\en{join}} (join); + \end{scope} +\end{tikzpicture} diff --git a/src/fig/alsk/grasp.tex b/src/fig/alsk/grasp.tex new file mode 100644 index 0000000..5075b22 --- /dev/null +++ b/src/fig/alsk/grasp.tex @@ -0,0 +1,72 @@ +\begin{tikzpicture} + \input{src/tikz/alsk} + + %{{{ GRASP " + % Nodes + \matrix[row sep=3mm, column sep=-1mm] { + & \node[alsk/scheme/split] (split) {}; \\ + \\ + \node[alsk/scheme/task] (ch0) {CH}; & \node[alsk/label] (chi) {\bf\scriptsize\dots}; & + \node[alsk/scheme/task] (chn) {CH}; \\ + \node[alsk/scheme/task] (ls0) {LS}; & \node[alsk/label] (lsi) {\bf\scriptsize\dots}; & + \node[alsk/scheme/task] (lsn) {LS}; \\ + \\ + & \node[alsk/scheme/join] (merge) {}; \\ + & \node[alsk/scheme/task] (select) {S}; \\ + }; + + \node[above=3mm of split] (entry) {}; + \node[below=3mm of select] (return) {}; + + % Frames + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(ch0)(ls0),only on=<3>{ultra thick}] (serial0) {}; + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(chn)(lsn),only on=<3>{ultra thick}] (serialn) {}; + + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(split)(select)(serial0)(serialn),only on=<3>{ultra thick}] (grasp) {}; + + % Links + \begin{scope}[alsk/scheme/link,only on=<4>{ultra thick}] + \draw[only on=<4>{colLinkIn}] (entry) -- (split); + + \draw[only on=<4>{colLinkIn}] (split.210) -- (serial0.north); + \draw[only on=<4>{colLinkIn}] (split.330) -- (serialn.north); + + \draw[only on=<4>{colLinkIn}] (serial0.north) -- (ch0); + \draw[only on=<4>{colLinkIn}] (serialn.north) -- (chn); + + \draw[only on=<4>{colLinkOut!50!colLinkIn}] (ch0) -- (ls0); + \draw[only on=<4>{colLinkOut!50!colLinkIn}] (chn) -- (lsn); + + \draw[only on=<4>{colLinkOut}] (ls0) -- (serial0.south); + \draw[only on=<4>{colLinkOut}] (lsn) -- (serialn.south); + + \draw[only on=<4>{colLinkOut}] (serial0.south) -- (merge.150); + \draw[only on=<4>{colLinkOut}] (serialn.south) -- (merge.30); + + \draw[only on=<4>{colLinkIn}] (merge) -- (select); + + \draw[only on=<4>{colLinkOut}] (select) -- (return); + \end{scope} + %}}} + + %{{{ animations " + %{{{ Muscles " + \visible<2>{ + \node[alsk/scheme/task,ultra thick] at (ch0) {CH}; + \node[alsk/scheme/task,ultra thick] at (chn) {CH}; + \node[alsk/scheme/task,ultra thick] at (ls0) {LS}; + \node[alsk/scheme/task,ultra thick] at (lsn) {LS}; + \node[alsk/scheme/task,ultra thick] at (select) {S}; + } + %}}} + %{{{ Structure " + \visible<3>{ + \node[alsk/scheme/split,ultra thick] at (split) {}; + \node[alsk/scheme/join,ultra thick] at (merge) {}; + } + %}}} + %}}} +\end{tikzpicture} diff --git a/src/fig/alsk/grasp_links.tex b/src/fig/alsk/grasp_links.tex new file mode 100644 index 0000000..8695383 --- /dev/null +++ b/src/fig/alsk/grasp_links.tex @@ -0,0 +1,54 @@ +\begin{tikzpicture} + \input{src/tikz/alsk} + + %{{{ GRASP " + % Nodes + \matrix[row sep=3mm, column sep=-1mm] { + & \node[alsk/scheme/split] (split) {}; \\ + \\ + \node[alsk/scheme/task] (ch0) {CH}; & \node[alsk/label] (chi) {\bf\scriptsize\dots}; & + \node[alsk/scheme/task] (chn) {CH}; \\ + \node[alsk/scheme/task] (ls0) {LS}; & \node[alsk/label] (lsi) {\bf\scriptsize\dots}; & + \node[alsk/scheme/task] (lsn) {LS}; \\ + \\ + & \node[alsk/scheme/join] (merge) {}; \\ + & \node[alsk/scheme/task] (select) {S}; \\ + }; + + \node[above=3mm of split] (entry) {}; + \node[below=3mm of select] (return) {}; + + % Frames + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(ch0)(ls0)] (serial0) {}; + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(chn)(lsn)] (serialn) {}; + + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(split)(select)(serial0)(serialn)] (grasp) {}; + + % Links + \begin{scope}[alsk/scheme/link] + \draw[only on=<2>{ultra thick,colLinkIn}] (entry) -- (split); + + \draw[only on=<3>{ultra thick,colLinkIn}] (split.210) -- (serial0.north); + \draw[only on=<3>{ultra thick,colLinkIn}] (split.330) -- (serialn.north); + + \draw[only on=<4>{ultra thick,colLinkIn}] (serial0.north) -- (ch0); + \draw[only on=<4>{ultra thick,colLinkIn}] (serialn.north) -- (chn); + + \draw[only on=<5>{ultra thick,colLinkOut!50!colLinkIn}] (ch0) -- (ls0); + \draw[only on=<5>{ultra thick,colLinkOut!50!colLinkIn}] (chn) -- (lsn); + + \draw[only on=<6>{ultra thick,colLinkOut}] (ls0) -- (serial0.south); + \draw[only on=<6>{ultra thick,colLinkOut}] (lsn) -- (serialn.south); + + \draw[only on=<7>{ultra thick,colLinkOut}] (serial0.south) -- (merge.150); + \draw[only on=<7>{ultra thick,colLinkOut}] (serialn.south) -- (merge.30); + + \draw[only on=<7>{ultra thick,colLinkIn}] (merge) -- (select); + + \draw[only on=<{2,8}>{ultra thick,colLinkOut}] (select) -- (return); + \end{scope} + %}}} +\end{tikzpicture} diff --git a/src/fig/alsk/grasp_struct.tex b/src/fig/alsk/grasp_struct.tex new file mode 100644 index 0000000..1e76624 --- /dev/null +++ b/src/fig/alsk/grasp_struct.tex @@ -0,0 +1,75 @@ +\begin{tikzpicture} + \input{src/tikz/alsk} + + %{{{ GRASP " + % Nodes + \matrix[row sep=3mm, column sep=-1mm] { + & \node[alsk/scheme/split] (split) {}; \\ + \\ + \node[alsk/scheme/task] (ch0) {CH}; & \node[alsk/label] (chi) {\bf\scriptsize\dots}; & + \node[alsk/scheme/task] (chn) {CH}; \\ + \node[alsk/scheme/task] (ls0) {LS}; & \node[alsk/label] (lsi) {\bf\scriptsize\dots}; & + \node[alsk/scheme/task] (lsn) {LS}; \\ + \\ + & \node[alsk/scheme/join] (merge) {}; \\ + & \node[alsk/scheme/task] (select) {S}; \\ + }; + + \node[above=3mm of split] (entry) {}; + \node[below=3mm of select] (return) {}; + + % Frames + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(ch0)(ls0),only on=<3>{ultra thick},only on=<3>{solid,common/drawfill=colMuscle}, + only on=<4>{ultra thick}] (serial0) {\only<3>{T}}; + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(chn)(lsn),only on=<3>{ultra thick},only on=<3>{solid,common/drawfill=colMuscle}, + only on=<4>{ultra thick}] (serialn) {\only<3>{T}}; + + \node[alsk/scheme/frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(split)(select)(serial0)(serialn),only on=<1>{ultra thick}] (grasp) {}; + + % Links + \begin{scope}[alsk/scheme/link] + \draw (entry) -- (split); + + \draw (split.210) -- (serial0.north); + \draw (split.330) -- (serialn.north); + + \visible<-2,4->{ + \draw (serial0.north) -- (ch0); + \draw (serialn.north) -- (chn); + + \draw (ch0) -- (ls0); + \draw (chn) -- (lsn); + + \draw (ls0) -- (serial0.south); + \draw (lsn) -- (serialn.south); + } + + \draw (serial0.south) -- (merge.150); + \draw (serialn.south) -- (merge.30); + + \draw (merge) -- (select); + + \draw (select) -- (return); + \end{scope} + %}}} + + %{{{ animations " + \visible<2>{ + \node[alsk/scheme/split,ultra thick] at (split) {}; + \node[alsk/scheme/join,ultra thick] at (merge) {}; + } + \visible<3>{ + \node[alsk/scheme/task,ultra thick] at (select) {S}; + } + \visible<5>{ + \node[alsk/scheme/task,ultra thick] at (ch0) {CH}; + \node[alsk/scheme/task,ultra thick] at (chn) {CH}; + \node[alsk/scheme/task,ultra thick] at (ls0) {LS}; + \node[alsk/scheme/task,ultra thick] at (lsn) {LS}; + } + %}}} + %}}} +\end{tikzpicture} diff --git a/src/fig/alsk/graspels.tex b/src/fig/alsk/graspels.tex new file mode 100644 index 0000000..e603072 --- /dev/null +++ b/src/fig/alsk/graspels.tex @@ -0,0 +1,133 @@ +\begin{tikzpicture} + \input{src/tikz/alsk} + + \tikzset{split/.style={alsk/scheme/split,minimum width=8mm}} + \tikzset{task/.style={alsk/scheme/task,minimum width=6mm}} + \tikzset{join/.style={alsk/scheme/join,minimum width=8mm}} + \tikzset{loop/.style={alsk/scheme/loop,minimum width=6mm}} + \tikzset{frame/.style={alsk/scheme/frame=#1,inner sep=.5mm}} + + % GRASP nodes + \matrix[row sep=2.5mm, column sep=-1mm] { + & \node[split,minimum width=8mm] (grasp split) {}; \\ + \\ + \node[task] (grasp ch0) {\scriptsize CH}; & \node[alsk/label] (grasp chi) {\scriptsize\dots}; & + \node[task] (grasp chn) {\scriptsize CH}; \\ + \node[task] (grasp ls0) {}; & \node[alsk/label] (grasp lsi) {\scriptsize\dots}; & + \node[task] (grasp lsn) {}; \\ + \\ + & \node[join] (grasp merge) {}; \\ + & \node[task] (grasp select) {\scriptsize Sel\textsubscript{1}}; \\ + }; + + \node[above=3mm of grasp split] (grasp entry) {}; + \node[below=3mm of grasp select] (grasp return) {}; + + % Frames + \node[frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(grasp ch0)(grasp ls0)] (grasp serial0) {}; + \node[frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(grasp chn)(grasp lsn)] (grasp serialn) {}; + + \node[frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(grasp split)(grasp select)(grasp serial0)(grasp serialn)] {}; + + % GRASP Links + \begin{scope}[alsk/scheme/link] + \draw (grasp entry) -- (grasp split); + + \draw (grasp split.210) -- (grasp serial0.north); + \draw (grasp split.330) -- (grasp serialn.north); + + \draw (grasp serial0.north) -- (grasp ch0); + \draw (grasp serialn.north) -- (grasp chn); + + \draw (grasp ch0) -- (grasp ls0); + \draw (grasp chn) -- (grasp lsn); + + \draw (grasp ls0) -- (grasp serial0.south); + \draw (grasp lsn) -- (grasp serialn.south); + + \draw (grasp serial0.south) -- (grasp merge.150); + \draw (grasp serialn.south) -- (grasp merge.30); + + \draw (grasp merge) -- (grasp select); + + \draw (grasp select) -- (grasp return); + \end{scope} + + % ELS + \begin{scope}[common/overlay,spy using outlines={circle,magnification=.095,size=6.0mm}] + \begin{scope}[every node/.append style={transform shape,scale=.7}] + \matrix[row sep=1.5mm, column sep=-1mm] (els) at (5, 0) { + & \node[task] (els init ls) {\scriptsize iLS}; \\ + & \node[loop] (els loopbegin) {}; \\ + & \node[split] (els split) {}; \\ + \\ + \node[task] (els m0) {\scriptsize M}; & \node[alsk/label] (els mi) {\dots}; & + \node[task] (els mn) {\scriptsize M}; \\ + \node[task] (els ls0) {\scriptsize LS}; & \node[alsk/label] (els lsi) {\dots}; & + \node[task] (els lsn) {\scriptsize LS}; \\ + \\ + & \node[join] (els merge) {}; \\ + & \node[task] (els select2) {\scriptsize Sel\textsubscript{2}}; \\ + & \node[task] (els select3) {\scriptsize Sel\textsubscript{3}}; \\ + & \node[task] (els accept) {\scriptsize A}; \\ + & \node[loop] (els loopend) {}; \\ + }; + + \node[above=1.5mm of els init ls] (els entry) {}; + \node[below=1.5mm of els loopend] (els return) {}; + + % Frames + \node[frame=colStruct,fit margins={top=2mm,bottom=2mm,left=1.2mm,right=1.2mm}, + fit=(els m0)(els ls0)] (els serial0) {}; + \node[frame=colStruct,fit margins={top=2mm,bottom=2mm,left=1.2mm,right=1.2mm}, + fit=(els mn)(els lsn)] (els serialn) {}; + + \node[frame=colStruct,fit margins={top=4.4mm,bottom=4mm,left=2.8mm,right=2.8mm}, + fit=(els split)(els select2)(els serial0)(els serialn)] {}; + + % Links + \begin{scope}[alsk/scheme/link] + \draw (els entry) -- (els init ls); + + \draw (els init ls) -- (els loopbegin); + + \draw (els loopbegin) -- (els split); + + \draw (els split.210) -- (els serial0.north); + \draw (els split.330) -- (els serialn.north); + + \draw (els serial0.north) -- (els m0); + \draw (els serialn.north) -- (els mn); + + \draw (els m0) -- (els ls0); + \draw (els mn) -- (els lsn); + + \draw (els ls0) -- (els serial0.south); + \draw (els lsn) -- (els serialn.south); + + \draw (els serial0.south) -- (els merge.150); + \draw (els serialn.south) -- (els merge.30); + + \draw (els merge) -- (els select2); + + \draw (els select2) -- (els select3); + \draw (els select3) -- (els accept); + \draw (els accept) -- (els loopend); + \end{scope} + + \draw[alsk/scheme/link] (els loopend) -| +(-12mm, 0) |- ([xshift=-6mm]els loopbegin.west) + -- (els loopbegin); + + \draw[alsk/scheme/link] (els loopend) -- (els return); + \end{scope} + + \spy[densely dotted,thick,colMuscle] on (els) in node at (grasp ls0); + \spy[densely dotted,thick,colMuscle,connect spies] on (els) in node at (grasp lsn); + \end{scope} + + % Bounding box adjustments + \node[rectangle,fit=(els)(els entry)(els return),fit margins={right=3mm}]{}; +\end{tikzpicture} diff --git a/src/fig/alsk/seq.tex b/src/fig/alsk/seq.tex new file mode 100644 index 0000000..e3f223e --- /dev/null +++ b/src/fig/alsk/seq.tex @@ -0,0 +1,12 @@ +\begin{tikzpicture} + \input{src/tikz/parallel} + + \begin{scope}[node distance=8mm] + \begin{scope}[start chain=going below,every node/.style={on chain,join},parallel/arrow] + \node[parallel/block] (input) {}; + \node[parallel/task] (main) {T\textsubscript{0}}; + \node[parallel/task] (main) {T\textsubscript{1}}; + \node[parallel/block] (output) {}; + \end{scope} + \end{scope} +\end{tikzpicture} diff --git a/src/fig/alsk/tree_grasp.tex b/src/fig/alsk/tree_grasp.tex new file mode 100644 index 0000000..b61b3b4 --- /dev/null +++ b/src/fig/alsk/tree_grasp.tex @@ -0,0 +1,6 @@ +\begin{tikzpicture} + \input{src/tikz/alsk} + \begin{scope}[alsk/treestyle] + \Tree[.FarmSel [.Serial CH LS ] S ] + \end{scope} +\end{tikzpicture} diff --git a/src/fig/app/graspels.tex b/src/fig/app/graspels.tex new file mode 100644 index 0000000..e603072 --- /dev/null +++ b/src/fig/app/graspels.tex @@ -0,0 +1,133 @@ +\begin{tikzpicture} + \input{src/tikz/alsk} + + \tikzset{split/.style={alsk/scheme/split,minimum width=8mm}} + \tikzset{task/.style={alsk/scheme/task,minimum width=6mm}} + \tikzset{join/.style={alsk/scheme/join,minimum width=8mm}} + \tikzset{loop/.style={alsk/scheme/loop,minimum width=6mm}} + \tikzset{frame/.style={alsk/scheme/frame=#1,inner sep=.5mm}} + + % GRASP nodes + \matrix[row sep=2.5mm, column sep=-1mm] { + & \node[split,minimum width=8mm] (grasp split) {}; \\ + \\ + \node[task] (grasp ch0) {\scriptsize CH}; & \node[alsk/label] (grasp chi) {\scriptsize\dots}; & + \node[task] (grasp chn) {\scriptsize CH}; \\ + \node[task] (grasp ls0) {}; & \node[alsk/label] (grasp lsi) {\scriptsize\dots}; & + \node[task] (grasp lsn) {}; \\ + \\ + & \node[join] (grasp merge) {}; \\ + & \node[task] (grasp select) {\scriptsize Sel\textsubscript{1}}; \\ + }; + + \node[above=3mm of grasp split] (grasp entry) {}; + \node[below=3mm of grasp select] (grasp return) {}; + + % Frames + \node[frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(grasp ch0)(grasp ls0)] (grasp serial0) {}; + \node[frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(grasp chn)(grasp lsn)] (grasp serialn) {}; + + \node[frame=colStruct,fit margins={top=1.5mm,bottom=1.5mm}, + fit=(grasp split)(grasp select)(grasp serial0)(grasp serialn)] {}; + + % GRASP Links + \begin{scope}[alsk/scheme/link] + \draw (grasp entry) -- (grasp split); + + \draw (grasp split.210) -- (grasp serial0.north); + \draw (grasp split.330) -- (grasp serialn.north); + + \draw (grasp serial0.north) -- (grasp ch0); + \draw (grasp serialn.north) -- (grasp chn); + + \draw (grasp ch0) -- (grasp ls0); + \draw (grasp chn) -- (grasp lsn); + + \draw (grasp ls0) -- (grasp serial0.south); + \draw (grasp lsn) -- (grasp serialn.south); + + \draw (grasp serial0.south) -- (grasp merge.150); + \draw (grasp serialn.south) -- (grasp merge.30); + + \draw (grasp merge) -- (grasp select); + + \draw (grasp select) -- (grasp return); + \end{scope} + + % ELS + \begin{scope}[common/overlay,spy using outlines={circle,magnification=.095,size=6.0mm}] + \begin{scope}[every node/.append style={transform shape,scale=.7}] + \matrix[row sep=1.5mm, column sep=-1mm] (els) at (5, 0) { + & \node[task] (els init ls) {\scriptsize iLS}; \\ + & \node[loop] (els loopbegin) {}; \\ + & \node[split] (els split) {}; \\ + \\ + \node[task] (els m0) {\scriptsize M}; & \node[alsk/label] (els mi) {\dots}; & + \node[task] (els mn) {\scriptsize M}; \\ + \node[task] (els ls0) {\scriptsize LS}; & \node[alsk/label] (els lsi) {\dots}; & + \node[task] (els lsn) {\scriptsize LS}; \\ + \\ + & \node[join] (els merge) {}; \\ + & \node[task] (els select2) {\scriptsize Sel\textsubscript{2}}; \\ + & \node[task] (els select3) {\scriptsize Sel\textsubscript{3}}; \\ + & \node[task] (els accept) {\scriptsize A}; \\ + & \node[loop] (els loopend) {}; \\ + }; + + \node[above=1.5mm of els init ls] (els entry) {}; + \node[below=1.5mm of els loopend] (els return) {}; + + % Frames + \node[frame=colStruct,fit margins={top=2mm,bottom=2mm,left=1.2mm,right=1.2mm}, + fit=(els m0)(els ls0)] (els serial0) {}; + \node[frame=colStruct,fit margins={top=2mm,bottom=2mm,left=1.2mm,right=1.2mm}, + fit=(els mn)(els lsn)] (els serialn) {}; + + \node[frame=colStruct,fit margins={top=4.4mm,bottom=4mm,left=2.8mm,right=2.8mm}, + fit=(els split)(els select2)(els serial0)(els serialn)] {}; + + % Links + \begin{scope}[alsk/scheme/link] + \draw (els entry) -- (els init ls); + + \draw (els init ls) -- (els loopbegin); + + \draw (els loopbegin) -- (els split); + + \draw (els split.210) -- (els serial0.north); + \draw (els split.330) -- (els serialn.north); + + \draw (els serial0.north) -- (els m0); + \draw (els serialn.north) -- (els mn); + + \draw (els m0) -- (els ls0); + \draw (els mn) -- (els lsn); + + \draw (els ls0) -- (els serial0.south); + \draw (els lsn) -- (els serialn.south); + + \draw (els serial0.south) -- (els merge.150); + \draw (els serialn.south) -- (els merge.30); + + \draw (els merge) -- (els select2); + + \draw (els select2) -- (els select3); + \draw (els select3) -- (els accept); + \draw (els accept) -- (els loopend); + \end{scope} + + \draw[alsk/scheme/link] (els loopend) -| +(-12mm, 0) |- ([xshift=-6mm]els loopbegin.west) + -- (els loopbegin); + + \draw[alsk/scheme/link] (els loopend) -- (els return); + \end{scope} + + \spy[densely dotted,thick,colMuscle] on (els) in node at (grasp ls0); + \spy[densely dotted,thick,colMuscle,connect spies] on (els) in node at (grasp lsn); + \end{scope} + + % Bounding box adjustments + \node[rectangle,fit=(els)(els entry)(els return),fit margins={right=3mm}]{}; +\end{tikzpicture} diff --git a/src/fig/app/tspels.tex b/src/fig/app/tspels.tex new file mode 100644 index 0000000..9526641 --- /dev/null +++ b/src/fig/app/tspels.tex @@ -0,0 +1,104 @@ +\begin{tikzpicture} + \input{src/tikz/tsp} + + \tspnodes + + \def\bhstep{2.6} + \def\shstep{.75} + \def\vstep{-1.5} + \def\ratioodd{.666} + \def\ratioeven{.85} + + %{{{ first line " + \def\cl{1} + \begin{scope}[visible on=<3->,every path/.append style={visible on=<3->}] + \foreach \i in {0,...,\last} { + \coordinate (p-\cl-\i) at ($(p\i)!\ratioodd!(0,0)+(0,\vstep*\cl)$); + \node[tsp/node,minimum size=2pt] at (p-\cl-\i) {}; + } + + %{{{ boxes " + \begin{scope}[on background layer] + \node[fit=(p-\cl-0)(p-\cl-1)(p-\cl-2)(p-\cl-3)(p-\cl-4)(p-\cl-5)(p-\cl-6)(p-\cl-7)(p-\cl-8)(p-\cl-9), + rectangle,rounded corners] (sol-\cl) {}; + \end{scope} + %}}} + + \foreach [count=\i from 0] \o in {2,1,0,9,8,7,4,3,5,6} { \coordinate (s-\cl-\i) at (p-\cl-\o); } + \begin{scope}[on background layer] + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1)}] (s-\cl-0) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + \end{scope} + %}}} + + %{{{ second line " + \def\cl{2} + \begin{scope}[visible on=<4->,every path/.append style={visible on=<4->}] + \foreach \l in {0,...,2} { + \foreach \i in {0,...,\last} { + \coordinate (p-\cl-\i-\l) at ($(p\i)!\ratioeven!(0,0)+(\shstep*\l-.47,\vstep*\cl+.5)$); + \node[tsp/node,minimum size=1pt] at (p-\cl-\i-\l) {}; + } + + % box + \begin{scope}[on background layer] + \ifthenelse{\l=2} + {\tikzset{local/.style={only on=<5>{tsp/best,thin}}}} + {\tikzset{local/.style={}}} + \node[fit=(p-\cl-0-\l)(p-\cl-1-\l)(p-\cl-2-\l)(p-\cl-3-\l)(p-\cl-4-\l)(p-\cl-5-\l)(p-\cl-6-\l)(p-\cl-7-\l)(p-\cl-8-\l)(p-\cl-9-\l), + local,rectangle,rounded corners,inner sep=1pt] (sol-\cl-\l) {}; + \end{scope} + } + + %{{{ third column " + \foreach [count=\i from 0] \o in {2,1,0,4,8,7,9,3,5,6} { \coordinate (s-\cl-\i-0) at (p-\cl-\o-0); } + \foreach [count=\i from 0] \o in {2,3,0,9,8,7,4,1,5,6} { \coordinate (s-\cl-\i-1) at (p-\cl-\o-1); } + \foreach [count=\i from 0] \o in {2,1,0,9,8,7,4,6,5,3} { \coordinate (s-\cl-\i-2) at (p-\cl-\o-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-0)}] (s-\cl-0-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-1)}] (s-\cl-0-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-2)}] (s-\cl-0-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + \end{scope} + %}}} + + %{{{ third line " + \def\cl{3} + \begin{scope}[visible on=<6->,every path/.append style={visible on=<6->}] + \foreach \i in {0,...,\last} { + \coordinate (p-\cl-\i) at ($(p\i)!\ratioodd!(0,0)+(0,\vstep*\cl+.5)$); + \node[tsp/node,minimum size=2pt] at (p-\cl-\i) {}; + } + + \foreach [count=\i from 0] \o in {2,1,0,9,8,7,4,6,5,3} { \coordinate (s-\cl-\i) at (p-\cl-\o); } + \foreach \i in {0,...,\last} { + \node[tsp/node,minimum size=2pt] at (p-\cl-\i) {}; + } + + %{{{ boxes " + \begin{scope}[on background layer] + \node[fit=(p-\cl-0)(p-\cl-1)(p-\cl-2)(p-\cl-3)(p-\cl-4)(p-\cl-5)(p-\cl-6)(p-\cl-7)(p-\cl-8)(p-\cl-9), + rectangle,rounded corners] (sol-\cl) {}; + \end{scope} + %}}} + + \begin{scope}[on background layer] + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1)}] (s-\cl-0) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + \end{scope} + %}}} + + %{{{ links " + \foreach \l in {0,...,2} { + \draw[<-,>=stealth,visible on=<4->] (sol-2-\l) -- (sol-1); + } + \foreach \l in {0,...,2} { + \draw[->,>=stealth,visible on=<6->] (sol-2-\l) -- (sol-3); + } + %}}} + + %{{{ loop " + \draw[->,>=stealth,semithick,rounded corners,visible on=<7>] (sol-3.south) -- ++(0,-3mm) -| ([xshift=-5mm]sol-1.west) -- (sol-1); + %}}} +\end{tikzpicture} diff --git a/src/fig/app/tspgraspels.tex b/src/fig/app/tspgraspels.tex new file mode 100644 index 0000000..0dc8e46 --- /dev/null +++ b/src/fig/app/tspgraspels.tex @@ -0,0 +1,330 @@ +\begin{tikzpicture} + \input{src/tikz/tsp} + + \tspnodes + + \def\bhstep{2.6} + \def\shstep{.75} + \def\vstep{-1.5} + \def\ratioodd{.666} + \def\ratioeven{.85} + + %{{{ first line " + \def\cl{1} + \begin{scope}[visible on=<1->,every path/.append style={visible on=<1->}] + \foreach \i in {0,...,\last} { + \foreach \j in {0,...,3} { + \coordinate (p-\cl-\i-\j) at ($(p\i)!\ratioodd!(0,0)+(\bhstep*\j,\vstep*\cl)$); + \node[tsp/node,minimum size=2pt] at (p-\cl-\i-\j) {}; + } + } + + %{{{ boxes " + \begin{scope}[on background layer] + \def\cc{0} + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{1} + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{2} + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{3} + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + %}}} + + \foreach [count=\i from 0] \o in {0,9,1,8,7,6,4,2,3,5} { \coordinate (s-\cl-\i-0) at (p-\cl-\o-0); } + \foreach [count=\i from 0] \o in {4,5,3,6,8,7,1,2,0,9} { \coordinate (s-\cl-\i-1) at (p-\cl-\o-1); } + \foreach [count=\i from 0] \o in {2,1,0,9,8,7,4,3,5,6} { \coordinate (s-\cl-\i-2) at (p-\cl-\o-2); } + \foreach [count=\i from 0] \o in {8,7,6,4,5,1,9,0,2,3} { \coordinate (s-\cl-\i-3) at (p-\cl-\o-3); } + \begin{scope}[on background layer] + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-0)}] (s-\cl-0-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-1)}] (s-\cl-0-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-2)}] (s-\cl-0-2) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-3)}] (s-\cl-0-3) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + \end{scope} + %}}} + + %{{{ second line " + \def\cl{2} + \begin{scope}[visible on=<2->,every path/.append style={visible on=<2->}] + \foreach \j in {0,...,3} { + \foreach \l in {0,...,2} { + \foreach \i in {0,...,\last} { + \coordinate (p-\cl-\i-\j-\l) at ($(p\i)!\ratioeven!(0,0)+(\bhstep*\j+\shstep*\l-.47,\vstep*\cl+.5)$); + \node[tsp/node,minimum size=1pt] at (p-\cl-\i-\j-\l) {}; + } + + % box + \begin{scope}[on background layer] + \ifthenelse{\(\j=0 \AND \l=1\) \OR \(\j=1 \AND \l=0\) \OR \(\j=2 \AND \l=2\) \OR \(\j=3 \AND \l=2\)} + {\tikzset{local/.style={only on=<3>{tsp/best,thin}}}} + {\tikzset{local/.style={}}} + \node[fit=(p-\cl-0-\j-\l)(p-\cl-1-\j-\l)(p-\cl-2-\j-\l)(p-\cl-3-\j-\l)(p-\cl-4-\j-\l)(p-\cl-5-\j-\l)(p-\cl-6-\j-\l)(p-\cl-7-\j-\l)(p-\cl-8-\j-\l)(p-\cl-9-\j-\l), + local,rectangle,rounded corners,inner sep=1pt] (sol-\cl-\j-\l) {}; + \end{scope} + } + } + + %{{{ first column " + \foreach [count=\i from 0] \o in {0,9,8,1,7,6,4,2,3,5} { \coordinate (s-\cl-\i-0-0) at (p-\cl-\o-0-0); } + \foreach [count=\i from 0] \o in {0,9,1,8,7,6,4,5,3,2} { \coordinate (s-\cl-\i-0-1) at (p-\cl-\o-0-1); } + \foreach [count=\i from 0] \o in {0,2,1,8,7,6,4,9,3,5} { \coordinate (s-\cl-\i-0-2) at (p-\cl-\o-0-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-0-0)}] (s-\cl-0-0-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-0-1)}] (s-\cl-0-0-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-0-2)}] (s-\cl-0-0-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + %{{{ second column " + \foreach [count=\i from 0] \o in {4,5,3,6,8,7,1,9,0,2} { \coordinate (s-\cl-\i-1-0) at (p-\cl-\o-1-0); } + \foreach [count=\i from 0] \o in {4,3,5,6,8,7,1,2,0,9} { \coordinate (s-\cl-\i-1-1) at (p-\cl-\o-1-1); } + \foreach [count=\i from 0] \o in {4,5,3,2,8,7,1,6,0,9} { \coordinate (s-\cl-\i-1-2) at (p-\cl-\o-1-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-1-0)}] (s-\cl-0-1-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-1-1)}] (s-\cl-0-1-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-1-2)}] (s-\cl-0-1-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + %{{{ third column " + \foreach [count=\i from 0] \o in {2,1,0,4,8,7,9,3,5,6} { \coordinate (s-\cl-\i-2-0) at (p-\cl-\o-2-0); } + \foreach [count=\i from 0] \o in {2,3,0,9,8,7,4,1,5,6} { \coordinate (s-\cl-\i-2-1) at (p-\cl-\o-2-1); } + \foreach [count=\i from 0] \o in {2,1,0,9,8,7,4,6,5,3} { \coordinate (s-\cl-\i-2-2) at (p-\cl-\o-2-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-2-0)}] (s-\cl-0-2-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-2-1)}] (s-\cl-0-2-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-2-2)}] (s-\cl-0-2-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + %{{{ fourth column " + \foreach [count=\i from 0] \o in {8,1,6,4,5,7,9,0,2,3} { \coordinate (s-\cl-\i-3-0) at (p-\cl-\o-3-0); } + \foreach [count=\i from 0] \o in {8,4,6,7,5,1,9,0,2,3} { \coordinate (s-\cl-\i-3-1) at (p-\cl-\o-3-1); } + \foreach [count=\i from 0] \o in {5,7,6,4,8,1,9,0,2,3} { \coordinate (s-\cl-\i-3-2) at (p-\cl-\o-3-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-3-0)}] (s-\cl-0-3-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-3-1)}] (s-\cl-0-3-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-3-2)}] (s-\cl-0-3-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + \end{scope} + %}}} + + %{{{ third line " + \def\cl{3} + \begin{scope}[visible on=<4->,every path/.append style={visible on=<4->}] + \foreach \i in {0,...,\last} { + \foreach \j in {0,...,3} { + \coordinate (p-\cl-\i-\j) at ($(p\i)!\ratioodd!(0,0)+(\bhstep*\j,\vstep*\cl+.5)$); + \node[tsp/node,minimum size=2pt] at (p-\cl-\i-\j) {}; + } + } + + \foreach [count=\i from 0] \o in {0,9,1,8,7,6,4,5,3,2} { \coordinate (s-\cl-\i-0) at (p-\cl-\o-0); } + \foreach [count=\i from 0] \o in {4,5,3,6,8,7,1,9,0,2} { \coordinate (s-\cl-\i-1) at (p-\cl-\o-1); } + \foreach [count=\i from 0] \o in {2,1,0,9,8,7,4,6,5,3} { \coordinate (s-\cl-\i-2) at (p-\cl-\o-2); } + \foreach [count=\i from 0] \o in {5,7,6,4,8,1,9,0,2,3} { \coordinate (s-\cl-\i-3) at (p-\cl-\o-3); } + \foreach \j in {0,...,3} { + \foreach \i in {0,...,\last} { + \node[tsp/node,minimum size=2pt] at (p-\cl-\i-\j) {}; + } + } + + %{{{ boxes " + \begin{scope}[on background layer] + \def\cc{0}% best + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + only on=<4-7>{tsp/best},only on=<8>{tsp/localbest},rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{1}% best + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + only on=<4-7>{tsp/best},only on=<8>{tsp/localbest},rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{2} + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + only on=<4-6>{tsp/best},rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{3} + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + only on=<4-6>{tsp/best},rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + %}}} + + \begin{scope}[on background layer] + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-0)}] (s-\cl-0-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-1)}] (s-\cl-0-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-2)}] (s-\cl-0-2) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-3)}] (s-\cl-0-3) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + \end{scope} + %}}} + + %{{{ fourth line " + \def\cl{4} + \begin{scope}[visible on=<5->,every path/.append style={visible on=<5->}] + \foreach \j in {0,...,3} { + \foreach \l in {0,...,2} { + \foreach \i in {0,...,\last} { + \coordinate (p-\cl-\i-\j-\l) at ($(p\i)!\ratioeven!(0,0)+(\bhstep*\j+\shstep*\l-.47,\vstep*\cl+1)$); + \node[tsp/node,minimum size=1pt] at (p-\cl-\i-\j-\l) {}; + } + + % box + \begin{scope}[on background layer] + \ifthenelse{\(\j=0 \AND \l=2\) \OR \(\j=1 \AND \l=0\) \OR \(\j=2 \AND \l=1\) \OR \(\j=3 \AND \l=0\)} + {\tikzset{local/.style={only on=<6>{tsp/best,thin}}}} + {\tikzset{local/.style={}}} + \node[fit=(p-\cl-0-\j-\l)(p-\cl-1-\j-\l)(p-\cl-2-\j-\l)(p-\cl-3-\j-\l)(p-\cl-4-\j-\l)(p-\cl-5-\j-\l)(p-\cl-6-\j-\l)(p-\cl-7-\j-\l)(p-\cl-8-\j-\l)(p-\cl-9-\j-\l), + local,rectangle,rounded corners,inner sep=1pt] (sol-\cl-\j-\l) {}; + \end{scope} + } + } + + %{{{ first column " + \foreach [count=\i from 0] \o in {0,1,9,8,7,6,4,5,3,2} { \coordinate (s-\cl-\i-0-0) at (p-\cl-\o-0-0); } + \foreach [count=\i from 0] \o in {0,9,3,8,7,6,4,5,1,2} { \coordinate (s-\cl-\i-0-1) at (p-\cl-\o-0-1); } + \foreach [count=\i from 0] \o in {0,9,1,8,7,6,5,4,3,2} { \coordinate (s-\cl-\i-0-2) at (p-\cl-\o-0-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-0-0)}] (s-\cl-0-0-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-0-1)}] (s-\cl-0-0-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-0-2)}] (s-\cl-0-0-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + %{{{ second column " + \foreach [count=\i from 0] \o in {5,4,3,6,8,7,1,9,0,2} { \coordinate (s-\cl-\i-1-0) at (p-\cl-\o-1-0); } + \foreach [count=\i from 0] \o in {8,5,3,6,4,7,1,9,0,2} { \coordinate (s-\cl-\i-1-1) at (p-\cl-\o-1-1); } + \foreach [count=\i from 0] \o in {7,5,3,6,8,4,1,9,0,2} { \coordinate (s-\cl-\i-1-2) at (p-\cl-\o-1-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-1-0)}] (s-\cl-0-1-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-1-1)}] (s-\cl-0-1-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-1-2)}] (s-\cl-0-1-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + %{{{ third column " + \foreach [count=\i from 0] \o in {2,8,0,9,1,7,4,6,5,3} { \coordinate (s-\cl-\i-2-0) at (p-\cl-\o-2-0); } + \foreach [count=\i from 0] \o in {2,1,0,9,8,7,6,4,5,3} { \coordinate (s-\cl-\i-2-1) at (p-\cl-\o-2-1); } + \foreach [count=\i from 0] \o in {2,1,0,5,8,7,4,6,9,3} { \coordinate (s-\cl-\i-2-2) at (p-\cl-\o-2-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-2-0)}] (s-\cl-0-2-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-2-1)}] (s-\cl-0-2-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-2-2)}] (s-\cl-0-2-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + %{{{ fourth column " + \foreach [count=\i from 0] \o in {5,6,7,4,8,1,9,0,2,3} { \coordinate (s-\cl-\i-3-0) at (p-\cl-\o-3-0); } + \foreach [count=\i from 0] \o in {5,7,6,4,8,1,3,0,2,9} { \coordinate (s-\cl-\i-3-1) at (p-\cl-\o-3-1); } + \foreach [count=\i from 0] \o in {5,7,6,4,2,1,9,0,8,3} { \coordinate (s-\cl-\i-3-2) at (p-\cl-\o-3-2); } + \begin{scope}[on background layer] + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-3-0)}] (s-\cl-0-3-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-3-1)}] (s-\cl-0-3-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,very thin,foreach/.style={insert path=--(s-\cl-#1-3-2)}] (s-\cl-0-3-2) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + %}}} + \end{scope} + %}}} + + %{{{ fifth line " + \def\cl{5} + \begin{scope}[visible on=<7->,every path/.append style={visible on=<7->}] + \foreach \i in {0,...,\last} { + \foreach \j in {0,...,3} { + \coordinate (p-\cl-\i-\j) at ($(p\i)!\ratioodd!(0,0)+(\bhstep*\j,\vstep*\cl+1)$); + \node[tsp/node,minimum size=2pt] at (p-\cl-\i-\j) {}; + } + } + + \foreach [count=\i from 0] \o in {0,9,1,8,7,6,5,4,3,2} { \coordinate (s-\cl-\i-0) at (p-\cl-\o-0); } + \foreach [count=\i from 0] \o in {5,4,3,6,8,7,1,9,0,2} { \coordinate (s-\cl-\i-1) at (p-\cl-\o-1); } + \foreach [count=\i from 0] \o in {2,1,0,9,8,7,6,4,5,3} { \coordinate (s-\cl-\i-2) at (p-\cl-\o-2); } + \foreach [count=\i from 0] \o in {5,6,7,4,8,1,9,0,2,3} { \coordinate (s-\cl-\i-3) at (p-\cl-\o-3); } + \foreach \j in {0,...,3} { + \foreach \i in {0,...,\last} { + \node[tsp/node,minimum size=2pt] at (p-\cl-\i-\j) {}; + } + } + + %{{{ boxes " + \begin{scope}[on background layer] + \def\cc{0} + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{1} + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{2}% best all + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + only on=<7-8>{tsp/best},rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + \begin{scope}[on background layer] + \def\cc{3}% best + \node[fit=(p-\cl-0-\cc)(p-\cl-1-\cc)(p-\cl-2-\cc)(p-\cl-3-\cc)(p-\cl-4-\cc)(p-\cl-5-\cc)(p-\cl-6-\cc)(p-\cl-7-\cc)(p-\cl-8-\cc)(p-\cl-9-\cc), + only on=<7>{tsp/best},only on=<8>{tsp/localbest},rectangle,rounded corners] (sol-\cl-\cc) {}; + \end{scope} + %}}} + + \begin{scope}[on background layer] + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-0)}] (s-\cl-0-0) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-1)}] (s-\cl-0-1) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-2)}] (s-\cl-0-2) [foreach/.list={1,...,\last}] -- cycle; + \draw[tsp/edge,semithick,foreach/.style={insert path=--(s-\cl-#1-3)}] (s-\cl-0-3) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} + \end{scope} + %}}} + + %{{{ links " + \foreach \cl/\nl/\vi in {1/2/2,3/4/5} { + \foreach \j in {0,...,3} { + \foreach \l in {0,...,2} { + \draw[<-,>=stealth,visible on=<\vi->] (sol-\nl-\j-\l) -- (sol-\cl-\j); + } + } + } + \foreach \cl/\nl/\vi in {2/3/4,4/5/7} { + \foreach \j in {0,...,3} { + \foreach \l in {0,...,2} { + \draw[->,>=stealth,visible on=<\vi->] (sol-\cl-\j-\l) -- (sol-\nl-\j); + } + } + } + %}}} + + %{{{ + \begin{scope}[on background layer] + \foreach \i in {0,...,3} { + \node[fit=(sol-1-\i)(sol-2-\i-0)(sol-2-\i-1)(sol-2-\i-2)(sol-5-\i), + draw,rectangle,rounded corners,dashed,thin,inner sep=2pt,visible on=<9->] (els-\i) {}; + \node[node distance=.5pt,above=of els-\i,visible on=<9->] (els-\i-label) {\scriptsize ELS}; + } + + \node[fit=(els-0-label)(els-1-label)(els-2-label)(els-3-label),fill=green!70!black,rectangle,rounded + corners,opacity=.1,fit margins={top=.25pt,bottom=.25pt,left=11pt,right=11pt},visible on=<9->] {}; + + \foreach \i in {0,...,3} { + \foreach \cl in {2,4} { + \node[fit=(sol-\cl-\i-0)(sol-\cl-\i-1)(sol-\cl-\i-2),fill=green!70!black,rectangle,rounded + corners,opacity=.1,inner sep=2pt,visible on=<9->] {}; + } + } + \end{scope} + %}}} + + \only<10>{ + + } +\end{tikzpicture} diff --git a/src/fig/app/tspgreedysolution.tex b/src/fig/app/tspgreedysolution.tex new file mode 100644 index 0000000..2aaf338 --- /dev/null +++ b/src/fig/app/tspgreedysolution.tex @@ -0,0 +1,35 @@ +\begin{tikzpicture} + \input{src/tikz/tsp} + + \tspnodes + + % \def\tspstart{0} + + \coordinate (E) at (p\tspstart); + + \ifthenelse{\tspstart=0}{\def\tspsolution{0,9,1,8,7,6,4,2,3,5}}{} + \ifthenelse{\tspstart=1}{\def\tspsolution{1,8,7,9,0,2,4,5,6,3}}{} + \ifthenelse{\tspstart=2}{\def\tspsolution{2,1,0,9,8,7,4,3,5,6}}{} + \ifthenelse{\tspstart=3}{\def\tspsolution{3,4,5,6,8,7,1,2,0,9}}{} + \ifthenelse{\tspstart=4}{\def\tspsolution{4,5,3,6,8,7,1,2,0,9}}{} + \ifthenelse{\tspstart=5}{\def\tspsolution{5,4,3,6,8,7,1,2,0,9}}{} + \ifthenelse{\tspstart=6}{\def\tspsolution{6,4,5,3,8,7,1,2,0,9}}{} + \ifthenelse{\tspstart=7}{\def\tspsolution{7,8,6,4,5,1,9,0,2,3}}{} + \ifthenelse{\tspstart=8}{\def\tspsolution{8,7,6,4,5,1,9,0,2,3}}{} + \ifthenelse{\tspstart=9}{\def\tspsolution{9,0,1,8,7,6,4,5,3,2}}{} + + \foreach [count=\i from 0] \o in \tspsolution { + \coordinate (s\i) at (p\o); + } + + \foreach \i in {0,...,\last} { + \node[tsp/node] at (p\i) {}; + } + \node[tsp/node,common/drawfillf={black}{20}] at (E) {}; + + \ifthenelse{\istep=0}{}{ + \begin{scope}[on background layer] + \draw[tsp/edge,foreach/.style={insert path=--(s#1)}] (E) [foreach/.list={1,...,\istep}] -- cycle; + \end{scope} + } +\end{tikzpicture} diff --git a/src/fig/app/tspinstance.tex b/src/fig/app/tspinstance.tex new file mode 100644 index 0000000..6b5d7da --- /dev/null +++ b/src/fig/app/tspinstance.tex @@ -0,0 +1,18 @@ +\begin{tikzpicture} + \input{src/tikz/tsp} + + \tspnodes + + \foreach \i in {0,...,\last} { + \node[tsp/node] at (p\i) {}; + } + + \begin{scope}[on background layer] + \foreach \i in {0,...,\penult} { + \pgfmathtruncatemacro{\b}{\i+1} + \foreach \j in {\b,...,\last} { + \draw[black!40] (p\i) -- (p\j); + } + } + \end{scope} +\end{tikzpicture} diff --git a/src/fig/app/tspopti.tex b/src/fig/app/tspopti.tex new file mode 100644 index 0000000..50fca10 --- /dev/null +++ b/src/fig/app/tspopti.tex @@ -0,0 +1,18 @@ +\begin{tikzpicture}[thick] + \input{src/tikz/tsp} + + \tspnodes + + \coordinate (s0) at (p0); + \foreach [count=\i] \o in {1,2,3,5,4,6,7,8,9} { + \coordinate (s\i) at (p\o); + } + + \foreach \i in {0,...,\last} { + \node[tsp/node] at (p\i) {}; + } + + \begin{scope}[on background layer] + \draw[tsp/edge,foreach/.style={insert path=--(s#1)}] (p0) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/app/tsprp.tex b/src/fig/app/tsprp.tex new file mode 100644 index 0000000..cc1d790 --- /dev/null +++ b/src/fig/app/tsprp.tex @@ -0,0 +1,9 @@ +\begin{tikzpicture}[remember picture] + \input{src/tikz/tsp} + + \tspnodes + + \foreach \i in {0,...,\last} { + \node[tsp/node,draw=none,fill=none] (tsp node \i) at (p\i) {}; + } +\end{tikzpicture} diff --git a/src/fig/app/tspsolution.tex b/src/fig/app/tspsolution.tex new file mode 100644 index 0000000..1704409 --- /dev/null +++ b/src/fig/app/tspsolution.tex @@ -0,0 +1,18 @@ +\begin{tikzpicture}[thick] + \input{src/tikz/tsp} + + \tspnodes + + \coordinate (s0) at (p0); + \foreach [count=\i] \o in {2,3,1,4,5,8,6,7,9} { + \coordinate (s\i) at (p\o); + } + + \foreach \i in {0,...,\last} { + \node[tsp/node] at (p\i) {}; + } + + \begin{scope}[on background layer] + \draw[tsp/edge,foreach/.style={insert path=--(s#1)}] (p0) [foreach/.list={1,...,\last}] -- cycle; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/context/farmsel.tex b/src/fig/context/farmsel.tex new file mode 100644 index 0000000..3f944a8 --- /dev/null +++ b/src/fig/context/farmsel.tex @@ -0,0 +1,26 @@ +\begin{tikzpicture} + \input{src/tikz/parallel} + + \begin{scope}[node distance=6mm] + \begin{scope}[start chain=going below,every node/.style={on chain,join},parallel/arrow] + \node[parallel/block] (input) {}; + \node[parallel/point] (fork) {}; + \node[parallel/task] (main) {\dots}; + \node[parallel/point] (join) {}; + \node[parallel/task] (select) {T\textsubscript{S}}; + \node[parallel/block] (output) {}; + \end{scope} + + \node[parallel/task,left=of main] (thread 0) {T\textsubscript{0}}; + \node[parallel/task,right=of main] (thread n) {T\textsubscript{n-1}}; + \end{scope} + + \begin{scope}[on background layer] + \node[parallel/region=(thread 0)(main)(thread n)] {}; + \end{scope} + + \begin{scope}[parallel/arrow] + \draw (fork) -| (thread 0) |- (join); + \draw (fork) -| (thread n) |- (join); + \end{scope} +\end{tikzpicture} diff --git a/src/fig/context/par.tex b/src/fig/context/par.tex new file mode 100644 index 0000000..585719e --- /dev/null +++ b/src/fig/context/par.tex @@ -0,0 +1,31 @@ +\begin{tikzpicture} + \input{src/tikz/orchestration} + + \begin{scope}[overlay] + \node(origin){}; + \node at (origin) (t-1) {}; + \end{scope} + + \begin{scope}[node distance=4mm and 12mm] + \node[orch/task=black,right=of t-1] (t0) {m\textsubscript{0}}; + \node[orch/task=black,right=of t0] (t1) {m\textsubscript{1}}; + \node[orch/task=white,draw=none,fill=none,node distance=6mm,right=of t1] (t2) {\dots}; + \node[orch/task=black,node distance=6mm,right=of t2] (t3) {m\textsubscript{N-2}}; + \node[orch/task=black,right=of t3] (t4) {m\textsubscript{N-1}}; + + \foreach \i/\t in {0/0,1/1,3/N-2,4/N-1} { + \node[above=of t\i] (label\i) {\en{thread}~\t}; + \node[below=of t\i] (endthread\i) {}; + } + \end{scope} + + \foreach \i in {0,1,3,4} { + \draw[-] (label\i) -- (t\i); + \draw[-] (t\i) -- (endthread\i); + } + + \begin{scope}[on background layer] + \node[common/drawfill=green!40!black,dashed,rectangle,rounded corners,fit=(t0)(t4)](par){}; + \end{scope} +\end{tikzpicture} + diff --git a/src/fig/context/seq.tex b/src/fig/context/seq.tex new file mode 100644 index 0000000..ca33ee3 --- /dev/null +++ b/src/fig/context/seq.tex @@ -0,0 +1,31 @@ +\begin{tikzpicture} + \input{src/tikz/orchestration} + + \begin{scope}[overlay] + \node(origin){}; + \node at (origin) (t-1) {}; + \end{scope} + + \begin{scope}[node distance=4mm and 4mm] + \node[orch/task=black,below=of t-1] (t0) {m\textsubscript{0}}; + \node[orch/task=white,draw=none,fill=none,below=of t0] (t1) {}; + \node[orch/task=black,below=of t1] (t2) {m\textsubscript{N-1}}; + + \node[above=of t0] (label0) {\en{thread}~0}; + \node[below=of t2] (endthread0) {}; + \end{scope} + + \draw[-] (label0) -- (t0); + + \draw[-] (t0) -- (t1); + \draw[dashed] (t1.north) -- (t1.south); + \draw[-] (t1) -- (t2); + + \draw[-] (t2) -- (endthread0); + + \begin{scope}[common/overlay] + \draw[decorate,decoration={brace, amplitude=4pt, raise=9mm, mirror}] + (t0.north) -- (t2.south) node[left,midway,xshift=-11mm] {$N$ tâches}; + \end{scope} +\end{tikzpicture} + diff --git a/src/fig/context/threadpool.tex b/src/fig/context/threadpool.tex new file mode 100644 index 0000000..330a52f --- /dev/null +++ b/src/fig/context/threadpool.tex @@ -0,0 +1,51 @@ +\begin{tikzpicture} + \input{src/tikz/exec} + + % pool + \begin{scope}[start chain=circle placed {at=(\tikzchaincount*72+18:.8)}] + \foreach \i in {0,...,4} { + \node[on chain,exec/thread=black] (t\i) {t\textsubscript{\i}}; + } + \end{scope} + \path (t0) |- node[pos=.2,exec/thread=black]{t\textsubscript{k}} ($(t2)!.5!(t3)$); + + \begin{scope}[on background layer] + \node[exec/pool=(t0)(t1)(t2)(t3)(t4)](pool){}; + \end{scope} + \path (pool.north west) -- node[above]{\en{pool}} (pool.north east); + + \draw[decorate,decoration={brace,amplitude=4pt,raise=3pt,mirror}] + (pool.north west) -- node[left=5pt]{$k+1$ \en{threads}} (pool.south west); + + % fifo + \node[exec/fifonode,draw=none,fill=none,above=of t0](fifo3) {\dots}; + \begin{scope}[node distance=-.1mm,start chain=fifo] + \foreach \i/\p/\n in {2/3/n-2,1/2/n-1,0/1/n} { \node[exec/fifonode,left=of fifo\p] (fifo\i) {$m_{\n}$}; } + \foreach \i/\p/\n in {4/3/2,5/4/1,6/5/0} { \node[exec/fifonode,right=of fifo\p] (fifo\i) {$m_{\n}$}; } + \end{scope} + \draw[-,densely dotted] ([yshift=-.05mm]fifo3.north west) -- ([yshift=-.05mm]fifo3.north east); + \draw[-,densely dotted] ([yshift=+.05mm]fifo3.south west) -- ([yshift=+.05mm]fifo3.south east); + + \node[exec/fit=(fifo0)(fifo6),fit margins={left=2.25mm},dash phase=2](mutex) {}; + \path (mutex.north west) + -- node[above](lblmutex){accès en section critique (\en{mutex}) à la file de tâches} (mutex.north east); + + % arrows + \draw[-] ([xshift=-8mm]fifo0.west) -- (fifo0.west); + + \draw[->,rounded corners] (fifo6.east) -- ++(4mm,0) |- (pool.east); + + \coordinate (mutexeast) at ([xshift=3mm]mutex.east); + \node[exec/fit=(lblmutex)(mutex)(pool)(mutexeast),densely dashed](threadpool) {}; + \path (threadpool.north west) -- node[above]{\en{thread pool}} (threadpool.north east); + + % background + \begin{scope}[on background layer] + \node[fit=(threadpool),inner sep=3ex,rectangle,rounded corners,fill=white,opacity=.95]{}; + \end{scope} + + % fix thread pool border + \begin{scope}[on background layer] + \node[exec/pool=(t0)(t1)(t2)(t3)(t4)]{}; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/exec/firstlevel.tex b/src/fig/exec/firstlevel.tex new file mode 100644 index 0000000..db8792b --- /dev/null +++ b/src/fig/exec/firstlevel.tex @@ -0,0 +1,70 @@ +\begin{tikzpicture} + \input{src/tikz/orchestration} + + % \def\N{12} + % \def\T{4} + + \pgfmathtruncatemacro{\nlasttask}{\N-1} + \pgfmathtruncatemacro{\nlastthread}{\T-1} + \pgfmathtruncatemacro{\R}{mod(\N, \T)} + + \begin{scope}[overlay] + \node(origin){}; + \node at (origin) (t-\T) {}; + \end{scope} + + \begin{scope}[node distance=4mm and 4mm] + \foreach \task in {0,...,\nlasttask} { + \pgfmathtruncatemacro{\r}{mod(\task, \T)} + \ifthenelse{\r = 0}{ + \pgfmathtruncatemacro{\uppertask}{\T*(\task/\T-1)} + \def\reltype{below} + \def\relnode{t\uppertask} + }{ + \pgfmathtruncatemacro{\prevtask}{\task-1} + \def\reltype{right} + \def\relnode{t\prevtask} + } + \node[orch/task=black,\reltype=of \relnode] (t\task) {m\textsubscript{\task}}; + } + + \ifthenelse{\R = 0}{}{ + \pgfmathtruncatemacro{\ntaskfill}{mod(\T-\R, \T)-1} + \foreach \taskfill in {0,...,\ntaskfill} { + \pgfmathtruncatemacro{\task}{\nlasttask+\taskfill+1} + \pgfmathtruncatemacro{\prevtask}{\task-1} + \node[orch/task=white,draw=none,fill=none,right=of t\prevtask] (t\task) {}; + \draw[-] (t\task.north) -- (t\task.south); + } + } + + \foreach \thread in {0,...,\nlastthread} { + \node[above=of t\thread] (label\thread) {\en{thread}~\thread}; + \draw[-] (label\thread) -- (t\thread); + + \pgfmathtruncatemacro{\n}{floor((\N-1)/\T)-1} + \ifthenelse{\n = -1}{}{% only if N>T + \foreach \task in {0,...,\n} { + \pgfmathtruncatemacro{\curtask}{\thread+\task*\T} + \pgfmathtruncatemacro{\nexttask}{\curtask+\T} + \draw[-] (t\curtask) -- (t\nexttask); + } + } + + \pgfmathtruncatemacro{\lasttask}{\thread+(\n+1)*\T} + \node[below=of t\lasttask] (endthread\thread) {}; + \draw[-] (t\lasttask) -- (endthread\thread); + } + \end{scope} + + \begin{scope}[common/overlay] + \draw[decorate,decoration={brace, amplitude=4pt, raise=9mm, mirror}] + (t0.north) -- (t0.south) node[left,midway,xshift=-11mm] {$T$}; + + \pgfmathtruncatemacro{\n}{ceil(\N/\T)} + \pgfmathtruncatemacro{\nr}{(\N-1)/\T} + \pgfmathtruncatemacro{\ftlt}{\nr*\T} + \draw[decorate,decoration={brace, amplitude=4pt, raise=18mm, mirror}] + (t0.north) -- (t\ftlt.south) node[left,midway,xshift=-20mm] {$\n\,T$}; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/exec/firstleveldetails.tex b/src/fig/exec/firstleveldetails.tex new file mode 100644 index 0000000..c94885f --- /dev/null +++ b/src/fig/exec/firstleveldetails.tex @@ -0,0 +1,76 @@ +\begin{tikzpicture} + \input{src/tikz/orchestration} + + % \def\N{15} + % \def\T{6} + + \pgfmathtruncatemacro{\nlasttask}{\N-1} + \pgfmathtruncatemacro{\nlastthread}{\T-1} + \pgfmathtruncatemacro{\R}{mod(\N, \T)} + + \begin{scope}[overlay] + \node(origin){}; + \node at (origin) (t-\T) {}; + \end{scope} + + \begin{scope}[node distance=4mm and 4mm] + \foreach \task in {0,...,\nlasttask} { + \pgfmathtruncatemacro{\r}{mod(\task, \T)} + \ifthenelse{\r = 0}{ + \pgfmathtruncatemacro{\uppertask}{\T*(\task/\T-1)} + \def\reltype{below} + \def\relnode{t\uppertask} + }{ + \pgfmathtruncatemacro{\prevtask}{\task-1} + \def\reltype{right} + \def\relnode{t\prevtask} + } + \node[orch/task=black,\reltype=of \relnode] (t\task) {}; + + \draw[-] (t\task.north) + -- node[pos=.3,orch/subtask=black] {} + node[pos=.7,orch/subtask=black] {} + (t\task.south); + } + + \ifthenelse{\R = 0}{}{ + \pgfmathtruncatemacro{\ntaskfill}{mod(\T-\R, \T)-1} + \foreach \taskfill in {0,...,\ntaskfill} { + \pgfmathtruncatemacro{\task}{\nlasttask+\taskfill+1} + \pgfmathtruncatemacro{\prevtask}{\task-1} + \node[orch/task=white,draw=none,fill=none,right=of t\prevtask] (t\task) {}; + \draw[-] (t\task.north) -- (t\task.south); + } + } + + \foreach \thread in {0,...,\nlastthread} { + \node[above=of t\thread] (label\thread) {\en{thread}~\thread}; + \draw[-] (label\thread) -- (t\thread); + + \pgfmathtruncatemacro{\n}{floor((\N-1)/\T)-1} + \ifthenelse{\n = -1}{}{% only if N>T + \foreach \task in {0,...,\n} { + \pgfmathtruncatemacro{\curtask}{\thread+\task*\T} + \pgfmathtruncatemacro{\nexttask}{\curtask+\T} + \draw[-] (t\curtask) -- (t\nexttask); + } + } + + \pgfmathtruncatemacro{\lasttask}{\thread+(\n+1)*\T} + \node[below=of t\lasttask] (endthread\thread) {}; + \draw[-] (t\lasttask) -- (endthread\thread); + } + \end{scope} + + \begin{scope}[common/overlay] + \pgfmathtruncatemacro{\n}{2*ceil(\N/\T)} + \pgfmathtruncatemacro{\nr}{(\N-1)/\T} + \pgfmathtruncatemacro{\ftlt}{\nr*\T} + + \draw[decorate,decoration={brace, amplitude=4pt, raise=9mm, mirror}] + (t0.north) -- (t0.south) node[left,midway,xshift=-11mm] {$2\,T$}; + + \draw[decorate,decoration={brace, amplitude=4pt, raise=18mm, mirror}] + (t0.north) -- (t\ftlt.south) node[left,midway,xshift=-20mm] {$\n\,T$}; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/exec/multilevel.tex b/src/fig/exec/multilevel.tex new file mode 100644 index 0000000..de3eec3 --- /dev/null +++ b/src/fig/exec/multilevel.tex @@ -0,0 +1,85 @@ +\begin{tikzpicture} + \input{src/tikz/orchestration} + + % \def\N{15} + % \def\T{6} + + \pgfmathtruncatemacro{\nlasttask}{\N-1} + \pgfmathtruncatemacro{\nlastthread}{\T-1} + \pgfmathtruncatemacro{\R}{mod(\N, \T)} + + \begin{scope}[overlay] + \node(origin){}; + \node at (origin) (t-\T) {}; + \end{scope} + + \begin{scope}[node distance=4mm and 4mm] + \pgfmathtruncatemacro{\nlasttaskA}{\nlasttask-\R} + + \foreach \task in {0,...,\nlasttaskA} { + \pgfmathtruncatemacro{\r}{mod(\task, \T)} + \ifthenelse{\r = 0}{ + \pgfmathtruncatemacro{\uppertask}{\T*(\task/\T-1)} + \def\reltype{below} + \def\relnode{t\uppertask} + }{ + \pgfmathtruncatemacro{\prevtask}{\task-1} + \def\reltype{right} + \def\relnode{t\prevtask} + } + \node[orch/task=black,\reltype=of \relnode] (t\task) {}; + + \draw[-] (t\task.north) + -- node[pos=.3,orch/subtask=black] {} + node[pos=.7,orch/subtask=black] {} + (t\task.south); + } + + \foreach \taskfill in {1,...,\R} { + \pgfmathtruncatemacro{\task}{\taskfill-1} + \pgfmathtruncatemacro{\prevtaskl}{\nlasttaskA+\task-\T+\taskfill)} + \pgfmathtruncatemacro{\prevtaskr}{\prevtaskl+1} + \path (t\prevtaskl.south) -- coordinate[midway](prevtask\taskfill) (t\prevtaskr.south); + \node[orch/taskspan=black,below=of prevtask\taskfill] (ts\task) {}; + + \pgfmathtruncatemacro{\taska}{\nlasttaskA+\task*2+1} + \pgfmathtruncatemacro{\taskb}{\nlasttaskA+\task*2+2} + + \path (t\prevtaskl.south) |- node[orch/subtask=black] (t\taska) {} (ts\task.west); + \path (t\prevtaskr.south) |- node[orch/subtask=black] (t\taskb) {} (ts\task.west); + } + + \foreach \thread in {0,...,\nlastthread} { + \node[above=of t\thread] (label\thread) {\en{thread}~\thread}; + \draw[-] (label\thread) -- (t\thread); + + \pgfmathtruncatemacro{\n}{floor((\N-1)/\T)-1} + \ifthenelse{\n = -1}{}{% only if N>T + \foreach \task in {0,...,\n} { + \pgfmathtruncatemacro{\curtask}{\thread+\task*\T} + \pgfmathtruncatemacro{\nexttask}{\curtask+\T} + \draw[-] (t\curtask) -- (t\nexttask); + } + } + + \pgfmathtruncatemacro{\lasttask}{\thread+(\n+1)*\T} + \draw[-] (t\lasttask) -- (\curcoord |- ts0.south) -- +(0,-4mm); + } + \end{scope} + + \begin{scope}[common/overlay] + \pgfmathtruncatemacro{\n}{ceil((2*\N-1)/\T)} + \pgfmathtruncatemacro{\nr}{(\N-1)/\T} + \pgfmathtruncatemacro{\ftlt}{\nr*\T} + \node[orch/task=black,draw=none,fill=none](lt) at (t\ftlt) {}; + + \draw[decorate,decoration={brace, amplitude=4pt, raise=9mm, mirror}] + (t0.north) -- (t0.south) node[left,midway,xshift=-11mm] {$2\,T$}; + + \draw[decorate,decoration={brace, amplitude=4pt, raise=9mm, mirror}] + (lt.north) -- (lt.south) node[left,midway,xshift=-11mm] {$T$}; + + \draw[decorate,decoration={brace, amplitude=4pt, raise=18mm, mirror}] + (t0.north) -- (lt.south) node[left,midway,xshift=-20mm] {$\n{}\,T$}; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/exec/threadpool.tex b/src/fig/exec/threadpool.tex new file mode 100644 index 0000000..7800225 --- /dev/null +++ b/src/fig/exec/threadpool.tex @@ -0,0 +1,50 @@ +\begin{tikzpicture} + \input{src/tikz/exec} + + % pool + \begin{scope}[start chain=circle placed {at=(\tikzchaincount*72+18:.8)}] + \foreach \i in {0,...,4} { + \node[on chain,exec/thread=black] (t\i) {t\textsubscript{\i}}; + } + \end{scope} + \path (t0) |- node[pos=.2,exec/thread=black]{t\textsubscript{k}} ($(t2)!.5!(t3)$); + + \begin{scope}[on background layer] + \node[exec/pool=(t0)(t1)(t2)(t3)(t4)](pool){}; + \end{scope} + \path (pool.north west) -- node[above]{\en{pool}} (pool.north east); + + \draw[decorate,decoration={brace,amplitude=4pt,raise=3pt,mirror}] + (pool.north west) -- node[left=5pt]{$k+1$ \en{threads}} (pool.south west); + + % fifo + \node[exec/fifonode,draw=none,fill=none,above=of t0](fifo3) {}; + \begin{scope}[node distance=-.1mm,start chain=fifo] + \foreach \i/\p/\n in {2/3/n-2,1/2/n-1,0/1/n} { \node[exec/fifonode,left=of fifo\p] (fifo\i) {$m_{\n}$}; } + \foreach \i/\p/\n in {4/3/2,5/4/1,6/5/0} { \node[exec/fifonode,right=of fifo\p] (fifo\i) {$m_{\n}$}; } + \end{scope} + \draw[-,densely dotted] ([yshift=-.05mm]fifo3.north west) -- ([yshift=-.05mm]fifo3.north east); + \draw[-,densely dotted] ([yshift=+.05mm]fifo3.south west) -- ([yshift=+.05mm]fifo3.south east); + + \node[exec/fit=(fifo0)(fifo6),fit margins={left=2.25mm},dash phase=2](mutex) {}; + \path (mutex.north west) + -- node[above](lblmutex){accès en section critique (\en{mutex}) à la file de tâches} (mutex.north east); + + % arrows + \draw[-] ([xshift=-8mm]fifo0.west) -- (fifo0.west); + + \draw[->,rounded corners] (fifo6.east) -- ++(4mm,0) |- (pool.east); + + \coordinate (mutexeast) at ([xshift=3mm]mutex.east); + \node[exec/fit=(lblmutex)(mutex)(pool)(mutexeast),densely dashed](threadpool) {}; + + % background + \begin{scope}[on background layer] + \node[fit=(threadpool),inner sep=3ex,rectangle,rounded corners,fill=white,opacity=.95]{}; + \end{scope} + + % fix thread pool border + \begin{scope}[on background layer] + \node[exec/pool=(t0)(t1)(t2)(t3)(t4)]{}; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/mp/et_basic.tex b/src/fig/mp/et_basic.tex new file mode 100644 index 0000000..1441398 --- /dev/null +++ b/src/fig/mp/et_basic.tex @@ -0,0 +1,7 @@ +\begin{tikzpicture} + \input{src/tikz/et} + + \begin{scope}[et/treestyle] + \Tree[.\texttt{+} \texttt{a} [.\texttt{*} \texttt{b} \texttt{c} ] ] + \end{scope} +\end{tikzpicture} diff --git a/src/fig/mp/et_linexpr.tex b/src/fig/mp/et_linexpr.tex new file mode 100644 index 0000000..927a601 --- /dev/null +++ b/src/fig/mp/et_linexpr.tex @@ -0,0 +1,14 @@ +\begin{tikzpicture} + \input{src/tikz/et} + + \begin{scope}[et/treestyle,level distance=12mm] + \Tree + [.\texttt{-} + [.\texttt{*} + \texttt{5} + [.\texttt{+} [.\texttt{*} \texttt{2} \texttt{x} ] \texttt{1} ] + ] + [.\texttt{+} \texttt{x} \texttt{3} ] + ] + \end{scope} +\end{tikzpicture} diff --git a/src/fig/mp/et_linexpr_opti0.tex b/src/fig/mp/et_linexpr_opti0.tex new file mode 100644 index 0000000..62f25c0 --- /dev/null +++ b/src/fig/mp/et_linexpr_opti0.tex @@ -0,0 +1,11 @@ +\begin{tikzpicture} + \input{src/tikz/et} + + \begin{scope}[et/treestyle,level distance=12mm] + \Tree + [.\texttt{-} + [.\texttt{+} [.\texttt{*} \texttt{10} \texttt{x} ] \texttt{5} ] + [.\texttt{+} \texttt{x} \texttt{3} ] + ] + \end{scope} +\end{tikzpicture} diff --git a/src/fig/mp/et_linexpr_opti1.tex b/src/fig/mp/et_linexpr_opti1.tex new file mode 100644 index 0000000..910533a --- /dev/null +++ b/src/fig/mp/et_linexpr_opti1.tex @@ -0,0 +1,7 @@ +\begin{tikzpicture} + \input{src/tikz/et} + + \begin{scope}[et/treestyle,level distance=12mm] + \Tree[.\texttt{+} [.\texttt{*} \texttt{9} \texttt{x} ] \texttt{2} ] + \end{scope} +\end{tikzpicture} diff --git a/src/fig/mp/metaprogram.tex b/src/fig/mp/metaprogram.tex new file mode 100644 index 0000000..9375940 --- /dev/null +++ b/src/fig/mp/metaprogram.tex @@ -0,0 +1,17 @@ +\begin{tikzpicture} + \input{src/tikz/mp} + + \pic[local bounding box=cpptmp] at (0,0) {program}; + \pic[local bounding box=cpp] at (4,0) {program}; + \pic[local bounding box=bin] at (8,0) {binary}; + + \path (cpptmp.north west) -- node[above,align=center]{C++ avec\\templates} (cpptmp.north east); + \path (cpp.north west) -- node[above]{C++} (cpp.north east); + \path (bin.north west) -- node[above]{binaire} (bin.north east); + + \begin{scope}[->,>=stealth] + \draw[double distance=2pt] ($(cpptmp.east)!.5!(cpp.west)$) -- ++(0,-1.3) -- ++(-3,0) |- (cpptmp.west); + \draw[double distance=2pt] (cpptmp) -- node[above]{\footnotesize compilation} (cpp); + \draw[double distance=2pt] (cpp) -- node[above]{\footnotesize compilation} (bin); + \end{scope} +\end{tikzpicture} diff --git a/src/fig/pagemask.tex b/src/fig/pagemask.tex new file mode 100644 index 0000000..ec35ef6 --- /dev/null +++ b/src/fig/pagemask.tex @@ -0,0 +1,6 @@ +\begin{tikzpicture}[remember picture,overlay] + \coordinate (north west) at ([yshift=-16.1mm]current page.north west); + \coordinate (south east) at (current page.south east); + + \fill[opacity=.7,black] (north west) rectangle (south east); +\end{tikzpicture}% diff --git a/src/fig/pfor/indices.tex b/src/fig/pfor/indices.tex new file mode 100644 index 0000000..85d4539 --- /dev/null +++ b/src/fig/pfor/indices.tex @@ -0,0 +1,16 @@ +\begin{tikzpicture} + \input{src/tikz/et} + + \begin{scope}[et/treestyle] + \Tree[., + [.= + [.\texttt{[]} a i ] + [.\texttt{*} [.\texttt{[]} a i ] [.\texttt{[]} b i ] ] + ] + [.= + [.\texttt{[]} c i ] + [.\texttt{[]} c [.\texttt{+} i 1 ] ] + ] + ]; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/pfor/indices_small.tex b/src/fig/pfor/indices_small.tex new file mode 100644 index 0000000..2065d28 --- /dev/null +++ b/src/fig/pfor/indices_small.tex @@ -0,0 +1,10 @@ +\begin{tikzpicture} + \input{src/tikz/et} + + \begin{scope}[et/treestyle] + \Tree[.= + [.\texttt{[]} c i ] + [.\texttt{[]} c [.\texttt{+} i 1 ] ] + ]; + \end{scope} +\end{tikzpicture} diff --git a/src/fig/repeat/identify.tex b/src/fig/repeat/identify.tex new file mode 100644 index 0000000..06d237d --- /dev/null +++ b/src/fig/repeat/identify.tex @@ -0,0 +1,92 @@ +\begin{tikzpicture} + \input{src/tikz/alsk} + + \begin{scope}[alsk/treestyle, + alsk/tree/muscle/.append style={font=\footnotesize,minimum width=8mm,minimum height=3mm}, + alsk/tree/struct/.append style={font=\footnotesize,minimum width=12mm,minimum height=3mm}, + level distance=11mm, sibling distance=16mm, + every node/.style=leaf, + ] + \node[branch](farmsel1){farmsel\textsubscript{1}} + child{ node[branch](serial1){serial\textsubscript{1}} + child{ node(ch){HC} } + child{ node[branch](serial2){serial\textsubscript{2}} + child{ node(init ls){RLI} } + child{ node[branch](itersel){itersel} + child{ node[branch](farmsel2){farmsel\textsubscript{2}} + child{ node[branch](serial3){serial\textsubscript{3}} + child{ node(m){M} } + child{ node(ls){RL} } + } + child{ node(sel3){Sel\textsubscript{3}} } + } + child{ node(sel2){Sel\textsubscript{2}} } + } + } + } + child{ node(sel1){Sel\textsubscript{1}} }; + \end{scope} + + % task count + \path (farmsel1) -- node[left=2mm]{\only<4->{\footnotesize$a \times$}} (serial1); + \path (farmsel2) -- node[left=2mm]{\only<6->{\footnotesize$b \times$}} (serial3); + + % identifiers + \begin{scope}[ + ->,dashed,rounded corners=1mm, + frame/.style={draw,rectangle,rounded corners=1mm,dashed,fit=#1} + ] + \coordinate (yline) at ($(farmsel1)+(30mm,0)$); + + \path[only on=<2->{draw}] (farmsel1) -- (farmsel1 -| yline) node(n9t){}; + \path[only on=<3->{draw}] (sel1) -- (sel1 -| yline) node(n9b){}; + + \path[only on=<{4-7,10-}>{draw}] (serial1) |- ++(0,-5mm) -- (\curcoord -| yline) node(nat){}; + + \visible<5-7,10->{ + \node[frame=(ch)(itersel)(farmsel2)(sel2)] (fserial1) {}; + } + \path[only on=<{5-7,10-}>{draw}] (fserial1) -- (fserial1 -| yline) node(nfs1){}; + \path[only on=<{5-7,10-}>{draw}] (sel3) -- (sel3 -| yline) node(nab){}; + + \path[only on=<{6-7,9-}>{draw}] (serial3) |- ++(0,-5mm) -- (\curcoord -| yline) node(nbt){}; + \visible<7,9->{ + \node[frame=(m)(ls)] (fserial3) {}; + } + \path[only on=<{7,9-}>{draw}] (fserial3) -- (fserial3 -| yline) node(nbb){}; + \end{scope} + + \begin{scope} + \only<2>{\node[right] at (n9t) {\num{1} exécution};} + \only<4>{\node[right] at (nat) {$a$ exécutions parallèles};} + \only<6>{\node[right] at (nbt) {$a \times b$ exécutions parallèles};} + \end{scope} + + \begin{scope}[decoration={brace,amplitude=4pt,raise=4pt}] + \visible<3-7,8->{ + \draw[decorate] (n9t.north) -- (n9b.south) node[midway,right=10pt] + {\alt<3-7>{\num{1} exécution}{$\text{id} = 0$}}; + } + \visible<5-7,10->{ + \draw[decorate] (nat.north) -- (nab.south) node[midway,right=10pt,only on=<10->{text justified}] + {\alt<5-7>{$a$ exécutions parallèles}{$ + \begin{aligned} + &\text{id} \in \{0, b, 2\,b, \dots, (a-1)\,b\}\\ + &\iff \text{id} \in b\,\llbracket 0, a \llbracket + \end{aligned} + $}}; + } + \visible<7>{ + \draw[decorate] (nbt.north) -- (nbb.south) node[midway,right=10pt] + {$a \times b$ exécutions parallèles}; + } + \visible<9>{ + \draw[decorate] (nbt.north) -- (nbb.south) node[midway,right=10pt] + {$\text{id} \in \llbracket 0, a\,b \llbracket$}; + } + \visible<10->{ + \draw[decorate] (nbt.north) -- (nbb.south) node[midway,right=10pt] + {$\text{id} \in \llbracket 0, a\,b \llbracket (= \displaystyle\bigcup^{a-1}_{k=0} \llbracket k\,b, (k+1)\,b-1 \rrbracket)$}; + } + \end{scope} +\end{tikzpicture} diff --git a/src/fig/repeat/par.tex b/src/fig/repeat/par.tex new file mode 100644 index 0000000..d85f46d --- /dev/null +++ b/src/fig/repeat/par.tex @@ -0,0 +1,63 @@ +\begin{tikzpicture} + \input{src/tikz/orchestration} + + \tikzset{orch/task/.append style={minimum width=10mm}} + + \pgfmathtruncatemacro{\nlasttask}{\N-1} + \pgfmathtruncatemacro{\nlastthread}{\T-1} + \pgfmathtruncatemacro{\R}{mod(\N, \T)} + + \begin{scope}[overlay] + \node(origin){}; + \node at (origin) (t-\T) {}; + \end{scope} + + \begin{scope}[node distance=3mm and 3mm] + \pgfmathtruncatemacro{\multiplier}{\N/\T} + \pgfmathtruncatemacro{\offset}{mod(\N, \T)} + + \foreach \task in {0,...,\nlasttask} { + \pgfmathtruncatemacro{\r}{mod(\task, \T)} + \ifthenelse{\r = 0}{ + \pgfmathtruncatemacro{\uppertask}{\T*(\task/\T-1)} + \def\reltype{below} + \def\relnode{t\uppertask} + }{ + \pgfmathtruncatemacro{\prevtask}{\task-1} + \def\reltype{right} + \def\relnode{t\prevtask} + } + + \pgfmathtruncatemacro{\id}{(\task/\T)+\r*\multiplier+min(\r, \offset)} + \node[orch/task=black,\reltype=of \relnode] (t\task) {$m_\id$}; + } + + \ifthenelse{\R = 0}{}{ + \pgfmathtruncatemacro{\ntaskfill}{mod(\T-\R, \T)-1} + \foreach \taskfill in {0,...,\ntaskfill} { + \pgfmathtruncatemacro{\task}{\nlasttask+\taskfill+1} + \pgfmathtruncatemacro{\prevtask}{\task-1} + \node[orch/task=white,draw=none,fill=none,right=of t\prevtask] (t\task) {}; + \draw[-] (t\task.north) -- (t\task.south); + } + } + + \foreach \thread in {0,...,\nlastthread} { + \node[above=of t\thread] (label\thread) {\footnotesize\en{thread}~\thread}; + \draw[-] (label\thread) -- (t\thread); + + \pgfmathtruncatemacro{\n}{floor((\N-1)/\T)-1} + \ifthenelse{\n = -1}{}{% only if N>T + \foreach \task in {0,...,\n} { + \pgfmathtruncatemacro{\curtask}{\thread+\task*\T} + \pgfmathtruncatemacro{\nexttask}{\curtask+\T} + \draw[-] (t\curtask) -- (t\nexttask); + } + } + + \pgfmathtruncatemacro{\lasttask}{\thread+(\n+1)*\T} + \node[below=of t\lasttask] (endthread\thread) {}; + \draw[-] (t\lasttask) -- (endthread\thread); + } + \end{scope} +\end{tikzpicture} diff --git a/src/fig/repeat/prng/par.tex b/src/fig/repeat/prng/par.tex new file mode 100644 index 0000000..c25e9bd --- /dev/null +++ b/src/fig/repeat/prng/par.tex @@ -0,0 +1,28 @@ +\begin{tikzpicture} + \input{src/tikz/repeat} + + \visible<1->{ + \begin{scope}[start chain,node distance=0pt,every node/.style={on chain,prng/element}] + \node[only on=<2-12>{opacity=.8},only on=<2->{prng/drawfill=a}](a0) {12}; + \foreach[count=\i from 3] \v/\col in {2/b,34/a,85/b,4/a,91/b,29/a,85/b,98/a,3/b,35/b,65/a} { + \node[only on=<\i-12>{opacity=.8},only on=<\i->{prng/drawfill=\col}] {\v}; + } + \end{scope} + } + \visible<14->{ + \begin{scope}[start chain,node distance=0pt,every node/.style={on chain,prng/element}] + \node[prng/drawfill=b,prng/below=a0](b0) {12}; + \foreach[count=\i from 3] \v/\col in {2/b,34/a,85/a,4/b,91/a,29/a,85/b,98/a,3/b,35/a,65/b} { + \node[prng/drawfill=\col] {\v}; + } + \end{scope} + } + \visible<15->{ + \begin{scope}[start chain,node distance=0pt,every node/.style={on chain,prng/element}] + \node[prng/drawfill=b,prng/below=b0](c0) {12}; + \foreach[count=\i from 3] \v/\col in {2/a,34/a,85/a,4/b,91/a,29/b,85/b,98/b,3/b,35/a,65/a} { + \node[prng/drawfill=\col] {\v}; + } + \end{scope} + } +\end{tikzpicture} diff --git a/src/fig/repeat/prng/parthread.tex b/src/fig/repeat/prng/parthread.tex new file mode 100644 index 0000000..f87eee0 --- /dev/null +++ b/src/fig/repeat/prng/parthread.tex @@ -0,0 +1,23 @@ +\begin{tikzpicture} + \input{src/tikz/repeat} + + \begin{scope}[start chain,node distance=0pt,every node/.style={on chain,prng/element}] + \node[prng/drawfill=a](a0) {12}; + \foreach[count=\i from 1] \v/\col in {2/a,34/a,85/a,4/a,91/a,29/c,85/c,98/c,3/c,35/c,65/c} { + \node[prng/drawfill=\col] (a\i) {\v}; + } + \end{scope} + + \visible<-1>{ + \begin{scope}[start chain,node distance=0pt,every node/.style={on chain,prng/element}] + \node[prng/drawfill=b,node distance=5mm,below=of a0](b0) {42}; + \foreach[count=\i from 1] \v/\col in {8/b,9/b,54/b,95/b,80/b,48/c,7/c,10/c,58/c,18/c,44/c} { + \node[prng/drawfill=\col] (b\i) {\v}; + } + \end{scope} + \node[fit=(a0)(b0)(a11)(b11),fit margins={right=2mm},draw,rectangle,dashed,rounded corners]{}; + } + \visible<2->{ + \node[fit=(a0)(a11),fit margins={right=2mm},draw,rectangle,dashed,rounded corners]{}; + } +\end{tikzpicture} diff --git a/src/fig/repeat/prng/seq.tex b/src/fig/repeat/prng/seq.tex new file mode 100644 index 0000000..a90b88c --- /dev/null +++ b/src/fig/repeat/prng/seq.tex @@ -0,0 +1,18 @@ +\begin{tikzpicture} + \input{src/tikz/repeat} + + \begin{scope}[start chain,node distance=0pt,every node/.style={on chain,prng/element}] + \node[only on=<2-13>{opacity=.8},only on=<2->{prng/drawfill=a}](a0) {12}; + \foreach[count=\i from 3] \v/\col in {2/a,34/a,85/a,4/a,91/a,29/b,85/b,98/b,3/b,35/b,65/b} { + \node[only on=<\i-13>{opacity=.8},only on=<\i->{prng/drawfill=\col}] {\v}; + } + \end{scope} + \begin{scope}[start chain,node distance=0pt,every node/.style={on chain,prng/element,opacity=0}] + \node[prng/below=a0](b0) {12}; + \foreach \v in {2,34,85,4,91,29,85,98,3,35,65} { \node{\v}; } + \end{scope} + \begin{scope}[start chain,node distance=0pt,every node/.style={on chain,prng/element,opacity=0}] + \node[prng/below=b0](c0) {12}; + \foreach \v in {2,34,85,4,91,29,85,98,3,35,65} { \node {\v}; } + \end{scope} +\end{tikzpicture} diff --git a/src/fig/repeat/seq.tex b/src/fig/repeat/seq.tex new file mode 100644 index 0000000..3a3fc46 --- /dev/null +++ b/src/fig/repeat/seq.tex @@ -0,0 +1,28 @@ +\begin{tikzpicture} + \input{src/tikz/orchestration} + + \tikzset{orch/task/.append style={minimum width=10mm}} + + \begin{scope}[overlay] + \node(origin){}; + \node at (origin) (t-1) {}; + \end{scope} + + \begin{scope}[node distance=3mm and 3mm] + \node[orch/task=black,below=of t-1] (t0) {$m_0$}; + \node[orch/task=white,draw=none,fill=none,below=of t0] (t1) {}; + \node[orch/task=black,below=of t1] (t2) {$m_8$}; + + \node[above=of t0] (label0) {\footnotesize\en{thread}~0}; + \node[below=of t2] (endthread0) {}; + \end{scope} + + \draw[-] (label0) -- (t0); + + \draw[-] (t0) -- (t1); + \draw[dashed] (t1.north) -- (t1.south); + \draw[-] (t1) -- (t2); + + \draw[-] (t2) -- (endthread0); +\end{tikzpicture} + diff --git a/src/lst/alsk/elsbody.tex b/src/lst/alsk/elsbody.tex new file mode 100644 index 0000000..13cdd12 --- /dev/null +++ b/src/lst/alsk/elsbody.tex @@ -0,0 +1,6 @@ +\begin{cppcode} + using Els = SkelEls< + tsp::Problem, tsp::Solution, + iLS, M, LS, sel2, sel3, A + >; +\end{cppcode} diff --git a/src/lst/alsk/grasp.tex b/src/lst/alsk/grasp.tex new file mode 100644 index 0000000..9f4ca6b --- /dev/null +++ b/src/lst/alsk/grasp.tex @@ -0,0 +1,13 @@ +\begin{cppcode} + template< + typename Problem, typename Solution, + typename CH, typename LS, typename Sel + > + using SkelGrasp = BuildSkeleton< + SkelGraspStructure, + SkelGraspLinks + >::template skeleton< + Pack, + Pack + >; +\end{cppcode} diff --git a/src/lst/alsk/grasp_links.tex b/src/lst/alsk/grasp_links.tex new file mode 100644 index 0000000..ed84e95 --- /dev/null +++ b/src/lst/alsk/grasp_links.tex @@ -0,0 +1,13 @@ +\begin{cppcode} + template< + typename Problem, typename Solution + > + using SkelGraspLinks = + L}|(|\textcolor{colSp0}{P<0>}|), + |\textcolor{colCHr}{Solution}|(|\textcolor{colCHp0}{P<0>}|, |\textcolor{colCHp1}{RNG}|), + |\textcolor{colLSr}{Solution}|(|\textcolor{colLSp0}{R<0>}|, |\textcolor{colLSp1}{RNG}|) + >, + |\textcolor{colSelr}{Solution}|(|\textcolor{colSelp}{Solution}|, |\textcolor{colSelp}{Solution}|) + >; +\end{cppcode} diff --git a/src/lst/alsk/grasp_struct.tex b/src/lst/alsk/grasp_struct.tex new file mode 100644 index 0000000..66d6458 --- /dev/null +++ b/src/lst/alsk/grasp_struct.tex @@ -0,0 +1,12 @@ +\begin{cppcode} + template< + typename |\textcolor{colMuscle}{CH}|, typename |\textcolor{colMuscle}{LS}|, typename |\textcolor{colMuscle}{S}| + > + using SkelGraspStructure = + S<|\textcolor{colStruct}{FarmSel}|, + S<|\textcolor{colStruct}{Serial}|, + |\textcolor{colMuscle}{CH}|, |\textcolor{colMuscle}{LS}| + >, + |\textcolor{colMuscle}{S}| + >; +\end{cppcode} diff --git a/src/lst/alsk/graspbody.tex b/src/lst/alsk/graspbody.tex new file mode 100644 index 0000000..20ecc10 --- /dev/null +++ b/src/lst/alsk/graspbody.tex @@ -0,0 +1,6 @@ +\begin{cppcode} + using GraspEls = SkelGrasp< + tsp::Problem, tsp::Solution, + Greedy, Els, sel1 + >; +\end{cppcode} diff --git a/src/lst/alsk/graspexec.tex b/src/lst/alsk/graspexec.tex new file mode 100644 index 0000000..1d3837f --- /dev/null +++ b/src/lst/alsk/graspexec.tex @@ -0,0 +1,11 @@ +\begin{cppcode} + auto graspEls = implement(); + + graspEls.skeleton.n = 10; + graspEls.skeleton.task.task<1>().task<1>().n = 15; + graspEls.skeleton.task.task<1>().task<1>().task.n = 20; + + graspEls.executor.cores = 16; + + tsp::Solution solution = graspEls(problem); +\end{cppcode} diff --git a/src/lst/intro/loop_par.tex b/src/lst/intro/loop_par.tex new file mode 100644 index 0000000..14960c4 --- /dev/null +++ b/src/lst/intro/loop_par.tex @@ -0,0 +1,4 @@ +\begin{cppcode} + for(int i = 0; i < N; ++i) + a[i] = a[i] + 1; +\end{cppcode} diff --git a/src/lst/intro/loop_par_hard.tex b/src/lst/intro/loop_par_hard.tex new file mode 100644 index 0000000..1930bfd --- /dev/null +++ b/src/lst/intro/loop_par_hard.tex @@ -0,0 +1,4 @@ +\begin{cppcode} + for(int i = 1; i < N; i += 2) + a[i] = a[i-1]; +\end{cppcode} diff --git a/src/lst/intro/loop_seq.tex b/src/lst/intro/loop_seq.tex new file mode 100644 index 0000000..00696f6 --- /dev/null +++ b/src/lst/intro/loop_seq.tex @@ -0,0 +1,4 @@ +\begin{cppcode} + for(int i = 1; i < N; ++i) + a[i] = a[i-1]; +\end{cppcode} diff --git a/src/lst/mp/cpplogo.tex b/src/lst/mp/cpplogo.tex new file mode 100644 index 0000000..ca07cf6 --- /dev/null +++ b/src/lst/mp/cpplogo.tex @@ -0,0 +1,22 @@ +\begin{minicppcode} + static char *cpplogo_data = + "````````````````````````W/(Q@+<7@+<7W/(Q````````````````````````" + "````````````````[?\\WF\\8=::L3::L3::L3::L3F\\8=[?\\W````````````````" + "````````^PD]MM@L=;$5::L3::L3::L3B+L9K=(BK-$BB+L9::L3::L3::L3=;$5S>@L_`T^" + "J,XA::L3::L3::L3B;L9X/8S````````````````X/4SB;L9::L3::L3::L3H<46" + "::L3::L3::L3B;L9]`<[````````````````````````]`<[B;L98:,,-GWL!&G=" + "::L3::L3::L3X?8S````````[O`XOMTGOMTG[O`X````^P@ZF;<&!&G=!&G=!&G=" + "::L3::L3B;L9````````[O`X=;$5::L3::L3=K(5OM482G[F!&G=!&G=!&G=!&G=" + "::L3::L3KM,C````````O=PG::L3::L36YT&+'?G!&G=5(/HR=T<9H[MR=T<9H[M" + "::L3::L3K],C````````O-PG8:$)/GGB$5W,!&;9!&G=;I3PVNPFA*3YVNPFA*3Y" + "::L3::L3B;L9````````[?XT06O/!%3#!%3#/FG-N]$3/7?C!&G=!&G=!&G=!&G=" + "::L3::L3::L3XO0N````````Z_HNKL$\"KL$\"Z_HN````^P@ZD:W\\!&G=!&G=!&G=" + "::L379P$-F_798/:]@,U````````````````````````]@,U98/:&ES*!&77!&G=" + "E[8$!%3#!%3#!%3#98/:X.\\F````````````````X.\\E98/:!%3#!%3#!%3#CJ?T" + "_`P]P=(//&?+!%3#!%3#!%3#98/:G[3ZG[3Z98/:!%3#!%3#!%3#/&?+P-(._`P]" + "````````]P0VI;C]!%3#!%3#!%3#!%3#!%3#!%3#!%3#!%3#I;C]]P0V````````" + "````````````````YO4J?)7E!%3#!%3#!%3#!%3#?)7EYO4J````````````````" + "````````````````````````TN(;4W;24W;2TN(;````````````````````````" + ""; +\end{minicppcode} diff --git a/src/lst/mp/edsl_basic.tex b/src/lst/mp/edsl_basic.tex new file mode 100644 index 0000000..3f31d97 --- /dev/null +++ b/src/lst/mp/edsl_basic.tex @@ -0,0 +1,3 @@ +\begin{cppcode} + auto e = a + b * c; +\end{cppcode} diff --git a/src/lst/mp/edsl_linexpr.tex b/src/lst/mp/edsl_linexpr.tex new file mode 100644 index 0000000..ec7a4d7 --- /dev/null +++ b/src/lst/mp/edsl_linexpr.tex @@ -0,0 +1,3 @@ +\begin{cppcode} + 5 * (2 * x + 1) - (x + 3) +\end{cppcode} diff --git a/src/lst/mp/edsl_linexpr_opti.tex b/src/lst/mp/edsl_linexpr_opti.tex new file mode 100644 index 0000000..00c897e --- /dev/null +++ b/src/lst/mp/edsl_linexpr_opti.tex @@ -0,0 +1,3 @@ +\begin{cppcode} + 9 * x + 2 +\end{cppcode} diff --git a/src/lst/mp/edsl_linexpr_opti0.tex b/src/lst/mp/edsl_linexpr_opti0.tex new file mode 100644 index 0000000..3311cd6 --- /dev/null +++ b/src/lst/mp/edsl_linexpr_opti0.tex @@ -0,0 +1,3 @@ +\begin{cppcode} + 10 * x + 5 - (x + 3) +\end{cppcode} diff --git a/src/lst/mp/et.tex b/src/lst/mp/et.tex new file mode 100644 index 0000000..894b9db --- /dev/null +++ b/src/lst/mp/et.tex @@ -0,0 +1,16 @@ +\begin{cppcode} + Expr, + Expr, x + > + Cst<1> + > + >, + Expr + > + > +\end{cppcode} diff --git a/src/lst/mp/et_basic.tex b/src/lst/mp/et_basic.tex new file mode 100644 index 0000000..050ff9f --- /dev/null +++ b/src/lst/mp/et_basic.tex @@ -0,0 +1,9 @@ +\begin{cppcode} + Expr + > +\end{cppcode} diff --git a/src/lst/mp/et_pattern_lin.tex b/src/lst/mp/et_pattern_lin.tex new file mode 100644 index 0000000..9498978 --- /dev/null +++ b/src/lst/mp/et_pattern_lin.tex @@ -0,0 +1,7 @@ +\begin{cppcode} + Lin -> + Expr, x>, + Cst + > +\end{cppcode} diff --git a/src/lst/mp/et_pattern_mulcstlin.tex b/src/lst/mp/et_pattern_mulcstlin.tex new file mode 100644 index 0000000..f2fe770 --- /dev/null +++ b/src/lst/mp/et_pattern_mulcstlin.tex @@ -0,0 +1,4 @@ +\begin{cppcode} + Opt, Lin> + -> Lin +\end{cppcode} diff --git a/src/lst/mp/et_pattern_sublinlin.tex b/src/lst/mp/et_pattern_sublinlin.tex new file mode 100644 index 0000000..5226870 --- /dev/null +++ b/src/lst/mp/et_pattern_sublinlin.tex @@ -0,0 +1,4 @@ +\begin{cppcode} + Opt, Lin> + -> Lin +\end{cppcode} diff --git a/src/lst/mp/opadd.tex b/src/lst/mp/opadd.tex new file mode 100644 index 0000000..c9e80ce --- /dev/null +++ b/src/lst/mp/opadd.tex @@ -0,0 +1,6 @@ +\begin{cppcode} + template + auto operator+(Lhs, Rhs) { + return Expr{}; + } +\end{cppcode} diff --git a/src/lst/mp/opmul.tex b/src/lst/mp/opmul.tex new file mode 100644 index 0000000..0183d6d --- /dev/null +++ b/src/lst/mp/opmul.tex @@ -0,0 +1,6 @@ +\begin{cppcode} + template + auto operator*(Lhs, Rhs) { + return Expr{}; + } +\end{cppcode} diff --git a/src/lst/mp/pow.ct.asm.tex b/src/lst/mp/pow.ct.asm.tex new file mode 100644 index 0000000..14b56a5 --- /dev/null +++ b/src/lst/mp/pow.ct.asm.tex @@ -0,0 +1,7 @@ +\begin{asmcode} + imul ecx, ecx ; |$x^2$| + imul ecx, eax ; |$x^3$| + imul ecx, ecx ; |$x^6$| + imul ecx, ecx ; |$x^{12}$| + imul ecx, ecx ; |$x^{24}$| +\end{asmcode} diff --git a/src/lst/mp/pow.ct.call.tex b/src/lst/mp/pow.ct.call.tex new file mode 100644 index 0000000..87103bd --- /dev/null +++ b/src/lst/mp/pow.ct.call.tex @@ -0,0 +1,4 @@ +\begin{cppcode} + int x = 2; + int r = pow<24>(x); +\end{cppcode} diff --git a/src/lst/mp/pow.ct.tex b/src/lst/mp/pow.ct.tex new file mode 100644 index 0000000..c0d513f --- /dev/null +++ b/src/lst/mp/pow.ct.tex @@ -0,0 +1,11 @@ +\begin{cppcode} + template + constexpr int pow(int x) { + return x * pow(x); + } + + template<> + constexpr int pow<0>(int) { + return 1; + } +\end{cppcode} diff --git a/src/lst/mp/pow.rt.asm.tex b/src/lst/mp/pow.rt.asm.tex new file mode 100644 index 0000000..d9e97ae --- /dev/null +++ b/src/lst/mp/pow.rt.asm.tex @@ -0,0 +1,12 @@ +\begin{asmcode} + lea eax, [rsi-0x1] + mov r8d, 0x1 + test esi, esi + |\tikzmark{powjend}|jle end +|\tikzmark{powlloop}|loop: + |\tikzmark{powimul}|imul r8d, edi + |\tikzmark{powsub}|sub eax, 0x1 + |\tikzmark{powjloop}|jae loop +|\tikzmark{powlend}|end: + mov eax, r8d +\end{asmcode} diff --git a/src/lst/mp/pow.rt.call.tex b/src/lst/mp/pow.rt.call.tex new file mode 100644 index 0000000..0c76d10 --- /dev/null +++ b/src/lst/mp/pow.rt.call.tex @@ -0,0 +1,4 @@ +\begin{cppcode} + int x = 2; + int r = pow(x, 24); +\end{cppcode} diff --git a/src/lst/mp/pow.rt.tex b/src/lst/mp/pow.rt.tex new file mode 100644 index 0000000..1552f16 --- /dev/null +++ b/src/lst/mp/pow.rt.tex @@ -0,0 +1,7 @@ +\begin{cppcode} + int pow(int x, int n) { + int r = 1; + while(n-- > 0) r *= x; + return r; + } +\end{cppcode} diff --git a/src/lst/mp/tmptype.tex b/src/lst/mp/tmptype.tex new file mode 100644 index 0000000..9609f70 --- /dev/null +++ b/src/lst/mp/tmptype.tex @@ -0,0 +1,6 @@ +\begin{cppcode*}{mp tmptype} + template + struct Array { + T data[n]; + }; +\end{cppcode*} diff --git a/src/lst/mp/tmptype_Foo_256.tex b/src/lst/mp/tmptype_Foo_256.tex new file mode 100644 index 0000000..deea082 --- /dev/null +++ b/src/lst/mp/tmptype_Foo_256.tex @@ -0,0 +1,5 @@ +\begin{cppcode*}{mp tmptype Foo 256} + struct { + Foo data[256]; + }; +\end{cppcode*} diff --git a/src/lst/mp/tmptype_float_3.tex b/src/lst/mp/tmptype_float_3.tex new file mode 100644 index 0000000..962cae9 --- /dev/null +++ b/src/lst/mp/tmptype_float_3.tex @@ -0,0 +1,5 @@ +\begin{cppcode*}{mp tmptype float 3} + struct { + float data[3]; + }; +\end{cppcode*} diff --git a/src/lst/mp/tmptype_int_5.tex b/src/lst/mp/tmptype_int_5.tex new file mode 100644 index 0000000..8551d2a --- /dev/null +++ b/src/lst/mp/tmptype_int_5.tex @@ -0,0 +1,5 @@ +\begin{cppcode*}{mp tmptype int 5} + struct { + int data[5]; + }; +\end{cppcode*} diff --git a/src/lst/pfor/indices_small.tex b/src/lst/pfor/indices_small.tex new file mode 100644 index 0000000..9500e56 --- /dev/null +++ b/src/lst/pfor/indices_small.tex @@ -0,0 +1,4 @@ +\begin{cppcode} + Index i; + auto e = (c[i] = c[i+ctv<1>]); +\end{cppcode} diff --git a/src/lst/pfor/loop.tex b/src/lst/pfor/loop.tex new file mode 100644 index 0000000..2c0f7e8 --- /dev/null +++ b/src/lst/pfor/loop.tex @@ -0,0 +1,9 @@ +\begin{cppcode} + for(int i = 0; i < n; ++i) { + |\tikzmark{pforloopl2b}|a[i] = a[i] * |\tikzmark{pforloopbrb}|b[i]|\tikzmark{pforloopbre}|;|\tikzmark{pforloopl2e}| + |\tikzmark{pforloopl3b}\tikzmark{pforloopcwb}|c[i]|\tikzmark{pforloopcwe}| = c[i+1] - |\tikzmark{pforloopdrb}|d[i]|\tikzmark{pforloopdre}|;|\tikzmark{pforloopl3e}| + |\tikzmark{pforloopl4b}\tikzmark{pforloopbwb}|b[i]|\tikzmark{pforloopbwe}| = b[i] + i;|\tikzmark{pforloopl4e}| + |\tikzmark{pforloopl5b}\tikzmark{pforloopdwb}|d[i]|\tikzmark{pforloopdwe}| = std::pow(|\tikzmark{pforloopcrb}|c[i]|\tikzmark{pforloopcre}|, e[i]);|\tikzmark{pforloopl5e}| + |\tikzmark{pforloopl6b}|f[i*i] = 2 * f[i*i];|\tikzmark{pforloopl6e}| + } +\end{cppcode} diff --git a/src/lst/pfor/loop_noanim.tex b/src/lst/pfor/loop_noanim.tex new file mode 100644 index 0000000..6cf1ba3 --- /dev/null +++ b/src/lst/pfor/loop_noanim.tex @@ -0,0 +1,9 @@ +\begin{cppcode} + for(int i = 0; i < n; ++i) { + a[i] = a[i] * b[i]; + c[i] = c[i+1] - d[i]; + b[i] = b[i] + i; + d[i] = std::pow(c[i], e[i]); + f[i*i] = 2 * f[i*i]; + } +\end{cppcode} diff --git a/src/lst/pfor/loop_par.tex b/src/lst/pfor/loop_par.tex new file mode 100644 index 0000000..d63d85d --- /dev/null +++ b/src/lst/pfor/loop_par.tex @@ -0,0 +1,13 @@ +\begin{cppcode} + #pragma omp parallel for + for(int i = 0; i < n; ++i) { + a[i] = a[i] * b[i]; + b[i] = b[i] + i; + f[i*i] = 2 * f[i*i]; + } + + for(int i = 0; i < n; ++i) { + c[i] = c[i+1] - d[i]; + d[i] = std::pow(c[i], e[i]); + } +\end{cppcode} diff --git a/src/lst/pfor/loop_pfor.tex b/src/lst/pfor/loop_pfor.tex new file mode 100644 index 0000000..883ad4d --- /dev/null +++ b/src/lst/pfor/loop_pfor.tex @@ -0,0 +1,9 @@ +\begin{cppcode} + parallelFor(Range{0, n}, + a[i] = a[i] * b[i], + c[i] = c[i+ctv<1>] - d[i], + b[i] = b[i] + i, + d[i] = pow(c[i], e[i]) + f[i*i] = 2 * f[i*i] + ); +\end{cppcode} diff --git a/src/lst/pfor/loop_split.tex b/src/lst/pfor/loop_split.tex new file mode 100644 index 0000000..687de56 --- /dev/null +++ b/src/lst/pfor/loop_split.tex @@ -0,0 +1,14 @@ +\begin{cppcode} + for(int i = 0; i < n; ++i) { + a[i] = a[i] * b[i]; + b[i] = b[i] + i; + } + + for(int i = 0; i < n; ++i) { + |\tikzmark{pforloopsplitcwb}|c[i]|\tikzmark{pforloopsplitcwe}| = |\tikzmark{pforloopsplitcrb}|c[i+1]|\tikzmark{pforloopsplitcre}| - d[i]; + d[i] = std::pow(c[i], e[i]); + } + + for(int i = 0; i < n; ++i) + f[i*i] = 2 * f[i*i]; +\end{cppcode} diff --git a/src/main_default.tex b/src/main_default.tex new file mode 100644 index 0000000..8db4703 --- /dev/null +++ b/src/main_default.tex @@ -0,0 +1,11 @@ +\input{src/usr/silence} + +\documentclass{beamer} + +\input{src/preamble} +\input{src/usr/beamer} + +% \setbeameroption{show notes on second screen=right} +% \includeonlyframes{current} + +\input{src/document} diff --git a/src/main_notes.tex b/src/main_notes.tex new file mode 100644 index 0000000..5ec5c76 --- /dev/null +++ b/src/main_notes.tex @@ -0,0 +1,18 @@ +\input{src/usr/silence} + +\documentclass{beamer} + +\input{src/preamble} +\input{src/usr/beamer} + +\setbeameroption{show notes on second screen=right} +% \setbeamertemplate{note page}{ + % { + % \centering + % \insertslideintonotes{0.4} + % } + % \rule{\textwidth}{0.1pt} + % \insertnote +% } + +\input{src/document} diff --git a/src/preamble.tex b/src/preamble.tex new file mode 100644 index 0000000..53febd8 --- /dev/null +++ b/src/preamble.tex @@ -0,0 +1,168 @@ +%{{{ packages " +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage[english,main=french]{babel} + +\usepackage{lmodern} +\usepackage{microtype} + +\usepackage{minted}% before csquotes +\usepackage[most,minted]{tcolorbox} + +% \usepackage[ + % backend=biber, + % doi=false,isbn=false, + % style=alphabetic,citestyle=authoryear,sorting=nyt, + % maxbibnames=99,maxcitenames=2,uniquelist=false, + % language=auto]{biblatex} + +\usepackage{multicol} + +\usepackage{amsmath}% cleveref +\usepackage{amsthm} +\usepackage{amssymb} +\usepackage{stmaryrd} +\usepackage{ulem} + +\usepackage[binary-units]{siunitx} + +\usepackage{algorithm} + +\usepackage{tikz} +\usepackage{ifthen} +\usepackage[tikz]{ocgx2} +\usepackage{tikz-qtree} + +\usepackage{morewrites}% increase 16 open files limit (scrwfile is incompatible with titletoc) +\usepackage{chngcntr} + +\PassOptionsToPackage{hyphens}{url} +\usepackage{hyperref} +\usepackage[noabbrev,nameinlink]{cleveref}% after hyperref (see documentation) +\usepackage[commentColor=black!75]{algpseudocodex}% after cleveref +% \usepackage[acronyms,section=chapter]{glossaries-extra}% after hyperref +\usepackage{sty/acref}% after cleveref +%}}} + +%{{{ configuration " +\title{Application de la métaprogrammation template à la conception de bibliothèques actives de +parallélisation assistée} +\subtitle{} +\author[Alexis Pereda]{Alexis Pereda} +\institute[UCA]{Université Clermont Auvergne} +\date{01/07/2021} + +\subject{Application de la métaprogrammation template à la conception de bibliothèques actives de +parallélisation assistée} +\keywords{C++, métaprogrammation, template, parallélisation, parallélisation automatique, +répétabilité} + +% \input{src/usr/bibstyle} +% \addbibresource{src/references.bib} +% \AtEveryCite{\restorecommand\mkbibnamefamily}% disable small caps in citations + +\sisetup{locale=FR} +\DeclareSIUnit{\octet}{o} + +\microtypesetup{ + protrusion=alltext-nott, + expansion=alltext-nott, + final +} + +\hypersetup{ + pdftitle={Soutenance de thèse sur l'application de la métaprogrammation template à la conception + de bibliothèques actives de parallélisation assistée}, + pdfnewwindow=true, + % colorlinks, + linkcolor={red!50!black}, + citecolor={blue!50!black}, + urlcolor={blue!80!black} +} + +%{{{ TikZ " +\usetikzlibrary{shapes,matrix,fit,spy,arrows.meta,chains,backgrounds} +\usetikzlibrary{positioning,intersections,calc} +\usetikzlibrary{decorations.pathreplacing,decorations.pathmorphing} +\usetikzlibrary{shadows,patterns} +\usetikzlibrary{tikzmark} +\usetikzlibrary{external} + +\AtBeginEnvironment{tikzpicture}{\shorthandoff{;}} +%}}} + +%{{{ acref " +\crefname{listing}{extrait de code}{extraits de code} +\Crefname{listing}{Extrait de code}{Extraits de code} +\acrefarticle{listing}{l'}{L'} +%}}} + +%{{{ locale " +\renewcommand{\listingscaption}{Extrait de code} +\renewcommand{\listoflistingscaption}{Liste des extraits de code} + +% \DefineBibliographyStrings{french}{% + % backrefpage = {page}, + % backrefpages = {pages}, + % in = {dans}, +% } +% \DeclareFieldFormat{titlecase}{\MakeSentenceCase{\foreignlanguage{english}{#1}}} +%}}} +%}}} + +%{{{ input extra configuration " +\input{src/usr/alg} +\input{src/usr/colors} +\input{src/usr/listing} +\input{src/usr/math} +\input{src/usr/ocg} +\input{src/usr/tikz} +%}}} + +%{{{ other input " +\input{src/tikz/common} +%}}} + +%{{{ commands " +\newcommand*{\en}[1]{\foreignlanguage{english}{\textit{#1}}} +\newcommand*{\encitetitle}[1]{{\foreignlanguage{english}{\citetitle{#1}}}} + +\newcommand*{\chapterdir}{} +\newcommand*{\inputchd}[2]{\input{src/#1/\chapterdir/#2}} +\newcommand*{\labelchd}[2]{\label{#1:\chapterdir/#2}} + +\def\compilationversion{} + +\input{src/commands} + +\newcommand{\fig}[1]{% + \begin{figure}% + \input{src/fig/#1}% + \end{figure}% +} +\newcommand<>{\figonly}[1]{\only#2{\fig{#1}}} +\newcommand<>{\figvisible}[1]{\visible#2{\fig{#1}}} +\newcommand<>{\figuncover}[1]{\uncover#2{\fig{#1}}} + +\newcommand{\alg}[1]{% + \input{src/alg/#1}% +} + +\newcommand{\lst}[1]{% + \input{src/lst/#1}% +} +\newcommand<>{\lstonly}[1]{\only#2{\lst{#1}}} +\newcommand<>{\lstvisible}[1]{\visible#2{\lst{#1}}} + +\newcommand\resetpauses{\setcounter{beamerpauses}{1}} +\newcommand\startnotes{\resetpauses} + +\newcommand<>{\colorletonly}[2]{\only#3{\colorlet{#1}{#2}}} +%}}} + +%{{{ glossaries " +% \makeglossaries +% \setabbreviationstyle[acronym]{short-long} + +% \input{src/acronyms} +%}}} diff --git a/src/references.bib b/src/references.bib new file mode 100644 index 0000000..cfa17b5 --- /dev/null +++ b/src/references.bib @@ -0,0 +1,2457 @@ + +@book{ref:abrahams2004, + title = {C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond}, + shorttitle = {C++ Template Metaprogramming}, + author = {Abrahams, David and Gurtovoy, Aleksey}, + date = {2004}, + edition = {5. printing}, + publisher = {{Addison-Wesley}}, + location = {{Boston, Mass}}, + annotation = {OCLC: 553640289}, + isbn = {978-0-321-22725-6}, + langid = {english}, + pagetotal = {373}, + series = {The {{C}}++ In-Depth Series} +} + +@inproceedings{ref:ahmad1997, + title = {Automatic Parallelization and Scheduling of Programs on Multiprocessors Using {{CASCH}}}, + booktitle = {Proceedings of the {{International Conference}} on {{Parallel Processing}}}, + author = {Ahmad, Ishfaq and Kwok, Yu-Kwong and Wu, Min-You and Shu, Wei}, + date = {1997}, + pages = {288--291}, + publisher = {{IEEE Computer Society}}, + location = {{Washington, DC, USA}}, + doi = {10.1109/ICPP.1997.622657}, + isbn = {978-0-8186-8108-0}, + langid = {english}, + series = {{{ICPP}} '97} +} + +@book{ref:aho1986, + title = {Compilers: Principles, Techniques, and Tools}, + shorttitle = {Compilers}, + author = {Aho, Alfred V and Sethi, Ravi and Ullman, Jeffrey D}, + date = {1986}, + publisher = {{Pearson Education}}, + location = {{India}}, + annotation = {OCLC: 57725385}, + isbn = {978-81-7808-046-8}, + langid = {english} +} + +@inproceedings{ref:aldinucci2009, + title = {Efficient Streaming Applications on Multi-Core with {{FastFlow}}: The Biosequence Alignment Test-Bed}, + booktitle = {{{ParCo}} 2009: {{Parallel Computing}}}, + author = {Aldinucci, Marco and Danelutto, Marco and Meneghin, Massimiliano and Torquati, Massimo and Kilpatrick, Peter}, + date = {2009-09}, + volume = {19}, + pages = {273--280}, + doi = {10.3233/978-1-60750-530-3-273}, + langid = {english} +} + +@article{ref:alexandrescu2000, + title = {Traits: The Else-If-Then of Types}, + author = {Alexandrescu, Andrei}, + date = {2000}, + journaltitle = {C++ Report}, + volume = {12}, + langid = {english}, + number = {4} +} + +@book{ref:alexandrescu2001, + title = {Modern {{C}}++ Design: Generic Programming and Design Patterns Applied}, + shorttitle = {Modern {{C}}++ Design}, + author = {Alexandrescu, Andrei}, + date = {2001}, + edition = {2. print}, + publisher = {{Addison-Wesley}}, + location = {{Boston, Mass.}}, + annotation = {OCLC: 747927476}, + isbn = {0-201-70431-5}, + langid = {english}, + pagetotal = {352}, + series = {The {{C}}++ In-Depth Series} +} + +@inproceedings{ref:amdahl1967, + title = {Validity of the Single Processor Approach to Achieving Large Scale Computing Capabilities}, + booktitle = {Proceedings of the {{April}} 18-20, 1967, Spring Joint Computer Conference on - {{AFIPS}} '67 ({{Spring}})}, + author = {Amdahl, Gene M.}, + date = {1967}, + pages = {483}, + publisher = {{ACM Press}}, + location = {{Atlantic City, New Jersey}}, + doi = {10.1145/1465482.1465560}, + eventtitle = {The {{April}} 18-20, 1967, Spring Joint Computer Conference}, + langid = {english} +} +% == BibLateX quality report for ref:amdahl1967: +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:arabnejad2018, + title = {{{AutoPar}}-{{Clava}}: {{An Automatic Parallelization}} Source-to-Source Tool for {{C}} Code Applications}, + shorttitle = {{{AutoPar}}-{{Clava}}}, + booktitle = {Proceedings of the 9th {{Workshop}} and 7th {{Workshop}} on {{Parallel Programming}} and {{RunTime Management Techniques}} for {{Manycore Architectures}} and {{Design Tools}} and {{Architectures}} for {{Multicore Embedded Computing Platforms}} - {{PARMA}}-{{DITAM}} '18}, + author = {Arabnejad, Hamid and Bispo, Jo\~ao and Barbosa, Jorge G. and Cardoso, Jo\~ao M.P.}, + date = {2018}, + pages = {13--19}, + publisher = {{ACM Press}}, + location = {{Manchester, United Kingdom}}, + doi = {10.1145/3183767.3183770}, + eventtitle = {The 9th {{Workshop}} and 7th {{Workshop}}}, + isbn = {978-1-4503-6444-7}, + langid = {english} +} + +@inproceedings{ref:artigas2000, + title = {Automatic Loop Transformations and Parallelization for {{Java}}}, + booktitle = {Proceedings of the 14th International Conference on {{Supercomputing}} - {{ICS}} '00}, + author = {Artigas, Pedro V. and Gupta, Manish and Midkiff, Samuel P. and Moreira, Jos\'e E.}, + date = {2000}, + pages = {1--10}, + publisher = {{ACM Press}}, + location = {{Santa Fe, New Mexico, United States}}, + doi = {10.1145/335231.335232}, + eventtitle = {The 14th International Conference}, + isbn = {978-1-58113-270-0}, + langid = {english} +} +% == BibLateX quality report for ref:artigas2000: +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:asai2014, + title = {Compiling a Reflective Language Using {{MetaOCaml}}}, + booktitle = {Proceedings of the 2014 {{International Conference}} on {{Generative Programming}}: {{Concepts}} and {{Experiences}} - {{GPCE}} 2014}, + author = {Asai, Kenichi}, + date = {2014}, + pages = {113--122}, + publisher = {{ACM Press}}, + doi = {10.1145/2658761.2658775}, + eventtitle = {The 2014 {{International Conference}}}, + isbn = {978-1-4503-3161-6}, + langid = {english} +} + +@article{ref:bachelet2013, + title = {Template Metaprogramming Techniques for Concept-Based Specialization}, + author = {Bachelet, Bruno and Mahul, Antoine and Yon, Lo\"ic}, + date = {2013}, + journaltitle = {Scientific Programming}, + volume = {21}, + pages = {43--61}, + issn = {1058-9244, 1875-919X}, + doi = {10.1155/2013/581397}, + langid = {english}, + number = {1-2} +} +% == BibLateX quality report for ref:bachelet2013: +% 'issn': not a valid ISSN + +@thesis{ref:bachelet2016, + title = {Flexibilit\'e et Performance de Codes de Calcul En Optimisation et Simulation}, + author = {Bachelet, Bruno}, + date = {2016}, + institution = {{Universit\'e Blaise Pascal - Clermont-Ferrand II}}, + langid = {english} +} +% == BibLateX quality report for ref:bachelet2016: +% Missing required field 'type' + +@article{ref:bachelet2017, + title = {Designing Expression Templates with Concepts}, + shorttitle = {Designing Expression Templates with Concepts}, + author = {Bachelet, Bruno and Yon, Lo\"ic}, + date = {2017-11}, + journaltitle = {Software: Practice and Experience}, + volume = {47}, + pages = {1521--1537}, + issn = {00380644}, + doi = {10.1002/spe.2483}, + langid = {english}, + number = {11} +} + +@article{ref:barney2009, + title = {{{POSIX}} Threads Programming}, + author = {Barney, Blaise}, + date = {2009}, + journaltitle = {Lawrence Livermore National Laborator}, + pages = {26}, + langid = {english} +} + +@article{ref:batcher1980, + title = {Design of a Massively Parallel Processor}, + author = {Batcher, Kenneth}, + date = {1980-09}, + journaltitle = {IEEE Transactions on Computers}, + volume = {C-29}, + pages = {836--840}, + issn = {0018-9340}, + doi = {10.1109/TC.1980.1675684}, + number = {9} +} + +@article{ref:batlle2002, + title = {A {{New FPGA}}/{{DSP}}-{{Based Parallel Architecture}} for {{Real}}-{{Time Image Processing}}}, + author = {Batlle, J}, + date = {2002-10}, + journaltitle = {Real-Time Imaging}, + volume = {8}, + pages = {345--356}, + issn = {10772014}, + doi = {10.1006/rtim.2001.0273}, + langid = {english}, + number = {5} +} +% == BibLateX quality report for ref:batlle2002: +% ? Title looks like it was stored in title-case in Zotero + +@inproceedings{ref:beard2015, + title = {{{RaftLib}}: A {{C}}++ Template Library for High Performance Stream Parallel Processing}, + shorttitle = {{{RaftLib}}}, + author = {Beard, Jonathan C. and Li, Peng and Chamberlain, Roger D.}, + date = {2015}, + pages = {96--105}, + publisher = {{ACM}}, + location = {{New York, NY, USA}}, + doi = {10.1145/2712386.2712400}, + isbn = {978-1-4503-3404-4}, + langid = {english}, + series = {{{PMAM}} '15} +} +% == BibLateX quality report for ref:beard2015: +% Missing required field 'booktitle' + +@incollection{ref:benoit2005, + title = {Two Fundamental Concepts in Skeletal Parallel Programming}, + booktitle = {Computational {{Science}} \textendash{} {{ICCS}} 2005}, + author = {Benoit, Anne and Cole, Murray}, + date = {2005}, + volume = {3515}, + pages = {764--771}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/11428848_98}, + isbn = {978-3-540-26043-1}, + langid = {english} +} +% == BibLateX quality report for ref:benoit2005: +% Missing required field 'editor' + +@article{ref:bernstein1966, + title = {Analysis of Programs for Parallel Processing}, + author = {Bernstein, A. J.}, + date = {1966-10}, + journaltitle = {IEEE Transactions on Electronic Computers}, + volume = {EC-15}, + pages = {757--763}, + issn = {0367-7508}, + doi = {10.1109/PGEC.1966.264565}, + langid = {english}, + number = {5} +} + +@inproceedings{ref:binkley2007, + title = {Source Code Analysis: A Road Map}, + shorttitle = {Source {{Code Analysis}}}, + booktitle = {Future of {{Software Engineering}} ({{FOSE}} '07)}, + author = {Binkley, David}, + date = {2007-05}, + pages = {104--119}, + publisher = {{IEEE}}, + location = {{Minneapolis, MN, USA}}, + doi = {10.1109/FOSE.2007.27}, + eventtitle = {Future of {{Software Engineering}}}, + isbn = {978-0-7695-2829-8} +} + +@article{ref:blume1995, + title = {Effective Automatic Parallelization with {{Polaris}}}, + author = {Blume, William and Eigenmann, Rudolf and Faigin, Keith and Grout, John and Hoeflinger, Jay and Padua, David and Petersen, Paul and Pottenger, William and Rauchwerger, Lawrence and Tu, Peng and Weatherford, Stephen}, + date = {1995}, + journaltitle = {International Journal of Parallel Programming}, + langid = {english} +} + +@article{ref:blumofe1996, + title = {Cilk: An Efficient Multithreaded Runtime System}, + shorttitle = {Cilk}, + author = {Blumofe, Robert D. and Joerg, Christopher F. and Kuszmaul, Bradley C. and Leiserson, Charles E. and Randall, Keith H. and Zhou, Yuli}, + date = {1996-08}, + journaltitle = {Journal of Parallel and Distributed Computing}, + volume = {37}, + pages = {55--69}, + issn = {07437315}, + doi = {10.1006/jpdc.1996.0107}, + langid = {english}, + number = {1} +} + +@inproceedings{ref:bondhugula2008, + title = {A Practical Automatic Polyhedral Parallelizer and Locality Optimizer}, + booktitle = {Proceedings of the 2008 {{ACM SIGPLAN}} Conference on {{Programming}} Language Design and Implementation - {{PLDI}} '08}, + author = {Bondhugula, Uday and Hartono, Albert and Ramanujam, J. and Sadayappan, P.}, + date = {2008}, + pages = {101}, + publisher = {{ACM Press}}, + location = {{Tucson, AZ, USA}}, + doi = {10.1145/1375581.1375595}, + eventtitle = {The 2008 {{ACM SIGPLAN}} Conference}, + isbn = {978-1-59593-860-2}, + langid = {english} +} +% == BibLateX quality report for ref:bondhugula2008: +% ? Unsure about the formatting of the booktitle + +@online{ref:boostlambda, + title = {Boost.{{Lambda}}}, + author = {J\"arvi, Jaakko and Powell, Gary}, + date = {2003}, + url = {https://www.boost.org/doc/libs/1_73_0/doc/html/lambda.html}, + urldate = {2020-06-10}, + annotation = {boostlambda} +} + +@inproceedings{ref:bringmann1993, + title = {Speculative Execution Exception Recovery Using Write-Back Suppression}, + booktitle = {Proceedings of the 26th {{Annual International Symposium}} on {{Microarchitecture}}}, + author = {Bringmann, Roger A. and Mahlke, Scott A. and Hank, Richard E. and Gyllenhaal, John C. and Hwu, Wen-mei W.}, + date = {1993}, + pages = {214--223}, + publisher = {{IEEE}}, + location = {{Austin, TX, USA}}, + doi = {10.1109/MICRO.1993.282757}, + eventtitle = {Proceedings of 26th {{Annual International Symposium}} on {{Microarchitecture}} ({{Cat}}. {{No}}.{{93TH0602}}-3)}, + isbn = {978-0-8186-5280-6} +} + +@book{ref:butenhof1997, + title = {Programming with {{POSIX}} Threads}, + author = {Butenhof, David R.}, + date = {1997}, + publisher = {{Addison-Wesley}}, + location = {{Reading, Mass}}, + isbn = {978-0-201-63392-4}, + pagetotal = {381}, + series = {Addison-{{Wesley}} Professional Computing Series} +} + +@report{ref:campbell1996, + title = {Towards the Classification of Algorithmic Skeletons}, + author = {Campbell, Duncan K. G.}, + date = {1996}, + institution = {{University of York department of computer science YCS}}, + langid = {english}, + number = {YCS 276} +} +% == BibLateX quality report for ref:campbell1996: +% Missing required field 'type' + +@thesis{ref:caux2012, + title = {Parall\'elisation et optimisation d'un simulateur de morphog\'en\`ese d'organes. Application aux \'el\'ements du rein}, + author = {Caux, Jonathan}, + date = {2012-10}, + institution = {{Universit\'e Blaise Pascal}}, + url = {https://tel.archives-ouvertes.fr/tel-00932303/}, + langid = {french}, + pagetotal = {267} +} +% == BibLateX quality report for ref:caux2012: +% Missing required field 'type' + +@article{ref:chamberlain2007, + title = {Parallel Programmability and the {{Chapel}} Language}, + author = {Chamberlain, B.L. and Callahan, D. and Zima, H.P.}, + date = {2007-08}, + journaltitle = {The International Journal of High Performance Computing Applications}, + volume = {21}, + pages = {291--312}, + issn = {1094-3420, 1741-2846}, + doi = {10.1177/1094342007078442}, + langid = {english}, + number = {3} +} +% == BibLateX quality report for ref:chamberlain2007: +% 'issn': not a valid ISSN + +@article{ref:chan2004, + title = {Run-Time Support for the Automatic Parallelization of {{Java}} Programs}, + author = {Chan, Bryan and Abdelrahman, Tarek S.}, + date = {2004-04}, + journaltitle = {The Journal of Supercomputing}, + volume = {28}, + pages = {91--117}, + issn = {0920-8542}, + doi = {10.1023/B:SUPE.0000014804.20789.21}, + langid = {english}, + number = {1} +} + +@article{ref:ciechanowicz2009, + title = {The {{M\"unster}} Skeleton Library {{Muesli}} - a Comprehensive Overview}, + author = {Ciechanowicz, Philipp and Poldner, Michael and Kuchen, Herbert}, + date = {2009}, + langid = {english} +} +% == BibLateX quality report for ref:ciechanowicz2009: +% Missing required field 'journaltitle' + +@book{ref:cole1989, + title = {Algorithmic Skeletons: Structured Management of Parallel Computation}, + shorttitle = {Algorithmic {{Skeletons}}}, + author = {Cole, Murray}, + date = {1989}, + publisher = {{MIT Press}}, + location = {{Cambridge, MA, USA}}, + isbn = {978-0-262-53086-6} +} + +@article{ref:collard1995, + title = {Automatic Parallelization of While-Loops Using Speculative Execution}, + author = {Collard, Jean-Fran\c{c}ois}, + date = {1995-04}, + journaltitle = {International Journal of Parallel Programming}, + volume = {23}, + pages = {191--219}, + issn = {0885-7458, 1573-7640}, + doi = {10.1007/BF02577789}, + langid = {english}, + number = {2} +} +% == BibLateX quality report for ref:collard1995: +% 'issn': not a valid ISSN + +@inproceedings{ref:cordes2010, + title = {Automatic Parallelization of Embedded Software Using Hierarchical Task Graphs and Integer Linear Programming}, + booktitle = {International {{Conference}} on {{Hardware Software Codesign}}}, + author = {Cordes, Daniel and Marwedel, Peter and Mallik, Arindam}, + date = {2010}, + pages = {267--276}, + langid = {english} +} +% == BibLateX quality report for ref:cordes2010: +% ? Unsure about the formatting of the booktitle + +@article{ref:courtois1971, + title = {Concurrent Control with ``Readers'' and ``Writers''}, + author = {Courtois, P. J. and Heymans, F. and Parnas, D. L.}, + date = {1971-10-01}, + journaltitle = {Communications of the ACM}, + volume = {14}, + pages = {667--668}, + issn = {00010782}, + doi = {10.1145/362759.362813}, + number = {10} +} + +@online{ref:cppref_ref_decl, + title = {Reference Declaration}, + author = {{cppreference}}, + date = {2011}, + url = {https://en.cppreference.com/w/cpp/language/reference#Reference_collapsing}, + urldate = {2019-11-06}, + annotation = {cppref ref decl} +} + +@patent{ref:cray1978, + title = {Computer Vector Register Processing}, + author = {Cray, Seymour R}, + date = {1978}, + pages = {19}, + langid = {english}, + number = {4128880}, + type = {patent} +} +% == BibLateX quality report for ref:cray1978: +% Unexpected field 'pages' + +@book{ref:culler1997, + title = {Parallel Computer Architecture: A Hardware/Software Approach}, + shorttitle = {Parallel Computer Architecture}, + author = {Culler, David E. and Singh, Jaswinder Pal and Gupta, Anoop}, + date = {1997}, + edition = {Nachdr.}, + publisher = {{Kaufmann}}, + location = {{San Francisco, Calif}}, + annotation = {OCLC: 255755318}, + isbn = {978-1-55860-343-1}, + langid = {english}, + pagetotal = {879} +} + +@article{ref:dagum1998, + title = {{{OpenMP}}: An Industry Standard {{API}} for Shared-Memory Programming}, + shorttitle = {{{OpenMP}}}, + author = {Dagum, L. and Menon, R.}, + date = {1998-01}, + journaltitle = {IEEE Computational Science and Engineering}, + volume = {5}, + pages = {46--55}, + issn = {1070-9924}, + doi = {10.1109/99.660313}, + langid = {english}, + number = {1} +} + +@article{ref:dahl1966, + title = {{{SIMULA}}: An {{ALGOL}}-Based Simulation Language}, + shorttitle = {{{SIMULA}}}, + author = {Dahl, Ole-Johan and Nygaard, Kristen}, + date = {1966-09-01}, + journaltitle = {Communications of the ACM}, + volume = {9}, + pages = {671--678}, + issn = {00010782}, + doi = {10.1145/365813.365819}, + langid = {english}, + number = {9} +} + +@article{ref:dantzig1954, + title = {Solution of a Large-Scale Traveling-Salesman Problem}, + author = {Dantzig, George and Fulkerson, Ray and Johnson, Selmer}, + date = {1954}, + journaltitle = {Journal of the operations research society of America}, + edition = {Informs}, + pages = {393--410}, + entrysubtype = {newspaper} +} +% == BibLateX quality report for ref:dantzig1954: +% Unexpected field 'edition' + +@inproceedings{ref:davidson1995, + title = {Improving Instruction-Level Parallelism by Loop Unrolling and Dynamic Memory Disambiguation}, + booktitle = {Proceedings of the 28th {{Annual International Symposium}} on {{Microarchitecture}}}, + author = {Davidson, J.W. and Jinturkar, S.}, + date = {1995-11}, + pages = {125--132}, + publisher = {{IEEE}}, + location = {{Ann Arbor, MI, USA}}, + doi = {10.1109/MICRO.1995.476820}, + eventtitle = {Proceedings of {{MICRO}}'95: 28th {{Annual IEEE}}/{{ACM International Symposium}} on {{Microarchitecture}}}, + isbn = {978-0-8186-7349-8} +} + +@incollection{ref:dietz2010, + title = {{{MIMD Interpretation}} on a {{GPU}}}, + booktitle = {Languages and {{Compilers}} for {{Parallel Computing}}}, + author = {Dietz, Henry G. and Young, B. Dalton}, + editor = {Gao, Guang R. and Pollock, Lori L. and Cavazos, John and Li, Xiaoming}, + date = {2010}, + volume = {5898}, + pages = {65--79}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/978-3-642-13374-9_5}, + editorb = {Hutchison, David and Kanade, Takeo and Kittler, Josef and Kleinberg, Jon M. and Mattern, Friedemann and Mitchell, John C. and Naor, Moni and Nierstrasz, Oscar and Pandu Rangan, C. and Steffen, Bernhard and Sudan, Madhu and Terzopoulos, Demetri and Tygar, Doug and Vardi, Moshe Y. and Weikum, Gerhard}, + editorbtype = {redactor}, + isbn = {978-3-642-13373-2 978-3-642-13374-9}, + series = {Lecture {{Notes}} in {{Computer Science}}} +} +% == BibLateX quality report for ref:dietz2010: +% 'isbn': not a valid ISBN +% ? Title looks like it was stored in title-case in Zotero + +@incollection{ref:dijkstra1968, + title = {Cooperating Sequential Processes}, + booktitle = {The {{Origin}} of {{Concurrent Programming}}}, + author = {Dijkstra, Edsger W.}, + editor = {Hansen, Per Brinch}, + date = {1968}, + pages = {65--138}, + publisher = {{Springer New York}}, + location = {{New York, NY}}, + doi = {10.1007/978-1-4757-3472-0_2}, + isbn = {978-1-4419-2986-0}, + langid = {english} +} + +@online{ref:dimov2002, + title = {The Forwarding Problem: Arguments}, + shorttitle = {N1385}, + author = {Dimov, Peter and Hinnant, Howard E. and Abrahams, David}, + date = {2002-09}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm}, + annotation = {dimov2002}, + langid = {english} +} + +@inproceedings{ref:dittamo2007, + title = {Parallelization of {{C}}\# Programs through Annotations}, + booktitle = {Computational {{Science}} \textendash{} {{ICCS}} 2007}, + author = {Dittamo, Cristian and Cisternino, Antonio and Danelutto, Marco}, + editor = {Shi, Yong and family=Albada, given=Geert Dick, prefix=van, useprefix=true and Dongarra, Jack and Sloot, Peter M. A.}, + date = {2007}, + volume = {4488}, + pages = {585--592}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/978-3-540-72586-2_86}, + editorb = {Hutchison, David and Kanade, Takeo and Kittler, Josef and Kleinberg, Jon M. and Mattern, Friedemann and Mitchell, John C. and Naor, Moni and Nierstrasz, Oscar and Rangan, C. Pandu and Steffen, Bernhard and Sudan, Madhu and Terzopoulos, Demetri and Tygar, Doug and Vardi, Moshe Y. and Weikum, Gerhard}, + editorbtype = {redactor}, + series = {Lecture {{Notes}} in {{Computer Science}}} +} +% == BibLateX quality report for ref:dittamo2007: +% Unexpected field 'editorb' +% Unexpected field 'editorbtype' +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:drummond2009, + title = {Replicability Is Not Reproducibility: Nor Is It Good Science}, + booktitle = {Proceedings of the {{Evaluation Methods}} for {{Machine Learning Workshop}}}, + author = {Drummond, Chris}, + date = {2009}, + pages = {696--701}, + location = {{Montreal, Quebec, Canada}}, + eventtitle = {26th {{International Conference}} for {{Machine Learning}}}, + langid = {english} +} + +@article{ref:ernstsson2018, + title = {{{SkePU}} 2: Flexible and Type-Safe Skeleton Programming for Heterogeneous Parallel Systems}, + shorttitle = {{{SkePU}} 2}, + author = {Ernstsson, August and Li, Lu and Kessler, Christoph}, + date = {2018-02}, + journaltitle = {International Journal of Parallel Programming}, + volume = {46}, + pages = {62--80}, + issn = {0885-7458, 1573-7640}, + doi = {10.1007/s10766-017-0490-5}, + langid = {english}, + number = {1} +} +% == BibLateX quality report for ref:ernstsson2018: +% 'issn': not a valid ISSN + +@article{ref:esterie2014, + title = {The Numerical Template Toolbox: A Modern {{C}}++ Design for Scientific Computing}, + shorttitle = {The Numerical Template Toolbox}, + author = {Est\'erie, Pierre and Falcou, Joel and Gaunard, Mathias and Laprest\'e, Jean-Thierry and Lacassagne, Lionel}, + date = {2014-12}, + journaltitle = {Journal of Parallel and Distributed Computing}, + volume = {74}, + pages = {3240--3253}, + issn = {07437315}, + doi = {10.1016/j.jpdc.2014.07.002}, + langid = {english}, + number = {12} +} + +@article{ref:falcou2006a, + title = {Quaff: Efficient {{C}}++ Design for Parallel Skeletons}, + shorttitle = {Quaff}, + author = {Falcou, J. and S\'erot, J. and Chateau, T. and Laprest\'e, J. T.}, + date = {2006-09}, + journaltitle = {Parallel Computing}, + shortjournal = {Parallel Computing}, + volume = {32}, + pages = {604--615}, + issn = {0167-8191}, + doi = {10.1016/j.parco.2006.06.001}, + langid = {english}, + number = {7}, + series = {Algorithmic {{Skeletons}}} +} + +@incollection{ref:falcou2008, + title = {Meta-Programming Applied to Automatic {{SMP}} Parallelization of Linear Algebra Code}, + booktitle = {Euro-{{Par}} 2008 \textendash{} {{Parallel Processing}}}, + author = {Falcou, Joel and S\'erot, Jocelyn and Pech, Lucien and Laprest\'e, Jean-Thierry}, + date = {2008}, + volume = {5168}, + pages = {729--738}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/978-3-540-85451-7_78}, + isbn = {978-3-540-85450-0}, + langid = {english}, + series = {Lecture {{Notes}} in {{Computer Science}}} +} +% == BibLateX quality report for ref:falcou2008: +% Missing required field 'editor' + +@article{ref:feo1989, + title = {A Probabilistic Heuristic for a Computationally Difficult Set Covering Problem}, + author = {Feo, Thomas A. and Resende, Mauricio G. C.}, + date = {1989-04}, + journaltitle = {Operations Research Letters}, + volume = {8}, + pages = {67--71}, + issn = {01676377}, + doi = {10.1016/0167-6377(89)90002-3}, + langid = {english}, + number = {2} +} + +@article{ref:ferrante1987, + title = {The Program Dependence Graph and {{Its}} Use in Optimization}, + author = {Ferrante, Jeanne and Ottenstein, Karl J. and Warren, Joe D.}, + date = {1987-07}, + journaltitle = {ACM Transactions on Programming Languages and Systems}, + volume = {9}, + pages = {319--349}, + issn = {0164-0925}, + doi = {10.1145/24039.24041}, + langid = {english}, + number = {3} +} + +@article{ref:flynn1972, + title = {Some Computer Organizations and Their Effectiveness}, + author = {Flynn, Michael J.}, + date = {1972-09}, + journaltitle = {IEEE Transactions on Computers}, + volume = {C-21}, + pages = {948--960}, + issn = {0018-9340}, + doi = {10.1109/TC.1972.5009071}, + number = {9} +} + +@article{ref:fonseca2016, + title = {Automatic Parallelization: Executing Sequential Programs on a Task-Based Parallel Runtime}, + shorttitle = {Automatic {{Parallelization}}}, + author = {Fonseca, Alcides and Cabral, Bruno and Rafael, Jo\~ao and Correia, Ivo}, + date = {2016-12}, + journaltitle = {International Journal of Parallel Programming}, + volume = {44}, + pages = {1337--1358}, + issn = {0885-7458, 1573-7640}, + doi = {10.1007/s10766-016-0426-5}, + langid = {english}, + number = {6} +} +% == BibLateX quality report for ref:fonseca2016: +% 'issn': not a valid ISSN + +@inproceedings{ref:frumkin1998, + title = {A Comparison of Automatic Parallelization Tools/Compilers on the {{SGI Origin}} 2000}, + booktitle = {Proceedings of the 1998 {{ACM}}/{{IEEE Conference}} on {{Supercomputing}}}, + author = {Frumkin, Michael and Hribar, Michelle and Jin, Haoqiang and Waheed, Abdul and Yan, Jerry}, + date = {1998}, + pages = {1--22}, + publisher = {{IEEE Computer Society}}, + location = {{Washington, DC, USA}}, + url = {http://dl.acm.org/citation.cfm?id=509058.509119}, + urldate = {2018-02-15}, + isbn = {978-0-89791-984-5}, + langid = {english}, + series = {{{SC}} '98} +} + +@book{ref:gamma1995, + title = {Design Patterns: Elements of Reusable Software Architecture}, + author = {Gamma, Erich and Helm, Richard and Johnson, Ralph and Vlissides, John}, + date = {1995}, + edition = {Addison-Wesley} +} + +@inproceedings{ref:geuns2011, + title = {Parallelization of While Loops in Nested Loop Programs for Shared-Memory Multiprocessor Systems}, + booktitle = {2011 {{Design}}, {{Automation}} \& {{Test}} in {{Europe}}}, + author = {Geuns, S J and Bekooij, M J G and Bijlsma, T and Corporaal, H}, + date = {2011-03}, + pages = {1--6}, + publisher = {{IEEE}}, + location = {{Grenoble}}, + doi = {10.1109/DATE.2011.5763118}, + eventtitle = {2011 {{Design}}, {{Automation}} \& {{Test}} in {{Europe}}}, + isbn = {978-3-9810801-8-6} +} +% == BibLateX quality report for ref:geuns2011: +% ? Unsure about the formatting of the booktitle + +@article{ref:gingras1990, + title = {Dining Philosophers Revisited}, + author = {Gingras, Armando R.}, + date = {1990-08}, + journaltitle = {ACM SIGCSE Bulletin}, + volume = {22}, + pages = {21}, + issn = {0097-8418}, + doi = {10.1145/101085.101091}, + langid = {english}, + number = {3} +} + +@article{ref:gordon1998, + title = {A Survey of Fast Exponentiation Methods}, + author = {Gordon, Daniel M.}, + date = {1998-04}, + journaltitle = {Journal of Algorithms}, + volume = {27}, + pages = {129--146}, + issn = {01966774}, + doi = {10.1006/jagm.1997.0913}, + langid = {english}, + number = {1} +} + +@incollection{ref:griebl1995, + title = {Generation of Synchronous Code for Automatic Parallelization of While Loops}, + booktitle = {{{EURO}}-{{PAR}} '95 {{Parallel Processing}}}, + author = {Griebl, Martin and Collard, Jean-Fran\c{c}ois}, + editor = {Haridi, Seif and Ali, Khayri and Magnusson, Peter}, + date = {1995}, + volume = {966}, + pages = {313--326}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/BFb0020474}, + editorb = {Goos, Gerhard and Hartmanis, Juris and family=Leeuwen, given=Jan, prefix=van, useprefix=true}, + editorbtype = {redactor}, + isbn = {978-3-540-60247-7}, + langid = {english}, + series = {Lecture {{Notes}} in {{Computer Science}}} +} + +@inproceedings{ref:griebl1998, + title = {Code Generation in the Polytope Model}, + booktitle = {Proceedings. 1998 {{International Conference}} on {{Parallel Architectures}} and {{Compilation Techniques}} ({{Cat}}. {{No}}.{{98EX192}})}, + author = {Griebl, M. and Lengauer, C. and Wetzel, S.}, + date = {1998}, + pages = {106--111}, + publisher = {{IEEE Comput. Soc}}, + location = {{Paris, France}}, + doi = {10.1109/PACT.1998.727179}, + eventtitle = {1998 {{International Conference}} on {{Parallel Architectures}} and {{Compilation Techniques}}}, + isbn = {978-0-8186-8591-0} +} +% == BibLateX quality report for ref:griebl1998: +% ? Unsure about the formatting of the booktitle + +@article{ref:gropp1996, + title = {A High-Performance, Portable Implementation of the {{MPI}} Message Passing Interface Standard}, + author = {Gropp, William and Lusk, Ewing and Doss, Nathan and Skjellum, Anthony}, + date = {1996-09}, + journaltitle = {Parallel Computing}, + shortjournal = {Parallel Computing}, + volume = {22}, + pages = {789--828}, + issn = {0167-8191}, + doi = {10.1016/0167-8191(96)00024-5}, + langid = {english}, + number = {6} +} + +@inproceedings{ref:gustafson1988, + title = {The Scaled-Sized Model: A Revision of {{Amdahl}}'s Law}, + booktitle = {Supercomputing}, + author = {Gustafson, John L}, + date = {1988}, + pages = {130--133}, + location = {{Boston, MA, USA}}, + eventtitle = {International Conference on Supercomputing}, + langid = {english} +} +% == BibLateX quality report for ref:gustafson1988: +% ? Unsure about the formatting of the booktitle + +@article{ref:halstead1985, + title = {{{MULTILISP}}: A Language for Concurrent Symbolic Computation}, + shorttitle = {{{MULTILISP}}}, + author = {Halstead, Robert H.}, + date = {1985-10}, + journaltitle = {ACM Transactions on Programming Languages and Systems (TOPLAS)}, + volume = {7}, + pages = {501--538}, + issn = {0164-0925, 1558-4593}, + doi = {10.1145/4472.4478}, + langid = {english}, + number = {4} +} +% == BibLateX quality report for ref:halstead1985: +% 'issn': not a valid ISSN + +@incollection{ref:hardtlein2005, + title = {Fast {{Expression Templates}}: Object-Oriented {{High Performance Computing}}}, + booktitle = {Lecture {{Notes}} in {{Computer Science}}}, + author = {H\"ardtlein, Jochen and Linke, Alexander and Pflaum, Christoph}, + date = {2005}, + edition = {Springer-Verlag}, + pages = {1055--1063}, + langid = {english} +} +% == BibLateX quality report for ref:hardtlein2005: +% Missing required field 'editor' + +@inproceedings{ref:hill1998, + title = {Practical Barrier Synchronisation}, + booktitle = {Proceedings of the {{Sixth Euromicro Workshop}} on {{Parallel}} and {{Distributed Processing}} - {{PDP}} '98 -}, + author = {Hill, J.M.D. and Skillicorn, D.B.}, + date = {1998}, + pages = {438--444}, + publisher = {{IEEE Comput. Soc}}, + location = {{Madrid, Spain}}, + doi = {10.1109/EMPDP.1998.647231}, + eventtitle = {Sixth {{Euromicro Workshop}} on {{Parallel}} and {{Distributed Processing}} - {{PDP}} '98 -}, + isbn = {978-0-8186-8332-9} +} + +@article{ref:hill2013, + title = {Distribution of Random Streams for Simulation Practitioners: {{CPE HPCS}} 2010 Special Issue Submission}, + shorttitle = {Distribution of Random Streams for Simulation Practitioners}, + author = {Hill, David R. C. and Mazel, Claude and Passerat-Palmbach, Jonathan and Traore, Mamadou K.}, + date = {2013-07}, + journaltitle = {Concurrency and Computation: Practice and Experience}, + volume = {25}, + pages = {1427--1442}, + issn = {15320626}, + doi = {10.1002/cpe.2942}, + langid = {english}, + number = {10} +} + +@article{ref:hill2015, + title = {Parallel Random Numbers, Simulation, and Reproducible Research}, + author = {Hill, David R. C.}, + date = {2015-07}, + journaltitle = {Computing in Science \& Engineering}, + volume = {17}, + pages = {66--71}, + issn = {1521-9615}, + doi = {10.1109/MCSE.2015.79}, + number = {4} +} + +@article{ref:hoare1971, + title = {Proof of a Program: {{FIND}}}, + shorttitle = {Proof of a Program}, + author = {Hoare, C. A. R.}, + date = {1971-01-01}, + journaltitle = {Communications of the ACM}, + volume = {14}, + pages = {39--45}, + issn = {00010782}, + doi = {10.1145/362452.362489}, + number = {1} +} + +@online{ref:hoberock2013, + title = {A Parallel Algorithms Library}, + shorttitle = {N3724}, + author = {Hoberock, Jared and Marathe, Jaydeep and Garland, Michael and Giroux, Olivier and Grover, Vinod and Laksberg, Artur and Sutter, Herb and Robison, Arch}, + date = {2013-08-30}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3724.pdf}, + annotation = {hoberock2013}, + langid = {english} +} + +@inproceedings{ref:horwitz1989, + title = {Dependence Analysis for Pointer Variables}, + booktitle = {Proceedings of the {{ACM SIGPLAN}} 1989 {{Conference}} on {{Programming}} Language Design and Implementation - {{PLDI}} '89}, + author = {Horwitz, S. and Pfeiffer, P. and Reps, T.}, + date = {1989}, + pages = {28--40}, + publisher = {{ACM Press}}, + location = {{Portland, Oregon, United States}}, + doi = {10.1145/73141.74821}, + eventtitle = {The {{ACM SIGPLAN}} 1989 {{Conference}}}, + isbn = {978-0-89791-306-5}, + langid = {english} +} + +@article{ref:howard1973, + title = {Mixed Solutions for the Deadlock Problem}, + author = {Howard, John H.}, + date = {1973-07-01}, + journaltitle = {Communications of the ACM}, + volume = {16}, + pages = {427--430}, + issn = {00010782}, + doi = {10.1145/362280.362290}, + number = {7} +} + +@article{ref:hwu1986, + title = {{{HPSm}}, a High Performance Restricted Data Flow Architecture Having Minimal Functionality}, + author = {Hwu, W. and Patt, Y. N.}, + date = {1986-06-01}, + journaltitle = {ACM SIGARCH Computer Architecture News}, + volume = {14}, + pages = {297--306}, + issn = {01635964}, + doi = {10.1145/17356.17391}, + langid = {english}, + number = {2} +} + +@inproceedings{ref:iglberger2012, + title = {High Performance Smart Expression Template Math Libraries}, + booktitle = {2012 {{International Conference}} on {{High Performance Computing}} \& {{Simulation}} ({{HPCS}})}, + author = {Iglberger, Klaus and Hager, Georg and Treibig, Jan and Rude, Ulrich}, + date = {2012-07}, + pages = {367--373}, + publisher = {{IEEE}}, + location = {{Madrid, Spain}}, + doi = {10.1109/HPCSim.2012.6266939}, + eventtitle = {2012 {{International Conference}} on {{High Performance Computing}} \& {{Simulation}} ({{HPCS}})}, + isbn = {978-1-4673-2362-8}, + langid = {english} +} +% == BibLateX quality report for ref:iglberger2012: +% ? Unsure about the formatting of the booktitle + +@article{ref:ioannidis2005, + title = {Why Most Published Research Findings Are False}, + author = {Ioannidis, John P. A.}, + date = {2005-08-30}, + journaltitle = {PLoS Medicine}, + volume = {2}, + pages = {e124}, + issn = {1549-1676}, + doi = {10.1371/journal.pmed.0020124}, + langid = {english}, + number = {8} +} + +@report{ref:iso2011, + title = {Programming Language - {{C}}++}, + author = {{ISO} and {C++ committee}}, + date = {2011-09}, + pages = {1338}, + institution = {{International Organization for Standardization}}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf}, + langid = {english}, + number = {ISO/IEC 14882:2011}, + type = {Standard} +} + +@report{ref:iso2020, + title = {Programming Language - {{C}}++}, + author = {{ISO} and {C++ committee}}, + date = {2020-01}, + pages = {1815}, + institution = {{International Organization for Standardization}}, + langid = {english}, + number = {ISO/IEC CD 14882}, + type = {Standard} +} + +@inproceedings{ref:jackson1992, + title = {Exploiting Bit-Level Parallelism in {{Boolean}} Matrix Operations for Graph Analysis}, + booktitle = {Proceedings {{IEEE Southeastcon}} '92}, + author = {Jackson, D.J. and Whiteside, D.M. and Wurtz, L.T.}, + date = {1992}, + pages = {838--841}, + publisher = {{IEEE}}, + location = {{Birmingham, AL, USA}}, + doi = {10.1109/SECON.1992.202252}, + eventtitle = {{{IEEE Southeastcon}} '92}, + isbn = {978-0-7803-0494-9} +} + +@article{ref:jarvi2001, + title = {Side Effects and Partial Function Application in {{C}}++}, + author = {J\"arvi, Jaakko and Powell, Gary}, + date = {2001}, + journaltitle = {Proceedings of the Multiparadigm Programming with OO Languages Workshop (MPOOL'01)}, + pages = {17}, + langid = {english} +} + +@article{ref:jarvi2003a, + title = {The Lambda Library: Unnamed Functions in {{C}}++}, + shorttitle = {The {{Lambda Library}}}, + author = {J\"arvi, Jaakko and Powell, Gary and Lumsdaine, Andrew}, + date = {2003-03}, + journaltitle = {Software: Practice and Experience}, + volume = {33}, + pages = {259--291}, + issn = {0038-0644}, + doi = {10.1002/spe.504}, + langid = {english}, + number = {3} +} + +@inproceedings{ref:jo2013, + title = {Automatic Vectorization of Tree Traversals}, + booktitle = {Proceedings of the 22nd {{International Conference}} on {{Parallel Architectures}} and {{Compilation Techniques}}}, + author = {Jo, Youngjoon and Goldfarb, Michael and Kulkarni, Milind}, + date = {2013}, + pages = {12}, + publisher = {{IEEE}}, + location = {{Edinburgh, UK}}, + doi = {10.1109/PACT.2013.6618832}, + eventtitle = {22nd {{International Conference}} on {{Parallel Architectures}} and {{Compilation Techniques}}}, + isbn = {978-1-4799-1021-2}, + langid = {english} +} + +@inproceedings{ref:kale1993, + title = {{{CHARM}}++: A Portable Concurrent Object Oriented System Based on {{C}}++}, + shorttitle = {{{CHARM}}++}, + booktitle = {Proceedings of the {{Conference}} on {{Object Oriented Programming Systems}}, {{Languages}} and {{Applications}}}, + author = {Kale, Laxmikant V. and Krishnan, Sanjeev}, + date = {1993}, + pages = {91--108}, + publisher = {{ACM Press}}, + doi = {10.1145/165854.165874}, + isbn = {978-0-89791-587-8}, + langid = {english} +} + +@article{ref:keller1975, + title = {Look-Ahead Processors}, + author = {Keller, Robert M.}, + date = {1975-12-01}, + journaltitle = {ACM Computing Surveys}, + volume = {7}, + pages = {177--195}, + issn = {03600300}, + doi = {10.1145/356654.356657}, + number = {4} +} + +@article{ref:kennedy1994, + title = {Compiler Technology for Machine-Indepenent Parallel Programming}, + author = {Kennedy, Ken}, + date = {1994-02}, + journaltitle = {International Journal of Parallel Programming}, + volume = {22}, + pages = {79--98}, + issn = {0885-7458, 1573-7640}, + doi = {10.1007/BF02577793}, + langid = {english}, + number = {1} +} +% == BibLateX quality report for ref:kennedy1994: +% 'issn': not a valid ISSN + +@book{ref:kernighan1988, + title = {The {{C}} Programming Language}, + author = {Kernighan, Brian W and Ritchie, Dennis M}, + date = {1988}, + publisher = {{Prentice Hall}}, + location = {{Upper Saddle River, NJ}}, + annotation = {OCLC: 1047831315}, + isbn = {978-0-13-110362-7}, + langid = {english} +} + +@article{ref:kirby2003, + title = {A New Look at Expression Templates for Maxtrix Computation}, + author = {Kirby, R.C.}, + date = {2003-05}, + journaltitle = {Computing in Science \& Engineering}, + volume = {5}, + pages = {66--70}, + issn = {1521-9615}, + doi = {10.1109/MCISE.2003.1196309}, + langid = {english}, + number = {3} +} + +@article{ref:kish2002, + title = {End of {{Moore}}'s Law: Thermal (Noise) Death of Integration in Micro and Nano Electronics}, + shorttitle = {End of {{Moore}}'s Law}, + author = {Kish, Laszlo B}, + date = {2002-12}, + journaltitle = {Physics Letters A}, + volume = {305}, + pages = {144--149}, + issn = {03759601}, + doi = {10.1016/S0375-9601(02)01365-8}, + langid = {english}, + number = {3-4} +} + +@inproceedings{ref:klint2009, + title = {{{RASCAL}}: A Domain Specific Language for Source Code Analysis and Manipulation}, + shorttitle = {{{RASCAL}}}, + booktitle = {2009 {{Ninth IEEE International Working Conference}} on {{Source Code Analysis}} and {{Manipulation}}}, + author = {Klint, Paul and family=Storm, given=Tijs, prefix=van der, useprefix=false and Vinju, Jurgen}, + date = {2009}, + pages = {168--177}, + publisher = {{IEEE}}, + location = {{Edmonton, Alberta, Canada}}, + doi = {10.1109/SCAM.2009.28}, + eventtitle = {2009 {{Ninth IEEE International Working Conference}} on {{Source Code Analysis}} and {{Manipulation}}}, + isbn = {978-0-7695-3793-1} +} +% == BibLateX quality report for ref:klint2009: +% ? Unsure about the formatting of the booktitle + +@article{ref:kremer1988, + title = {Advanced Tools and Techniques for Automatic Parallelization}, + author = {Kremer, Ulrich and Bast, Heinz-J and Gerndt, Michael and Zima, Hans P.}, + date = {1988-09}, + journaltitle = {Parallel Computing}, + shortjournal = {Parallel Computing}, + volume = {7}, + pages = {387--393}, + issn = {0167-8191}, + doi = {10.1016/0167-8191(88)90057-9}, + langid = {english}, + number = {3} +} + +@inproceedings{ref:kuchen2002, + title = {Higher-Order Functions and Partial Applications for a {{C}}++ Skeleton Library}, + booktitle = {Proceedings of the 2002 Joint {{ACM}}-{{ISCOPE}} Conference on {{Java Grande}} - {{JGI}} '02}, + author = {Kuchen, Herbert and Striegnitz, J\"org}, + date = {2002}, + pages = {122--130}, + publisher = {{ACM Press}}, + location = {{Seattle, Washington, USA}}, + doi = {10.1145/583810.583824}, + eventtitle = {The 2002 Joint {{ACM}}-{{ISCOPE}} Conference}, + isbn = {978-1-58113-599-2}, + langid = {english} +} +% == BibLateX quality report for ref:kuchen2002: +% ? Unsure about the formatting of the booktitle + +@incollection{ref:kuchen2002a, + title = {A Skeleton Library}, + booktitle = {Euro-{{Par}} 2002 {{Parallel Processing}}}, + author = {Kuchen, Herbert}, + date = {2002}, + volume = {2400}, + pages = {620--629}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/3-540-45706-2_86}, + isbn = {978-3-540-44049-9} +} +% == BibLateX quality report for ref:kuchen2002a: +% Missing required field 'editor' + +@inproceedings{ref:landi1991, + title = {Pointer-Induced Aliasing: A Problem Taxonomy}, + shorttitle = {Pointer-Induced Aliasing}, + booktitle = {Proceedings of the 18th {{ACM SIGPLAN}}-{{SIGACT}} Symposium on {{Principles}} of Programming Languages - {{POPL}} '91}, + author = {Landi, William and Ryder, Barbara G.}, + date = {1991}, + pages = {93--103}, + publisher = {{ACM Press}}, + location = {{Orlando, Florida, United States}}, + doi = {10.1145/99583.99599}, + eventtitle = {The 18th {{ACM SIGPLAN}}-{{SIGACT}} Symposium}, + isbn = {978-0-89791-419-2}, + langid = {english} +} +% == BibLateX quality report for ref:landi1991: +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:lazarescu2012, + title = {Dynamic Trace-Based Data Dependency Analysis for Parallelization of {{C}} Programs}, + booktitle = {2012 {{IEEE}} 12th {{International Working Conference}} on {{Source Code Analysis}} and {{Manipulation}}}, + author = {Lazarescu, Mihai T. and Lavagno, Luciano}, + date = {2012-09}, + pages = {126--131}, + publisher = {{IEEE}}, + location = {{Riva del Garda, Italy}}, + doi = {10.1109/SCAM.2012.15}, + eventtitle = {2012 12th {{IEEE Working Conference}} on {{Source Code Analysis}} and {{Manipulation}} ({{SCAM}})}, + isbn = {978-0-7695-4783-1} +} +% == BibLateX quality report for ref:lazarescu2012: +% ? Unsure about the formatting of the booktitle + +@article{ref:legaux2013, + title = {{{OSL}}: An Algorithmic Skeleton Library with Exceptions}, + shorttitle = {{{OSL}}}, + author = {Legaux, Joeffrey and Loulergue, Fr\'ed\'eric and Jubertie, Sylvain}, + date = {2013}, + journaltitle = {Procedia Computer Science}, + volume = {18}, + pages = {260--269}, + issn = {18770509}, + doi = {10.1016/j.procs.2013.05.189}, + langid = {english} +} + +@inproceedings{ref:lengauer1995, + title = {On the Parallelization of Loop Nests Containing While Loops}, + booktitle = {Proceedings of the {{First Aizu International Symposium}} on {{Parallel Algorithms}}/{{Architecture Synthesis}}}, + author = {Lengauer, C. and Griebl, M.}, + date = {1995}, + pages = {10--18}, + publisher = {{IEEE Comput. Soc. Press}}, + location = {{Fukushima, Japan}}, + doi = {10.1109/AISPAS.1995.401360}, + eventtitle = {The {{First Aizu International Symposium}} on {{Parallel Algorithms}}/{{Architecture Synthesis}}}, + isbn = {978-0-8186-7038-1} +} + +@inproceedings{ref:leyton2010, + title = {Skandium: Multi-Core Programming with Algorithmic Skeletons}, + shorttitle = {Skandium}, + booktitle = {2010 18th {{Euromicro Conference}} on {{Parallel}}, {{Distributed}} and {{Network}}-Based {{Processing}}}, + author = {Leyton, Mario and Piquer, Jos\'e M.}, + date = {2010-02}, + pages = {289--296}, + publisher = {{IEEE}}, + location = {{Pisa}}, + doi = {10.1109/PDP.2010.26}, + annotation = {Print ISBN: 978-1-4244-5672-7}, + eventtitle = {18th {{Euromicro International Conference}} on {{Parallel}}, {{Distributed}} and {{Network}}-{{Based Processing}} ({{PDP}} 2010)}, + isbn = {978-1-4244-5673-4} +} +% == BibLateX quality report for ref:leyton2010: +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:li2013, + title = {{{NUMA}}-Aware Shared-Memory Collective Communication for {{MPI}}}, + booktitle = {Proceedings of the 22nd {{International Symposium}} on {{High}}-{{Performance Parallel}} and {{Distributed Computing}}}, + author = {Li, Shigang and Hoefler, Torsten and Snir, Marc}, + date = {2013}, + pages = {85--96}, + publisher = {{Association for Computing Machinery}}, + location = {{New York, New York, USA}}, + doi = {10.1145/2462902.2462903}, + eventtitle = {{{HPDC}} '13}, + isbn = {978-1-4503-1910-2}, + langid = {english} +} + +@article{ref:lilis2019, + title = {A Survey of Metaprogramming Languages}, + author = {Lilis, Yannis and Savidis, Anthony}, + date = {2019-10-16}, + journaltitle = {ACM Computing Surveys}, + volume = {52}, + pages = {1--39}, + issn = {03600300}, + doi = {10.1145/3354584}, + langid = {english}, + number = {6} +} + +@article{ref:liskov1988, + title = {Promises: Linguistic Support for Efficient Asynchronous Procedure Calls in Distributed Systems}, + shorttitle = {Promises}, + author = {Liskov, B. and Shrira, L.}, + date = {1988-07-01}, + journaltitle = {ACM SIGPLAN Notices}, + volume = {23}, + pages = {260--267}, + issn = {03621340}, + doi = {10.1145/960116.54016}, + langid = {english}, + number = {7} +} + +@incollection{ref:lopez2016, + title = {Using {{C}}++ {{AMP}} to Accelerate {{HPC}} Applications on Multiple Platforms}, + booktitle = {High {{Performance Computing}}}, + author = {Lopez, M. Graham and Bergstrom, Christopher and Li, Ying Wai and Elwasif, Wael and Hernandez, Oscar}, + editor = {Taufer, Michela and Mohr, Bernd and Kunkel, Julian M.}, + date = {2016}, + volume = {9945}, + pages = {563--576}, + publisher = {{Springer International Publishing}}, + location = {{Cham}}, + doi = {10.1007/978-3-319-46079-6_38}, + isbn = {978-3-319-46078-9}, + series = {Lecture {{Notes}} in {{Computer Science}}} +} + +@incollection{ref:lourenco2003, + title = {Iterated {{Local Search}}}, + booktitle = {Handbook of {{Metaheuristics}}}, + author = {Louren\c{c}o, Helena R. and Martin, Olivier C. and St\"utzle, Thomas}, + editor = {Glover, Fred and Kochenberger, Gary A.}, + date = {2003}, + pages = {320--353}, + publisher = {{Springer US}}, + location = {{Boston, MA}}, + doi = {10.1007/0-306-48056-5_11}, + isbn = {978-0-306-48056-0}, + langid = {english}, + series = {International {{Series}} in {{Operations Research}} \& {{Management Science}}} +} +% == BibLateX quality report for ref:lourenco2003: +% ? Title looks like it was stored in title-case in Zotero + +@article{ref:loveman1993, + title = {High Performance {{Fortran}}}, + author = {Loveman, D. B.}, + date = {1993-02}, + journaltitle = {IEEE Parallel \& Distributed Technology: Systems \& Applications}, + volume = {1}, + pages = {25--42}, + issn = {1063-6552}, + doi = {10.1109/88.219857}, + langid = {english}, + number = {1} +} + +@inproceedings{ref:luebke2008, + title = {{{CUDA}}: Scalable Parallel Programming for High-Performance Scientific Computing}, + shorttitle = {{{CUDA}}}, + booktitle = {2008 5th {{IEEE International Symposium}} on {{Biomedical Imaging}}: {{From Nano}} to {{Macro}}}, + author = {Luebke, David}, + date = {2008-05}, + pages = {836--838}, + publisher = {{IEEE}}, + location = {{Paris, France}}, + doi = {10.1109/ISBI.2008.4541126}, + eventtitle = {2008 5th {{IEEE International Symposium}} on {{Biomedical Imaging}} ({{ISBI}} 2008)}, + isbn = {978-1-4244-2002-5} +} + +@article{ref:mack2011, + title = {Fifty Years of {{Moore}}'s Law}, + author = {Mack, Chris A.}, + date = {2011-05}, + journaltitle = {IEEE Transactions on Semiconductor Manufacturing}, + volume = {24}, + pages = {202--207}, + issn = {0894-6507}, + doi = {10.1109/TSM.2010.2096437}, + number = {2} +} + +@online{ref:maddock2002, + title = {A Proposal to Add Type Traits to the Standard Library}, + shorttitle = {N1345}, + author = {Maddock, John}, + date = {2002-03-07}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1345.html}, + urldate = {2020-09-01}, + annotation = {maddock2002}, + langid = {english} +} + +@incollection{ref:marques2013, + title = {Algorithmic Skeleton Framework for the Orchestration of {{GPU}} Computations}, + booktitle = {Euro-{{Par}} 2013 {{Parallel Processing}}}, + author = {Marques, Ricardo and Paulino, Herv\'e and Alexandre, Fernando and Medeiros, Pedro D.}, + date = {2013}, + volume = {8097}, + pages = {874--885}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/978-3-642-40047-6_86}, + isbn = {978-3-642-40046-9}, + langid = {english} +} +% == BibLateX quality report for ref:marques2013: +% Missing required field 'editor' + +@thesis{ref:masliah2016, + title = {Automatic code generation methods applied to numerical linear algebra in high performance computing}, + author = {Masliah, Ian}, + date = {2016}, + institution = {{Universit\'e Paris-Saclay}}, + url = {https://tel.archives-ouvertes.fr/tel-01395496/document}, + langid = {french} +} +% == BibLateX quality report for ref:masliah2016: +% Missing required field 'type' + +@inproceedings{ref:mathews2016, + title = {Automatic Code Parallelization with {{OpenMP}} Task Constructs}, + booktitle = {2016 {{International Conference}} on {{Information Science}} ({{ICIS}})}, + author = {Mathews, Manju and Abraham, Jisha P}, + date = {2016-08}, + pages = {233--238}, + publisher = {{IEEE}}, + location = {{Kochi, India}}, + doi = {10.1109/INFOSCI.2016.7845333}, + eventtitle = {2016 {{International Conference}} in {{Information Science}} ({{ICIS}})}, + isbn = {978-1-5090-1987-8} +} +% == BibLateX quality report for ref:mathews2016: +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:matsuzaki2006a, + title = {Towards Automatic Parallelization of Tree Reductions in Dynamic Programming}, + booktitle = {Proceedings of the Eighteenth Annual {{ACM}} Symposium on {{Parallelism}} in Algorithms and Architectures - {{SPAA}} '06}, + author = {Matsuzaki, Kiminori and Hu, Zhenjiang and Takeichi, Masato}, + date = {2006}, + pages = {39}, + publisher = {{ACM Press}}, + location = {{Cambridge, Massachusetts, USA}}, + doi = {10.1145/1148109.1148116}, + eventtitle = {The Eighteenth Annual {{ACM}} Symposium}, + isbn = {978-1-59593-452-9}, + langid = {english} +} +% == BibLateX quality report for ref:matsuzaki2006a: +% ? Unsure about the formatting of the booktitle + +@book{ref:mattson2005, + title = {Patterns for Parallel Programming}, + author = {Mattson, Timothy G. and Sanders, Beverly A. and Massingill, Berna}, + date = {2005}, + publisher = {{Addison-Wesley}}, + location = {{Boston}}, + isbn = {978-0-321-22811-6}, + pagetotal = {355} +} + +@book{ref:mccool2012, + title = {Structured Parallel Programming: Patterns for Efficient Computation}, + shorttitle = {Structured {{Parallel Programming}}}, + author = {McCool, Michael and Reinders, James and Robison, Arch}, + date = {2012}, + publisher = {{Elsevier}}, + eprint = {2hYqeoO8t8IC}, + eprinttype = {googlebooks}, + isbn = {978-0-12-391443-9}, + langid = {english}, + pagetotal = {433} +} + +@online{ref:meneide2020, + title = {{{std::embed}} and {{\#depend}}}, + shorttitle = {p1040r6}, + author = {Meneide, JeanHeyd}, + date = {2020-02-29}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1040r6.html}, + annotation = {meneide2020}, + langid = {english} +} + +@inproceedings{ref:munshi2009, + title = {The {{OpenCL}} Specification}, + booktitle = {2009 {{IEEE Hot Chips}} 21 {{Symposium}} ({{HCS}})}, + author = {Munshi, Aaftab}, + date = {2009-08}, + pages = {1--314}, + publisher = {{IEEE}}, + location = {{Stanford, CA}}, + doi = {10.1109/HOTCHIPS.2009.7478342}, + eventtitle = {2009 {{IEEE Hot Chips}} 21 {{Symposium}} ({{HCS}})}, + isbn = {978-1-4673-8873-3} +} +% == BibLateX quality report for ref:munshi2009: +% ? Unsure about the formatting of the booktitle + +@incollection{ref:musser1989, + title = {Generic Programming}, + booktitle = {Symbolic and {{Algebraic Computation}}}, + author = {Musser, David R. and Stepanov, Alexander A.}, + editor = {Gianni, P.}, + date = {1989}, + volume = {358}, + pages = {13--25}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/3-540-51084-2_2}, + editorb = {Goos, G. and Hartmanis, J. and Barstow, D. and Brauer, W. and Brinch Hansen, P. and Gries, D. and Luckham, D. and Moler, C. and Pnueli, A. and Seegm\"uller, G. and Stoer, J. and Wirth, N.}, + editorbtype = {redactor}, + isbn = {978-3-540-51084-0}, + langid = {english} +} + +@article{ref:namsungkim2003, + title = {Leakage Current: {{Moore}}'s Law Meets Static Power}, + shorttitle = {Leakage Current}, + author = {{Nam Sung Kim} and Austin, T. and Blaauw, D. and Mudge, T. and Flautner, K. and {Jie S. Hu} and Irwin, M.J. and Kandemir, M. and Narayanan, V.}, + date = {2003-12}, + journaltitle = {Computer}, + shortjournal = {Computer}, + volume = {36}, + pages = {68--75}, + issn = {0018-9162}, + doi = {10.1109/MC.2003.1250885}, + langid = {english}, + number = {12} +} + +@inproceedings{ref:neth2019, + title = {Automatic Parallelization of Irregular X86-64 Loops}, + booktitle = {2019 {{IEEE}}/{{ACM International Symposium}} on {{Code Generation}} and {{Optimization}} ({{CGO}})}, + author = {Neth, Brandon and Strout, Michelle Mills}, + date = {2019-02}, + pages = {266--266}, + publisher = {{IEEE}}, + location = {{Washington, DC, USA}}, + doi = {10.1109/CGO.2019.8661167}, + eventtitle = {2019 {{IEEE}}/{{ACM International Symposium}} on {{Code Generation}} and {{Optimization}} ({{CGO}})}, + isbn = {978-1-72811-436-1} +} +% == BibLateX quality report for ref:neth2019: +% ? Unsure about the formatting of the booktitle + +@article{ref:netzer1992, + title = {What Are Race Conditions?: {{Some}} Issues and Formalizations}, + shorttitle = {What {{Are Race Conditions}}?}, + author = {Netzer, Robert H. B. and Miller, Barton P.}, + date = {1992-03}, + journaltitle = {ACM Letters on Programming Languages and Systems}, + volume = {1}, + pages = {74--88}, + issn = {1057-4514}, + doi = {10.1145/130616.130623}, + langid = {english}, + number = {1} +} + +@book{ref:nichols1996, + title = {{{PThreads Programming}}: {{A POSIX Standard}} for {{Better Multiprocessing}}}, + shorttitle = {{{PThreads Programming}}}, + author = {Nichols, Bradford and Buttlar, Dick and Farrell, Jacqueline}, + date = {1996}, + publisher = {{O'Reilly Media, Inc.}}, + eprint = {oMtCFSnvwmoC}, + eprinttype = {googlebooks}, + isbn = {978-1-56592-115-3}, + langid = {english}, + pagetotal = {289} +} +% == BibLateX quality report for ref:nichols1996: +% ? Title looks like it was stored in title-case in Zotero + +@incollection{ref:nicolau1992, + title = {Register Allocation, Renaming and Their Impact on Fine-Grain Parallelism}, + booktitle = {Languages and {{Compilers}} for {{Parallel Computing}}}, + author = {Nicolau, A. and Potasman, R. and Wang, H.}, + editor = {Banerjee, Utpal and Gelernter, David and Nicolau, Alex and Padua, David}, + date = {1992}, + volume = {589}, + pages = {218--235}, + publisher = {{Springer-Verlag}}, + location = {{Berlin/Heidelberg}}, + doi = {10.1007/BFb0038667}, + isbn = {978-3-540-55422-6}, + langid = {english}, + series = {Lecture {{Notes}} in {{Computer Science}}} +} + +@article{ref:owens2008, + title = {{{GPU}} Computing}, + author = {Owens, J.D. and Houston, M. and Luebke, D. and Green, S. and Stone, J.E. and Phillips, J.C.}, + date = {2008-05}, + journaltitle = {Proceedings of the IEEE}, + volume = {96}, + pages = {879--899}, + issn = {0018-9219}, + doi = {10.1109/JPROC.2008.917757}, + number = {5} +} + +@thesis{ref:passerat-palmbach2013, + title = {Contributions to Parallel Stochastic Simulation: {{Application}} of Good Software Engineering Practices to the Distribution of Pseudorandom Streams in Hybrid {{Monte}}-{{Carlo}} Simulations}, + shorttitle = {Contributions to Parallel Stochastic Simulation}, + author = {Passerat-Palmbach, Jonathan}, + date = {2013-10-11}, + institution = {{Universit\'e Blaise Pascal - Clermont-Ferrand II}}, + url = {https://tel.archives-ouvertes.fr/tel-00858735/document}, + urldate = {2018-08-22}, + langid = {english}, + type = {phdthesis} +} + +@inproceedings{ref:patterson1995, + title = {Accurate Static Branch Prediction by Value Range Propagation}, + booktitle = {Proceedings of the {{ACM SIGPLAN}} 1995 Conference on {{Programming}} Language Design and Implementation - {{PLDI}} '95}, + author = {Patterson, Jason R. C.}, + date = {1995}, + pages = {67--78}, + publisher = {{ACM Press}}, + location = {{La Jolla, California, United States}}, + doi = {10.1145/207110.207117}, + eventtitle = {The {{ACM SIGPLAN}} 1995 Conference}, + isbn = {978-0-89791-697-4}, + langid = {english} +} +% == BibLateX quality report for ref:patterson1995: +% ? Unsure about the formatting of the booktitle + +@article{ref:peleg1997, + title = {Intel {{MMX}} for Multimedia {{PCs}}}, + author = {Peleg, Alex and Wilkie, Sam and Weiser, Uri}, + date = {1997-01-01}, + journaltitle = {Communications of the ACM}, + volume = {40}, + pages = {24--38}, + issn = {00010782}, + doi = {10.1145/242857.242865}, + langid = {english}, + number = {1} +} + +@article{ref:perach2018, + title = {{{SiMT}}-{{DSP}}: {{A Massively Multithreaded DSP Architecture}}}, + shorttitle = {{{SiMT}}-{{DSP}}}, + author = {Perach, Ben and Weiss, Shlomo}, + date = {2018-08}, + journaltitle = {IEEE Transactions on Very Large Scale Integration (VLSI) Systems}, + volume = {26}, + pages = {1413--1426}, + issn = {1063-8210, 1557-9999}, + doi = {10.1109/TVLSI.2018.2817564}, + number = {8} +} +% == BibLateX quality report for ref:perach2018: +% 'issn': not a valid ISSN +% ? Title looks like it was stored in title-case in Zotero + +@inproceedings{ref:pereda2018, + title = {Static Loop Parallelization Decision Using Template Metaprogramming}, + booktitle = {2018 {{International Conference}} on {{High Performance Computing}} \& {{Simulation}} ({{HPCS}})}, + author = {Pereda, Alexis and Hill, David R. C. and Mazel, Claude and Bachelet, Bruno}, + date = {2018-07}, + pages = {1015--1021}, + publisher = {{IEEE}}, + location = {{Orleans}}, + doi = {10.1109/HPCS.2018.00159}, + isbn = {978-1-5386-7878-7} +} +% == BibLateX quality report for ref:pereda2018: +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:pereda2020, + title = {Processing Algorithmic Skeletons at Compile-Time}, + booktitle = {21\`eme Congr\`es de La Soci\'et\'e Fran\c{c}aise de {{Recherche Op\'erationnelle}} et d'{{Aide}} \`a La {{D\'ecision}} ({{ROADEF}})}, + author = {Pereda, Alexis and Hill, David R. C. and Mazel, Claude and Yon, Lo\"ic and Bachelet, Bruno}, + date = {2020-02}, + location = {{Montpellier, France}}, + url = {https://hal.archives-ouvertes.fr/hal-02573660} +} +% == BibLateX quality report for ref:pereda2020: +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:philippe2019, + title = {{{PySke}}: Algorithmic Skeletons for {{Python}}}, + shorttitle = {{{PySke}}}, + booktitle = {The 2019 {{International Conference}} on {{High Performance Computing}} \& {{Simulation}} ({{HPCS}})}, + author = {Philippe, Jolan and Loulergue, Fr\'ed\'eric}, + date = {2019-07}, + pages = {40--47}, + location = {{Dublin, Ireland}} +} +% == BibLateX quality report for ref:philippe2019: +% ? Unsure about the formatting of the booktitle + +@incollection{ref:pinto2012, + title = {{{GPU}} Metaprogramming: A Case Study in Biologically-Inspired Machine Vision}, + booktitle = {{{GPU Computing Gems Jade Edition}}}, + author = {Pinto, Nicolas and Cox, David D.}, + date = {2012}, + pages = {457--471}, + publisher = {{Elsevier}}, + doi = {10.1016/B978-0-12-385963-1.00033-2}, + isbn = {978-0-12-385963-1}, + langid = {english} +} +% == BibLateX quality report for ref:pinto2012: +% Missing required field 'editor' + +@book{ref:popper2005, + title = {The Logic of Scientific Discovery}, + author = {Popper, Karl}, + date = {2005-11-04}, + publisher = {{Routledge}}, + eprint = {LWSBAgAAQBAJ}, + eprinttype = {googlebooks}, + isbn = {978-1-134-47002-0}, + langid = {english}, + pagetotal = {545} +} + +@incollection{ref:prins2009a, + title = {A {{GRASP}} \texttimes{} {{Evolutionary Local Search Hybrid}} for the {{Vehicle Routing Problem}}}, + booktitle = {Bio-Inspired {{Algorithms}} for the {{Vehicle Routing Problem}}}, + author = {Prins, Christian}, + date = {2009}, + pages = {35--53}, + publisher = {{Springer}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/978-3-540-85152-3_2}, + isbn = {978-3-540-85152-3}, + langid = {english}, + series = {Studies in {{Computational Intelligence}}} +} +% == BibLateX quality report for ref:prins2009a: +% Missing required field 'editor' +% ? Title looks like it was stored in title-case in Zotero + +@article{ref:protic1996, + title = {Distributed Shared Memory: Concepts and Systems}, + shorttitle = {Distributed Shared Memory}, + author = {Protic, J. and Tomasevic, M. and Milutinovic, V.}, + date = {1996}, + journaltitle = {IEEE Parallel \& Distributed Technology: Systems \& Applications}, + volume = {4}, + pages = {63--71}, + issn = {10636552}, + doi = {10.1109/88.494605}, + number = {2} +} + +@book{ref:quinn2003, + title = {Parallel Programming in {{C}} with {{MPI}} and {{OpenMP}}}, + author = {Quinn, Michael Jay}, + date = {2003}, + volume = {526}, + publisher = {{McGraw-Hill}}, + annotation = {OCLC: 553844668}, + isbn = {978-0-07-123265-4}, + langid = {english}, + pagetotal = {529} +} + +@article{ref:raman2000, + title = {Implementing Streaming {{SIMD}} Extensions on the {{Pentium III}} Processor}, + author = {Raman, S.K. and Pentkovski, V. and Keshava, J.}, + date = {2000-07}, + journaltitle = {IEEE Micro}, + volume = {20}, + pages = {47--57}, + issn = {02721732}, + doi = {10.1109/40.865866}, + number = {4} +} + +@report{ref:ramon-cortes2018, + title = {{{AutoParallel}}: {{A Python}} Module for Automatic Parallelization and Distributed Execution of Affine Loop Nests}, + author = {Ramon-Cortes, Cristian and Amela, Ramon and Ejarque, Jorge and Clauss, Philippe and Badia, Rosa}, + date = {2018}, + pages = {13}, + langid = {english} +} +% == BibLateX quality report for ref:ramon-cortes2018: +% Missing required field 'type' +% Missing required field 'institution' + +@online{ref:ranns2018, + title = {Down with typename!}, + shorttitle = {p0634r2}, + author = {Ranns, Nina and Vandevoorde, Daveed}, + date = {2018-10-02}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r2.html}, + annotation = {ranns2018}, + langid = {english} +} + +@online{ref:revzin2020, + title = {If Consteval}, + shorttitle = {P1938r2}, + author = {Revzin, Barry and Smith, Richard and Sutton, Andrew and Vandevoorde, Daveed}, + date = {2020-10-09}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1938r2.html}, + annotation = {revzin2020}, + langid = {english} +} + +@inproceedings{ref:rieger2019, + title = {Musket: A Domain-Specific Language for High-Level Parallel Programming with Algorithmic Skeletons}, + shorttitle = {Musket}, + booktitle = {Proceedings of the 34th {{ACM}}/{{SIGAPP Symposium}} on {{Applied Computing}}}, + author = {Rieger, Christoph and Wrede, Fabian and Kuchen, Herbert}, + date = {2019-04-08}, + pages = {1534--1543}, + publisher = {{ACM}}, + location = {{Limassol Cyprus}}, + doi = {10.1145/3297280.3297434}, + eventtitle = {{{SAC}} '19: {{The}} 34th {{ACM}}/{{SIGAPP Symposium}} on {{Applied Computing}}}, + isbn = {978-1-4503-5933-7}, + langid = {english} +} + +@report{ref:robinson1949, + title = {On the {{Hamiltonian}} Game (a Traveling Salesman Problem)}, + author = {Robinson, Julia}, + date = {1949}, + institution = {{Rand project air force arlington va.}} +} +% == BibLateX quality report for ref:robinson1949: +% Missing required field 'type' + +@article{ref:roscoe1988, + title = {The Laws of {{OCCAM}} Programming}, + author = {Roscoe, Andrew William and Hoare, Charles Antony Richard}, + date = {1988-09-01}, + journaltitle = {Theoretical Computer Science}, + volume = {60}, + pages = {177--229}, + publisher = {{Elsevier}}, + issn = {0304-3975}, + doi = {10.1016/0304-3975(88)90049-7}, + langid = {english}, + number = {2} +} +% == BibLateX quality report for ref:roscoe1988: +% Unexpected field 'publisher' + +@report{ref:rudd1993, + title = {{{X3H5}} Parallel Extensions for Programming Language {{C}}}, + author = {Rudd, Walter G.}, + date = {1993}, + institution = {{Oregon State University}}, + location = {{Corvallis, OR, USA}}, + langid = {english} +} +% == BibLateX quality report for ref:rudd1993: +% Missing required field 'type' + +@inproceedings{ref:saidani2009, + title = {Algorithmic Skeletons within an {{Embedded Domain Specific Language}} for the {{CELL Processor}}}, + author = {Saidani, Tarik and Falcou, Joel and Tadonki, Claude and Lacassagne, Lionel and Etiemble, Daniel}, + date = {2009-09}, + pages = {67--76}, + publisher = {{IEEE}}, + doi = {10.1109/PACT.2009.21}, + isbn = {978-0-7695-3771-9} +} +% == BibLateX quality report for ref:saidani2009: +% Missing required field 'booktitle' + +@article{ref:schaller1997, + title = {Moore's Law: Past, Present and Future}, + shorttitle = {Moore's Law}, + author = {Schaller, R.R.}, + date = {1997-06}, + journaltitle = {IEEE Spectrum}, + volume = {34}, + pages = {52--59}, + issn = {0018-9235}, + doi = {10.1109/6.591665}, + number = {6} +} + +@article{ref:schmidt1998, + title = {Evaluating Architectures for Multithreaded Object Request Brokers}, + author = {Schmidt, Douglas C.}, + date = {1998-10-01}, + journaltitle = {Communications of the ACM}, + volume = {41}, + pages = {54--60}, + issn = {00010782}, + doi = {10.1145/286238.286248}, + number = {10} +} + +@incollection{ref:sheard2001, + title = {Accomplishments and Research Challenges in Meta-Programming}, + booktitle = {Semantics, {{Applications}}, and {{Implementation}} of {{Program Generation}}}, + author = {Sheard, Tim}, + editor = {Taha, Walid}, + date = {2001}, + volume = {2196}, + pages = {2--44}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/3-540-44806-3_2}, + editorb = {Goos, Gerhard and Hartmanis, Juris and family=Leeuwen, given=Jan, prefix=van, useprefix=true}, + editorbtype = {redactor}, + isbn = {978-3-540-42558-8} +} + +@report{ref:shi1996, + title = {Reevaluating {{Amdahl}}'s Law and {{Gustafson}}'s Law}, + author = {Shi, Yuan}, + date = {1996-10}, + institution = {{Computer Sciences Department, Temple University (MS:38-24)}}, + type = {technical} +} + +@incollection{ref:shirako2008, + title = {Languages and Compilers for Parallel Computing}, + author = {Shirako, Jun and Kasahara, Hironori and Sarkar, Vivek}, + editor = {Adve, Vikram and Garzar\'an, Mar\'ia Jes\'us and Petersen, Paul}, + date = {2008}, + pages = {78--94}, + publisher = {{Springer-Verlag}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/978-3-540-85261-2_6}, + isbn = {978-3-540-85260-5}, + langid = {english} +} +% == BibLateX quality report for ref:shirako2008: +% Missing required field 'booktitle' + +@inproceedings{ref:siek2000, + title = {Concept Checking: Binding Parametric Polymorphism in {{C}}++}, + author = {Siek, Jeremy and Lumsdaine, Andrew}, + date = {2000-10}, + eventtitle = {First Workshop on {{C}}++ {{Template Programming}}} +} +% == BibLateX quality report for ref:siek2000: +% Missing required field 'booktitle' + +@online{ref:siek2005, + title = {Concepts for C++0x}, + shorttitle = {n1758}, + author = {Siek, Jeremy and Gregor, Douglas and Garcia, Ronald and Willcock, Jeremiah and Järvi, Jaakko and Lumsdaine, Andrew}, + date = {2005-01-17}, + url = {http://www.open-std.org/JTC1/SC22/wg21/docs/papers/2005/n1758.pdf}, + annotation = {siek2005}, + langid = {english} +} +% == BibLateX quality report for ref:siek2005: +% ? Title looks like it was stored in title-case in Zotero + +@inproceedings{ref:smith1998, + title = {A Study of Branch Prediction Strategies}, + booktitle = {25 Years of the International Symposia on {{Computer}} Architecture (Selected Papers) - {{ISCA}} '98}, + author = {Smith, James E.}, + date = {1998}, + pages = {202--215}, + publisher = {{ACM Press}}, + location = {{Barcelona, Spain}}, + doi = {10.1145/285930.285980}, + eventtitle = {25 Years of the International Symposia}, + isbn = {978-1-58113-058-4}, + langid = {english} +} + +@online{ref:smith2018, + title = {Immediate Functions}, + shorttitle = {P1073r3}, + author = {Smith, Richard and Sutton, Andrew and Vandevoorde, Daveed}, + date = {2018-11-06}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html}, + annotation = {smith2018}, + langid = {english} +} + +@online{ref:smith2018a, + title = {std::is\_constant\_ evaluated}, + shorttitle = {P0595r2}, + author = {Smith, Richard and Sutton, Andrew and Vandevoorde, Daveed}, + date = {2018-11-09}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0595r2.html}, + annotation = {smith2018}, + langid = {english} +} +% == BibLateX quality report for ref:smith2018a: +% ? Title looks like it was stored in lower-case in Zotero + +@article{ref:stallings1988, + title = {Reduced Instruction Set Computer Architecture}, + author = {Stallings, W.}, + date = {1988-01}, + journaltitle = {Proceedings of the IEEE}, + volume = {76}, + pages = {38--55}, + issn = {00189219}, + doi = {10.1109/5.3287}, + number = {1} +} + +@article{ref:stone2010, + title = {{{OpenCL}}: A Parallel Programming Standard for Heterogeneous Computing Systems}, + shorttitle = {{{OpenCL}}}, + author = {Stone, John E. and Gohara, David and Shi, Guochun}, + date = {2010-05}, + journaltitle = {Computing in science \& engineering}, + shortjournal = {Comput Sci Eng}, + volume = {12}, + pages = {66--73}, + issn = {1521-9615}, + doi = {10.1109/MCSE.2010.69}, + eprint = {21037981}, + eprinttype = {pmid}, + langid = {english}, + number = {3}, + pmcid = {PMC2964860} +} +% == BibLateX quality report for ref:stone2010: +% Unexpected field 'pmcid' + +@inproceedings{ref:striegnitz2000, + title = {Making {{C}}++ Ready for Algorithmic Skeletons}, + author = {Striegnitz, J\"org}, + date = {2000}, + pages = {10} +} +% == BibLateX quality report for ref:striegnitz2000: +% Missing required field 'booktitle' + +@book{ref:stroustrup1997, + title = {The {{C}}++ Programming Language}, + author = {Stroustrup, Bjarne}, + date = {1997}, + edition = {3rd ed}, + publisher = {{Addison-Wesley}}, + location = {{Reading, Mass}}, + isbn = {978-0-201-88954-3}, + langid = {english}, + pagetotal = {910} +} + +@online{ref:stroustrup2017, + title = {Concepts: the future of generic programming}, + shorttitle = {p0557r0}, + author = {Stroustrup, Bjarne}, + date = {2017-01-31}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0557r0.pdf}, + annotation = {stroustrup2017}, + langid = {english} +} + +@online{ref:sutter2019, + title = {Metaclasses: Generative {{C}}++}, + shorttitle = {P0707r4}, + author = {Sutter, Herb}, + date = {2019-06-16}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0707r4.pdf}, + annotation = {sutter2019}, + langid = {english} +} + +@inproceedings{ref:tamai1992, + title = {Software Lifetime and Its Evolution Process over Generations}, + booktitle = {Proceedings {{Conference}} on {{Software Maintenance}} 1992}, + author = {Tamai, T. and Torimitsu, Y.}, + date = {1992}, + pages = {63--69}, + publisher = {{IEEE Comput. Soc. Press}}, + location = {{Orlando, FL, USA}}, + doi = {10.1109/ICSM.1992.242557}, + eventtitle = {Conference on {{Software Maintenance}} 1992}, + isbn = {978-0-8186-2980-8} +} + +@article{ref:tomczak, + title = {{{GPU Ray Marching}} of {{Distance Fields}}}, + author = {Tomczak, Lukasz Jaroslaw}, + pages = {79}, + langid = {english} +} +% == BibLateX quality report for ref:tomczak: +% Exactly one of 'date' / 'year' must be present +% Missing required field 'journaltitle' +% ? Title looks like it was stored in title-case in Zotero + +@thesis{ref:tomczak2012, + title = {{{GPU}} Ray Marching of Distance Fields}, + author = {Tomczak, Lukasz Jaroslaw}, + date = {2012}, + institution = {{Technical University of Denmark}}, + location = {{Asmussens Alle, Building 305, DK-2800 Kgs. Lyngby, Denmark}}, + langid = {english}, + pagetotal = {79} +} +% == BibLateX quality report for ref:tomczak2012: +% Missing required field 'type' + +@thesis{ref:touraille2012, + title = {Application of Model-Driven Engineering and Metaprogramming to {{DEVS}} Modeling \& Simulation}, + author = {Touraille, Luc}, + date = {2012-12}, + institution = {{Universit\'e Blaise Pascal}}, + url = {https://tel.archives-ouvertes.fr/tel-00914327/}, + langid = {english}, + pagetotal = {312} +} +% == BibLateX quality report for ref:touraille2012: +% Missing required field 'type' + +@thesis{ref:toussaint2010, + title = {Algorithmique rapide pour les probl\`emes de tourn\'ees et d'ordonnancement}, + author = {Toussaint, H\'el\`ene}, + date = {2010-01-01}, + institution = {{Clermont-Ferrand 2}}, + url = {http://www.theses.fr/2010CLF22053}, + urldate = {2018-05-28}, + langid = {french} +} +% == BibLateX quality report for ref:toussaint2010: +% Missing required field 'type' + +@article{ref:turing1937, + title = {Computability and {$\lambda$}-Definability}, + author = {Turing, A. M.}, + date = {1937-12}, + journaltitle = {Journal of Symbolic Logic}, + volume = {2}, + pages = {153--163}, + issn = {0022-4812, 1943-5886}, + doi = {10.2307/2268280}, + langid = {english}, + number = {4} +} +% == BibLateX quality report for ref:turing1937: +% 'issn': not a valid ISSN + +@report{ref:unruh1994, + title = {Prime Number Computation}, + author = {Unruh, Erwin}, + date = {1994}, + institution = {{ANSI X3J16-94-0075/ISO WG21-462}} +} +% == BibLateX quality report for ref:unruh1994: +% Missing required field 'type' + +@book{ref:vandevoorde2010, + title = {C++ Templates: The Complete Guide}, + shorttitle = {C++ Templates: The Complete Guide}, + author = {Vandevoorde, Daveed and Josuttis, Nicolai M.}, + date = {2010}, + publisher = {{Addison-Wesley}}, + annotation = {OCLC: 706076856}, + isbn = {978-0-201-73484-3}, + langid = {english}, + pagetotal = {528} +} + +@book{ref:vandevoorde2017, + title = {C++ Templates: The Complete Guide}, + shorttitle = {C++ Templates: The Complete Guide}, + author = {Vandevoorde, Daveed and Josuttis, Nicolai M. and Gregor, Douglas}, + date = {2017}, + publisher = {{Addison-Wesley}}, + annotation = {OCLC: 1013589455}, + isbn = {978-0-321-71412-1}, + langid = {english}, + pagetotal = {788} +} + +@inproceedings{ref:vandierendonck2010, + title = {The Paralax Infrastructure: Automatic Parallelization with a Helping Hand}, + shorttitle = {The Paralax Infrastructure}, + booktitle = {2010 19th {{International Conference}} on {{Parallel Architectures}} and {{Compilation Techniques}} ({{PACT}})}, + author = {Vandierendonck, H. and Rul, S. and Bosschere, K. De}, + date = {2010-09}, + pages = {389--399}, + eventtitle = {2010 19th {{International Conference}} on {{Parallel Architectures}} and {{Compilation Techniques}} ({{PACT}})}, + langid = {english} +} +% == BibLateX quality report for ref:vandierendonck2010: +% ? Unsure about the formatting of the booktitle + +@article{ref:veldhuizen1995, + title = {Expression Templates}, + author = {Veldhuizen, Todd L.}, + date = {1995}, + journaltitle = {C++ Report}, + volume = {7}, + pages = {26--31}, + langid = {english} +} + +@incollection{ref:veldhuizen1996, + title = {Using {{C}}++ Template Metaprograms}, + booktitle = {C++ Gems}, + author = {Veldhuizen, Todd L.}, + editor = {Lippman, Stanley B.}, + date = {1996}, + pages = {459--473}, + publisher = {{SIGS Publications, Inc.}}, + location = {{New York, NY, USA}}, + url = {http://dl.acm.org/citation.cfm?id=260627.260748}, + urldate = {2018-08-27}, + isbn = {978-1-884842-37-5} +} + +@incollection{ref:veldhuizen1998, + title = {Arrays in {{Blitz}}++}, + booktitle = {Lecture {{Notes}} in {{Computer Science}}}, + author = {Veldhuizen, Todd L.}, + date = {1998}, + volume = {1505}, + pages = {223--230}, + publisher = {{Springer-Verlag}}, + langid = {english} +} +% == BibLateX quality report for ref:veldhuizen1998: +% Missing required field 'editor' +% ? Title looks like it was stored in title-case in Zotero + +@inproceedings{ref:veldhuizen1998a, + title = {Active Libraries: Rethinking the Roles of Compilers and Libraries}, + shorttitle = {Active {{Libraries}}}, + booktitle = {Proceedings of the {{SIAM Workshop}} on {{Object Oriented Methods}} for {{Inter}}-Operable {{Scientific}} and {{Engineering Computing}}}, + author = {Veldhuizen, Todd L. and Gannon, Dennis}, + date = {1998}, + pages = {286--295}, + publisher = {{SIAM Press}}, + langid = {english} +} + +@incollection{ref:veldhuizen2000, + title = {Blitz++: The Library That Thinks It Is a Compiler}, + shorttitle = {Blitz++}, + booktitle = {Advances in {{Software Tools}} for {{Scientific Computing}}}, + author = {Veldhuizen, Todd L.}, + date = {2000}, + volume = {10}, + pages = {57--87}, + publisher = {{Springer Berlin Heidelberg}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/978-3-642-57172-5_2}, + isbn = {978-3-540-66557-1} +} +% == BibLateX quality report for ref:veldhuizen2000: +% Missing required field 'editor' + +@book{ref:veldhuizen2000a, + title = {Five Compilation Models for {{C}}++ Templates ({{Extended Abstract}})}, + author = {Veldhuizen, Todd L.}, + date = {2000}, + langid = {english} +} + +@report{ref:veldhuizen2003, + title = {C++ Templates Are {{Turing}} Complete}, + author = {Veldhuizen, Todd L.}, + date = {2003}, + institution = {{Indiana University Computer Science}}, + langid = {english} +} +% == BibLateX quality report for ref:veldhuizen2003: +% Missing required field 'type' + +@article{ref:videau2018, + title = {{{BOAST}}: A Metaprogramming Framework to Produce Portable and Efficient Computing Kernels for {{HPC}} Applications}, + shorttitle = {{{BOAST}}}, + author = {Videau, Brice and Pouget, Kevin and Genovese, Luigi and Deutsch, Thierry and Komatitsch, Dimitri and Desprez, Fr\'ed\'eric and M\'ehaut, Jean-Fran\c{c}ois}, + date = {2018-01}, + journaltitle = {The International Journal of High Performance Computing Applications}, + volume = {32}, + pages = {28--44}, + issn = {1094-3420, 1741-2846}, + doi = {10.1177/1094342017718068}, + langid = {english}, + number = {1} +} +% == BibLateX quality report for ref:videau2018: +% 'issn': not a valid ISSN + +@online{ref:vollmann2016, + title = {Why Joining\_thread from {{P0206}} Is a Bad Idea}, + shorttitle = {P0379r0}, + author = {Vollmann, Detlef}, + date = {2016-05-27}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0379r0.html}, + annotation = {vollmann2016}, + langid = {english} +} + +@inproceedings{ref:voufo2011, + title = {{{ConceptClang}}: An Implementation of {{C}}++ Concepts in {{Clang}}}, + shorttitle = {{{ConceptClang}}}, + booktitle = {Proceedings of the Seventh {{ACM SIGPLAN}} Workshop on {{Generic}} Programming - {{WGP}} '11}, + author = {Voufo, Larisse and Zalewski, Marcin and Lumsdaine, Andrew}, + date = {2011}, + pages = {71}, + publisher = {{ACM Press}}, + location = {{Tokyo, Japan}}, + doi = {10.1145/2036918.2036929}, + eventtitle = {The Seventh {{ACM SIGPLAN}} Workshop}, + isbn = {978-1-4503-0861-8}, + langid = {english} +} +% == BibLateX quality report for ref:voufo2011: +% ? Unsure about the formatting of the booktitle + +@online{ref:voutilainen2016, + title = {A Joining Thread}, + author = {Voutilainen, Ville}, + date = {2016-03-09}, + url = {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0206r1.html}, + annotation = {voutilainen2016}, + langid = {english} +} + +@article{ref:walker1996, + title = {{{MPI}}: A Standard Message Passing Interface}, + author = {Walker, David W and Dongarra, Jack J}, + date = {1996}, + journaltitle = {Supercomputer}, + pages = {15}, + langid = {english} +} + +@inproceedings{ref:willhalm2008, + title = {Putting {{Intel}}\textregistered{} {{Threading Building Blocks}} to Work}, + booktitle = {Proceedings of the 1st {{International Workshop}} on {{Multicore Software Engineering}}}, + author = {Willhalm, Thomas and Popovici, Nicolae}, + date = {2008}, + pages = {3--4}, + publisher = {{ACM}}, + location = {{New York, NY, USA}}, + doi = {10.1145/1370082.1370085}, + isbn = {978-1-60558-031-9}, + langid = {english}, + series = {{{IWMSE}} '08} +} + +@inproceedings{ref:wolf2007, + title = {Evolutionary {{Local Search}} for the {{Super}}-{{Peer Selection Problem}} and the p-{{Hub Median Problem}}}, + booktitle = {Hybrid {{Metaheuristics}}}, + author = {Wolf, Steffen and Merz, Peter}, + editor = {Bartz-Beielstein, Thomas and Blesa Aguilera, Mar\'ia Jos\'e and Blum, Christian and Naujoks, Boris and Roli, Andrea and Rudolph, G\"unter and Sampels, Michael}, + date = {2007}, + pages = {1--15}, + publisher = {{Springer}}, + location = {{Berlin, Heidelberg}}, + doi = {10.1007/978-3-540-75514-2_1}, + isbn = {978-3-540-75514-2}, + langid = {english}, + series = {Lecture {{Notes}} in {{Computer Science}}} +} +% == BibLateX quality report for ref:wolf2007: +% ? Unsure about the formatting of the booktitle +% ? Title looks like it was stored in title-case in Zotero + +@article{ref:wrede2020, + title = {Generation of High-Performance Code Based on a Domain-Specific Language for Algorithmic Skeletons}, + author = {Wrede, Fabian and Rieger, Christoph and Kuchen, Herbert}, + date = {2020-07}, + journaltitle = {The Journal of Supercomputing}, + volume = {76}, + pages = {5098--5116}, + doi = {10.1007/s11227-019-02825-6}, + langid = {english}, + number = {7} +} + +@inproceedings{ref:zhang2009, + title = {Implementing and Testing Producer-Consumer Problem Using Aspect-Oriented Programming}, + booktitle = {2009 {{Fifth International Conference}} on {{Information Assurance}} and {{Security}}}, + author = {Zhang, Yang and Zhang, Jingjun and Zhang, Dongwen}, + date = {2009}, + pages = {749--752}, + publisher = {{IEEE}}, + location = {{Xi'An China}}, + doi = {10.1109/IAS.2009.41}, + eventtitle = {2009 {{Fifth International Conference}} on {{Information Assurance}} and {{Security}}}, + isbn = {978-0-7695-3744-3} +} +% == BibLateX quality report for ref:zhang2009: +% ? Unsure about the formatting of the booktitle + +@inproceedings{ref:zhang2018, + title = {Vectorized Parallel Sparse Matrix-Vector Multiplication in {{PETSc}} Using {{AVX}}-512}, + booktitle = {Proceedings of the 47th {{International Conference}} on {{Parallel Processing}}}, + author = {Zhang, Hong and Mills, Richard T. and Rupp, Karl and Smith, Barry F.}, + date = {2018-08-13}, + pages = {1--10}, + publisher = {{ACM}}, + location = {{Eugene OR USA}}, + doi = {10.1145/3225058.3225100}, + eventtitle = {{{ICPP}} 2018: 47th {{International Conference}} on {{Parallel Processing}}}, + isbn = {978-1-4503-6510-9}, + langid = {english} +} + +@article{ref:zhu1993, + title = {A General Descent Framework for Monotone Variational Inequalities}, + author = {Zhu, Daoli L. and Marcotte, Patrice}, + date = {1993}, + journaltitle = {Journal of optimisation theory and applications}, + entrysubtype = {newspaper} +} + +@article{ref:zima1988, + title = {{{SUPERB}}: A Tool for Semi-Automatic {{MIMD}}/{{SIMD}} Parallelization}, + shorttitle = {{{SUPERB}}}, + author = {Zima, Hans P and Bast, Heinz-J and Gerndt, Michael}, + date = {1988-01}, + journaltitle = {Parallel Computing}, + shortjournal = {Parallel Computing}, + volume = {6}, + pages = {1--18}, + issn = {0167-8191}, + doi = {10.1016/0167-8191(88)90002-6}, + langid = {english}, + number = {1} +} + + +% Required packages: +% * textcomp + diff --git a/src/tikz/alsk.tex b/src/tikz/alsk.tex new file mode 100644 index 0000000..1fad03b --- /dev/null +++ b/src/tikz/alsk.tex @@ -0,0 +1,92 @@ +%{{{ +\tikzset{alsk/label/.style={}} +%}}} + +%{{{ pack for schemes " +\tikzset{alsk/scheme/split/.style={ + common/drawfill=colStruct, + regular polygon,regular polygon sides=3, + minimum width=10mm, + inner sep=0mm +}} + +\tikzset{alsk/scheme/join/.style={ + alsk/scheme/split, + shape border rotate=180 +}} + +\tikzset{alsk/scheme/loop/.style={ + common/drawfill=colStruct, + regular polygon,regular polygon sides=4, + minimum width=8mm, + inner sep=0mm, + shape border rotate=45 +}} + +\tikzset{alsk/scheme/frame/.style={ + draw=#1, + rectangle,dotted,thick, + rounded corners=1mm, + inner sep=1mm +}} + +\tikzset{alsk/scheme/task/.style={ + common/drawfill=colMuscle, + circle, + minimum width=8mm, + inner sep=0mm +}} + +\tikzset{alsk/scheme/link/.style={ + ->, + rounded corners +}} +%}}} + +%{{{ pack for trees " +\tikzset{alsk/tree/muscle/.style={ + common/drawfill=colMuscle, + rectangle,rounded corners=.7mm, + minimum width=12mm,minimum height=6mm +}} + +\tikzset{alsk/tree/struct/.style={ + common/drawfill=colStruct, + rectangle,rounded corners=.7mm, + minimum width=16mm,minimum height=6mm +}} + +\tikzset{alsk/treestyle/.style={ + edge from parent path={(\tikzparentnode) -- (\tikzchildnode.north)}, + level distance=15mm,sibling distance=1mm, + branch/.style=alsk/tree/struct, + leaf/.style=alsk/tree/muscle, + every internal node/.style=branch, + every leaf node/.style=leaf, +}} +%}}} + +%{{{ pack for links " +\tikzset{alsk/links/muscle/.style={ + common/drawfill=colMuscle, + rectangle,rounded corners=.7mm, + minimum width=10mm,minimum height=5mm, +}} + +\tikzset{alsk/links/sig/.style={ + common/drawfill=#1, + signal,signal from=west,signal to=east, + minimum width=2mm, +}} + +\tikzset{alsk/links/link/.style={ + -,rounded corners=.8mm +}} + +\tikzset{alsk/links/fit/.style={ + draw, + dashed,rounded corners=2mm, + fit=#1, + fit margins={left=-1mm,bottom=1.5mm,right=2mm,top=1.5mm}, +}} +%}}} diff --git a/src/tikz/ast.tex b/src/tikz/ast.tex new file mode 100644 index 0000000..dcb78a5 --- /dev/null +++ b/src/tikz/ast.tex @@ -0,0 +1,11 @@ +\tikzset{ast/tree/node/.style={ + common/drawfill=black, + rectangle,minimum size=6mm,rounded corners=1mm, + align=center +}} + +\tikzset{ast/treestyle/.style={ + edge from parent path={(\tikzparentnode) -- (\tikzchildnode.north)}, + level distance=15mm,sibling distance=3mm, + every tree node/.style=ast/tree/node, +}} diff --git a/src/tikz/common.tex b/src/tikz/common.tex new file mode 100644 index 0000000..27907e8 --- /dev/null +++ b/src/tikz/common.tex @@ -0,0 +1,84 @@ +\tikzset{common/drawfillf/.style n args={2}{ + draw=#1,fill=#1!#2 +}} + +\tikzset{common/drawfill/.style={ + common/drawfillf={#1}{5} +}} + +\tikzset{common/arrow/.style={ + rounded corners +}} + +\tikzset{common/overlay/.style={overlay}} + +\tikzset{fit margins/.style={ + /tikz/afit/.cd,#1, + /tikz/.cd, + inner xsep=\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right}, + inner ysep=\pgfkeysvalueof{/tikz/afit/top}+\pgfkeysvalueof{/tikz/afit/bottom}, + xshift=-\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right}, + yshift=-\pgfkeysvalueof{/tikz/afit/bottom}+\pgfkeysvalueof{/tikz/afit/top} +}, afit/.cd,left/.initial=2pt,right/.initial=2pt,bottom/.initial=2pt,top/.initial=2pt +} + +%{{{ Beamer " +\tikzset{alt/.code args={<#1>#2#3}{% + \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} +}} + +\tikzset{ + invisible/.style={opacity=0,text opacity=0}, + visible on/.style={alt={#1{}{invisible}}} +} + +\tikzset{only on/.style args={<#1>#2}{alt={<#1>{#2}{}}}} +%}}} + +%{{{ misc " +\tikzset{pics/gear/.style n args={3}{ + code={ + \def\modu{#1} + \def\Zb{#2} + \def\AngleA{#3} + + \pgfmathsetmacro{\Rpr}{\Zb*\modu/2} + \pgfmathsetmacro{\Rb}{\Rpr*cos(\AngleA)} + \pgfmathsetmacro{\Rt}{\Rpr+\modu} + \pgfmathsetmacro{\Rp}{\Rpr-1.25*\modu} + \pgfmathsetmacro{\AngleT}{pi/180*acos(\Rb/\Rt)} + \pgfmathsetmacro{\AnglePr}{pi/180*acos(\Rb/\Rpr)} + \pgfmathsetmacro{\demiAngle}{180/\Zb} + \pgfmathsetmacro{\Angledecal}{(\demiAngle-2*\AnglePr)/2} + + \path[pic actions] foreach \zz in{1,...,\Zb}{ + \ifnum\zz=1 + (\zz/\Zb*360-\Angledecal:\Rp) + \else + -- (\zz/\Zb*360-\Angledecal:\Rp) + \fi + to[bend right=\demiAngle] + (\zz/\Zb*360+\Angledecal:\Rp) + -- + plot[domain=-0:\AngleT,smooth,variable=\t] + ({{180/pi*(-\t+tan(180/pi*\t)) +\zz/\Zb*360+\Angledecal}:\Rb/cos(180/pi*\t)}) + % + to[bend right=\demiAngle] + ({{180/pi*(\AngleT+tan(180/pi*-\AngleT)) +(\zz+1)/\Zb*360-\Angledecal}: + \Rb/cos(180/pi*-\AngleT)}) + -- + plot[domain=-\AngleT:-0,smooth,variable=\t] + ({{180/pi*(-\t+tan(180/pi*\t)) +(\zz+1)/\Zb*360-\Angledecal}:\Rb/cos(180/pi*\t)}) + } -- cycle; + } +}} + +\tikzset{common/rhl/.style={ + common/drawfillf={#1}{50}, + rectangle,rounded corners, + minimum height=3ex, + inner sep=0pt, + yshift=.5ex, + opacity=.25 +}} +%}}} diff --git a/src/tikz/et.tex b/src/tikz/et.tex new file mode 100644 index 0000000..272f366 --- /dev/null +++ b/src/tikz/et.tex @@ -0,0 +1,18 @@ +\tikzset{et/tree/node/.style={ + common/drawfill=black, + circle,minimum size=9mm, + inner sep=.5mm, + font=\strut +}} + +\tikzset{et/treestyle/.style={ + edge from parent path={(\tikzparentnode) -- (\tikzchildnode.north)}, + level distance=15mm,sibling distance=1mm, + every tree node/.style=et/tree/node, +}} + +\tikzset{et/frame/.style={ + draw,dashed, + rectangle,rounded corners=3mm, + fit=#1 +}} diff --git a/src/tikz/exec.tex b/src/tikz/exec.tex new file mode 100644 index 0000000..cf93fe8 --- /dev/null +++ b/src/tikz/exec.tex @@ -0,0 +1,21 @@ +\tikzset{exec/fifonode/.style={ + draw,fill=black!3,signal,signal from=west,signal to=east, + minimum width=12mm,minimum height=6mm,line width=.1mm +}} + +\tikzset{exec/thread/.style={ + draw=#1,fill=#1!10, + rectangle,rounded corners=2mm, + minimum width=6mm,minimum height=6mm +}} + +\tikzset{exec/pool/.style={ + draw,fill=black!2, + fit=#1, + decorate,decoration={snake,amplitude=1pt} +}} + +\tikzset{exec/fit/.style={ + draw,rounded corners,dashed, + fit=#1 +}} diff --git a/src/tikz/mp.tex b/src/tikz/mp.tex new file mode 100644 index 0000000..bfe8761 --- /dev/null +++ b/src/tikz/mp.tex @@ -0,0 +1,63 @@ +%{{{ Program " +\tikzset{pics/program/.style={ + code={ + \def\lscale{#1} + + \def\w{1.5} + \pgfmathsetmacro{\h}{\w*sqrt(2)}% A-page ratio + \def\mh{.1} + \def\mv{.08} + \def\nl{10} + \def\cl{.15} + + \coordinate (corner left) at (-\w/2,\h/2-\cl); + + \draw[rounded corners=.4,fill=black!5] (corner left) -- ++(\cl,0) -- ++(0,\cl) + -- (corner left) -- ++(0,\cl-\h) -- ++(\w,0) -- ++(0,\h) -- ++(\cl-\w,0); + \foreach \i in {1,...,\nl} { + \draw[decorate,decoration={random steps,segment length=1,amplitude=.3}] + (\mh-\w/2,{-(\h-2*\mv)*\i/\nl+\mv+\h/2-\cl}) -- +(\w-2*\mh,0); + } + } + }, + pics/program/.default=1 +} +%}}} + +%{{{ Binary " +\tikzset{pics/binary/.style={ + code={ + \def\lscale{#1} + + \def\w{1.5} + \pgfmathsetmacro{\h}{\w*sqrt(2)}% A-page ratio + \def\mh{.1} + \def\mv{.08} + \def\cl{.15} + + \coordinate (corner left) at (-\w/2,\h/2-\cl); + + \def\gteethA{23} + \def\gteethB{11} + \def\gteethC{17} + \def\gmod{.04} + \def\gangle{15} + \def\grotAB{-60} + \def\grotBC{-115} + \pgfmathsetmacro{\gdistAB}{(\gteethA+\gteethB)*\gmod/2} + \pgfmathsetmacro{\gdistBC}{(\gteethB+\gteethC)*\gmod/2} + + \coordinate (gear0) at (-.05,.475); + \coordinate (gear1) at ($(gear0)+(\grotAB:\gdistAB)$); + \coordinate (gear2) at ($(gear1)+(\grotBC:\gdistBC)$); + + \draw[rounded corners=.4,fill=black!5] (corner left) -- ++(\cl,0) -- ++(0,\cl) + -- (corner left) -- ++(0,\cl-\h) -- ++(\w,0) -- ++(0,\h) -- ++(\cl-\w,0); + \pic[draw,fill=red!20!black!20,rotate=\grotAB+90/\gteethA] at (gear0) {gear={\gmod*\lscale}{\gteethA}{\gangle}}; + \pic[draw,fill=green!20!black!20,rotate=\grotAB-90/\gteethB] at (gear1) {gear={\gmod*\lscale}{\gteethB}{\gangle}}; + \pic[draw,fill=blue!20!black!20,rotate=3] at (gear2) {gear={\gmod*\lscale}{\gteethC}{\gangle}}; + } + }, + pics/binary/.default=1 +} +%}}} diff --git a/src/tikz/orchestration.tex b/src/tikz/orchestration.tex new file mode 100644 index 0000000..2ca368b --- /dev/null +++ b/src/tikz/orchestration.tex @@ -0,0 +1,15 @@ +\tikzset{orch/task/.style={ + draw=#1,fill=#1!5, + circle, minimum width=12mm +}} + +\tikzset{orch/subtask/.style={ + draw=#1,fill=#1!15, + circle, minimum width=4mm +}} + +\tikzset{orch/taskspan/.style={ + draw=#1,fill=#1!5, + rectangle,rounded corners=1mm, + minimum width=28mm,minimum height=8mm +}} diff --git a/src/tikz/parallel.tex b/src/tikz/parallel.tex new file mode 100644 index 0000000..cd2bc0e --- /dev/null +++ b/src/tikz/parallel.tex @@ -0,0 +1,27 @@ +\tikzset{parallel/block/.style={ + thick, + minimum width=8mm,minimum height=8mm +}} + +\tikzset{parallel/task/.style={ + common/drawfill=black, + parallel/block, + rectangle,rounded corners, +}} + +\tikzset{parallel/arrow/.style={ + thick,->,>=stealth, + rounded corners +}} + +\tikzset{parallel/point/.style={ + common/drawfill=black, + circle,minimum width=2mm +}} + +\tikzset{parallel/region/.style={ + draw=black!50,fill=green!4, + rectangle,rounded corners=2mm, + dashed, + fit=#1 +}} diff --git a/src/tikz/repeat.tex b/src/tikz/repeat.tex new file mode 100644 index 0000000..e43d680 --- /dev/null +++ b/src/tikz/repeat.tex @@ -0,0 +1,13 @@ +\tikzset{prng/element/.style={ + common/drawfill=black, + signal,signal from=east,signal to=west, + minimum width=12mm +}} + +\tikzset{prng/below/.style={ + node distance=1cm,below=of #1 +}} + +\tikzset{prng/drawfill/.style={ + common/drawfillf={#1}{20} +}} diff --git a/src/tikz/tsp.tex b/src/tikz/tsp.tex new file mode 100644 index 0000000..fa2d9e2 --- /dev/null +++ b/src/tikz/tsp.tex @@ -0,0 +1,30 @@ +\newcommand{\tspnodes}{ + \coordinate (p0) at (0, 0); + \coordinate (p1) at (1, 1); + \coordinate (p2) at (2, -.5); + \coordinate (p3) at (3.5, 1.5); + \coordinate (p4) at (2.5, 2); + \coordinate (p5) at (3, 2.5); + \coordinate (p6) at (2, 3); + \coordinate (p7) at (.5, 2.75); + \coordinate (p8) at (0.75, 2.25); + \coordinate (p9) at (-.5, 1.25); + + \def\n{10} + \pgfmathtruncatemacro{\last}{\n-1} + \pgfmathtruncatemacro{\penult}{\last-1} +} + +\tikzset{tsp/node/.style={ + fill=black, + circle, + minimum size=5pt, + inner sep=0pt +}} + +\tikzset{tsp/edge/.style={ + thick +}} + +\tikzset{tsp/localbest/.style={common/drawfill=yellow!70!black}} +\tikzset{tsp/best/.style={common/drawfill=green!70!black}} diff --git a/src/usr/alg.tex b/src/usr/alg.tex new file mode 100644 index 0000000..fb5727c --- /dev/null +++ b/src/usr/alg.tex @@ -0,0 +1,28 @@ +% \renewcommand*\Call[2]{\textproc{#1}(#2)} + +\renewcommand{\listalgorithmname}{Liste des algorithmes} +\floatname{algorithm}{Algorithme} + +\algrenewcommand\algorithmicreturn{\textbf{retourner}} +\algrenewcommand\algorithmicprocedure{\textbf{procédure}} +\algrenewcommand\algorithmicfunction{\textbf{fonction}} +\algrenewcommand\algorithmicrequire{\textbf{Entrée :}} +\algrenewcommand\algorithmicensure{\textbf{Sortie :}} +\algrenewcommand\algorithmicend{\textbf{fin}} +\algrenewcommand\algorithmicif{\textbf{si}} +\algrenewcommand\algorithmicthen{\textbf{alors}} +\algrenewcommand\algorithmicelse{\textbf{sinon}} +\algrenewcommand\algorithmicfor{\textbf{pour}} +\algrenewcommand\algorithmicforall{\textbf{pour tout}} +\algrenewcommand\algorithmicdo{\textbf{faire}} +\algrenewcommand\algorithmicwhile{\textbf{tant que}} +\algrenewcommand\algorithmicrepeat{\textbf{répéter}} +\algrenewcommand\algorithmicuntil{\textbf{jusqu'à ce que}} + +% \renewcommand\Not{\textbf{non}\ } +\renewcommand\And{\textbf{et}\ } +% \renewcommand\Or{\textbf{ou}\ } + +\newcommand{\algorithmicelsif}{\algorithmicelse\ \algorithmicif} +\newcommand{\algorithmicendif}{\algorithmicend\ \algorithmicif} +\newcommand{\algorithmicendfor}{\algorithmicend\ \algorithmicfor} diff --git a/src/usr/beamer.tex b/src/usr/beamer.tex new file mode 100644 index 0000000..37ea2f7 --- /dev/null +++ b/src/usr/beamer.tex @@ -0,0 +1,101 @@ +\usepackage{pgfpages} + +\usetheme{Darmstadt}% or Frankfurt to remove subsection +\usecolortheme{seahorse} +\usefonttheme{default} + +\setbeamertemplate{navigation symbols}{} +\setbeamertemplate{footline}[title] + +\makeatletter +\def\jury{% +Alexandre \textsc{Guitton} & Professeur des universités & Université Clermont Auvergne & Président \\ +Joël \textsc{Falcou} & Maître de conférences HDR & Université Paris-Saclay & Rapporteur \\ +Françoise \textsc{Baude} & Professeur des universités & Université Côte d'Azur & Rapporteuse \\ +Éric \textsc{Innocenti} & Maître de conférences & Université de Corse & Examinateur \\ +Bruno \textsc{Bachelet} & Maître de conférences HDR & Université Clermont Auvergne & Directeur de thèse\\ +David \textsc{Hill} & Professeur des universités & Université Clermont Auvergne & Co-directeur de thèse\\ +} +\def\juryinvited{% +Claude \textsc{Mazel} & Maître de conférences & Université Clermont Auvergne & Invité \\ +Jian-Jin \textsc{Li} & Maître de conférences & Université Clermont Auvergne & Invitée \\ +} + +\setbeamertemplate{title page}{ + \begin{centering} + \begin{beamercolorbox}[rounded=true,sep=8pt,center]{title} + \usebeamerfont{title}\inserttitle\par% + \ifx\insertsubtitle\@empty% + \else% + \vskip0.25em% + { + \usebeamerfont{subtitle} + \vspace{.5em} + \usebeamercolor[fg]{subtitle} + \insertsubtitle + \par + }% + \fi% + \end{beamercolorbox}% + \vskip1em\par + \begin{beamercolorbox}[sep=6pt,center]{author} + \usebeamerfont{author}\insertauthor + \end{beamercolorbox} + \begin{beamercolorbox}[sep=4pt,center]{author} + \tiny Thèse encadrée par Bruno Bachelet, David Hill, Claude Mazel + \end{beamercolorbox} + \begin{beamercolorbox}[sep=6pt,center]{institute} + \usebeamerfont{institute}\insertinstitute + \end{beamercolorbox} + \end{centering} + \begin{centering} + \begin{beamercolorbox}[sep=6pt,center]{date} + \usebeamerfont{date}\insertdate + \end{beamercolorbox}%\vskip0.5em + \begin{columns} + \begin{column}{.9\paperwidth} + \begin{beamercolorbox}[sep=6pt,center]{jury} + Membres du jury + \vskip.2em\par + \tiny + \def\arraystretch{1.2} + \begin{tabular}{l >{\it}l l l} + \jury + % \juryinvited + \end{tabular} + \end{beamercolorbox} + \end{column} + \end{columns} + \end{centering} +} +\makeatother + +\setbeamertemplate{footline}{ + \leavevmode + \hbox{% + \begin{beamercolorbox}[wd=.20\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot} + \usebeamerfont{author in head/foot} + \insertshortauthor + \end{beamercolorbox}% + \begin{beamercolorbox}[wd=.50\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot} + \usebeamerfont{title in head/foot} + \insertsubtitle + \end{beamercolorbox}% + \begin{beamercolorbox}[wd=.20\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot} + \usebeamerfont{date in head/foot} + \insertshortdate{}\hspace*{2em} + \end{beamercolorbox}% + \begin{beamercolorbox}[wd=.10\paperwidth,ht=2.25ex,dp=1ex,right]{title in head/foot} + \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} + \end{beamercolorbox}% + } + \vskip0pt +} + +\newcommand\inserttoc[4]{ + % \section*{} + % \subsection*{#1} + \begin{frame}[label=current]{#2} + \tableofcontents[#3] + \end{frame} +} diff --git a/src/usr/bibstyle.tex b/src/usr/bibstyle.tex new file mode 100644 index 0000000..29246f2 --- /dev/null +++ b/src/usr/bibstyle.tex @@ -0,0 +1,58 @@ +% citations links include author +\DeclareFieldFormat{citehyperref}{% + \DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links + \bibhyperref{#1}} + +\DeclareFieldFormat{textcitehyperref}{% + \DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links + \bibhyperref{% + #1% + \ifbool{cbx:parens} + {\bibcloseparen\global\boolfalse{cbx:parens}} + {}}} + +\savebibmacro{cite} +\savebibmacro{textcite} + +\renewbibmacro*{cite}{% + \printtext[citehyperref]{% + \restorebibmacro{cite}% + \usebibmacro{cite}}} + +\renewbibmacro*{textcite}{% + \ifboolexpr{ + ( not test {\iffieldundef{prenote}} and + test {\ifnumequal{\value{citecount}}{1}} ) + or + ( not test {\iffieldundef{postnote}} and + test {\ifnumequal{\value{citecount}}{\value{citetotal}}} ) + } + {\DeclareFieldAlias{textcitehyperref}{noformat}} + {}% + \printtext[textcitehyperref]{% + \restorebibmacro{textcite}% + \usebibmacro{textcite}}} + +% replace cite by autocite +% \renewbibmacro*{cite}{\usebibmacro{autocite}} + +% disable small caps for author names +\renewcommand*{\mkbibnamefamily}[1]{#1} +\renewcommand*{\mkbibnameprefix}[1]{#1} + +% replace parenthesis by angle brackets +\makeatletter + +\newrobustcmd*{\parentexttrack}[1]{% + \begingroup + \blx@blxinit + \blx@setsfcodes + \blx@bibopenparen#1\blx@bibcloseparen + \endgroup} + +\AtEveryCite{% + \let\parentext=\parentexttrack% + \let\bibopenparen=\bibopenbracket% + \let\bibcloseparen=\bibclosebracket} + +\makeatother diff --git a/src/usr/colors.tex b/src/usr/colors.tex new file mode 100644 index 0000000..4ab56e5 --- /dev/null +++ b/src/usr/colors.tex @@ -0,0 +1,21 @@ +\colorlet{colStruct}{cyan!50!blue} +\colorlet{colMuscle}{yellow!50!red} +\definecolor{colLinkIn}{RGB}{127,66,255} +\definecolor{colLinkOut}{RGB}{127,189,0} +\colorlet{colLinkCtx}{colLinkIn!50!red!80!black} + +\definecolor{colFSr}{RGB}{0,0,0} +\definecolor{colFSp0}{RGB}{0,0,0} +\definecolor{colSr}{RGB}{0,0,0} +\definecolor{colSp0}{RGB}{0,0,0} +\definecolor{colCHr}{RGB}{0,0,0} +\definecolor{colCHp0}{RGB}{0,0,0} +\definecolor{colCHp1}{RGB}{0,0,0} +\definecolor{colLSr}{RGB}{0,0,0} +\definecolor{colLSp0}{RGB}{0,0,0} +\definecolor{colLSp1}{RGB}{0,0,0} +\definecolor{colSelr}{RGB}{0,0,0} +\definecolor{colSelp}{RGB}{0,0,0} + +\colorlet{colThread0}{red!60!green} +\colorlet{colThread1}{blue!80!green} diff --git a/src/usr/listing.tex b/src/usr/listing.tex new file mode 100644 index 0000000..e441873 --- /dev/null +++ b/src/usr/listing.tex @@ -0,0 +1,84 @@ +%{{{ current font size " +\makeatletter +\newcommand{\currentfontsize}{\fontsize{\f@size}{\f@baselineskip}\selectfont} +\makeatother +%}}} + +%{{{ configuration " +\setminted{fontsize=\small,tabsize=2,autogobble,breaklines} +\setmintedinline{fontsize=\currentfontsize} + +\newmintinline{cpp}{breaklines,breakafter=_:<>} +\newmintinline{c}{breaklines,breakafter=_:<>} +\newmintinline{asm}{} +\newmintinline{haskell}{} +\newmintinline{lisp}{} +%}}} + +%{{{ customize appearance " +% \BeforeBeginEnvironment{minted}{\begin{tcolorbox}[boxsep=-2mm]} +% \AfterEndEnvironment{minted}{\end{tcolorbox}} +%}}} + +%{{{ tcolorbox " +\newtcblisting{cppcode}{ + listing engine=minted, + minted language=cpp, + minted options={ + fontsize=\small, + tabsize=2, + autogobble, + breaklines, + escapeinside=|| + }, + listing only, + boxsep=-2mm +} + +\newtcblisting{asmcode}{ + listing engine=minted, + minted language=asm, + minted options={ + fontsize=\small, + tabsize=2, + autogobble, + breaklines, + escapeinside=|| + }, + listing only, + enhanced, + boxsep=-2mm +} + +\newtcblisting{cppcode*}[1]{ + listing engine=minted, + minted language=cpp, + minted options={ + fontsize=\small, + tabsize=2, + autogobble, + breaklines, + escapeinside=|| + }, + listing only, + boxsep=-2mm, + enhanced, + remember as={#1} +} + +\newtcblisting{minicppcode}{ + listing engine=minted, + minted language=cpp, + minted options={ + fontsize={\fontsize{4}{5}\selectfont}, + tabsize=2, + autogobble, + breaklines, + escapeinside=|| + }, + listing only, + boxsep=-2mm +} + +\newtcbox{hlbox}[1]{on line,colback=#1,size=small,frame empty,left=0pt,right=0pt} +%}}} diff --git a/src/usr/math.tex b/src/usr/math.tex new file mode 100644 index 0000000..077e7a9 --- /dev/null +++ b/src/usr/math.tex @@ -0,0 +1,18 @@ +\newtheoremstyle{thmstyle} +{}% measure of space to leave above the theorem +{}% measure of space to leave below the theorem +{}% name of font to use in the body of the theorem +{}% measure of space to indent +{}% name of head font +{~:}% punctuation between head and body +{ }% space after theorem head +{\thmname{#1}\thmnumber{ #2}\thmnote{ #3}} + +\theoremstyle{thmstyle} + +\newtheorem*{thm}{Théorème} +\newtheorem*{thmdef}{Définition} +\newtheorem*{thmlemme}{Lemme} +\newtheorem*{thmproof}{Démonstration} +\newtheorem*{thmrq}{Remarque} +\newtheorem*{thmex}{Exemple} diff --git a/src/usr/ocg.tex b/src/usr/ocg.tex new file mode 100644 index 0000000..a9670fb --- /dev/null +++ b/src/usr/ocg.tex @@ -0,0 +1,246 @@ +%{{{ +\newcommand{\ocgradio}[4]{ + \makebox[0pt][l]{\showocg[onmouseall]{{#2},,,{#2}}{#3}}% + \begin{ocg}[radiobtngrp=#1]{#2}{#2}{#4}\showocg{}{\underline{#3}}\end{ocg} +} + +\newcommand{\ocgcase}[5]{\makebox[0pt][c]{\begin{ocg}[radiobtngrp=#1]{#2}{#3}{#4}#5\end{ocg}}} +\newcommand{\ocmdcase}[2]{\makebox[0pt][c]{\begin{ocmd}{\And{#1}}#2\end{ocmd}}} +%}}} +%{{{ TikZ " +%{{{ +\newcommand{\ocgtikzrbtn}[6]{ + \node[#4,show ocg={#2}](#5){#6}; + \begin{ocg}[radiobtngrp=#1]{#2}{#2}{#3} + \node[#4,thick](#5){\textbf{#6}}; + \end{ocg} +} +%}}} +%{{{ alternative node/path " +\newcommand{\ocgnodestyle}[5]{ + \begin{ocmd}{\Not{\Or{#1}}} + \node[#2]#4{#5}; + \end{ocmd} + \begin{ocg}{#1}{#1}{0} + \node[#2,#3]#4{#5}; + \end{ocg} +} + +\newcommand{\ocgpathstyle}[4]{ + \begin{ocmd}{\Not{\Or{#1}}} + \path[#2] #4; + \end{ocmd} + \begin{ocg}{#1}{#1}{0} + \path[#2,#3] #4; + \end{ocg} +} +%}}} +%{{{ itemize " +\newcommand{\ocgitemize}[3]{ + \node#1{ + \begin{minipage}{#2} + \begin{itemize} + #3 + \end{itemize} + \end{minipage} + }; +} + +\newcommand{\ocgitem}[2]{ + \begin{ocmd}{\Or{#1}} + \item#2 + \end{ocmd} +} +%}}} +%{{{ makeprefix " +\newcommand*{\ocgmakeprefixes}[1]{% + \StrSubstitute{#1}{/}{-}[\clid]% + \edef\ocgprefix{fig-\clid}% + \edef\prefix{\ocgprefix-vars}% + \edef\prefixI{\ocgprefix-var1}% + \edef\prefixII{\ocgprefix-var2}% +} +%}}} +%{{{ dynamic figure (1 dimension) " +\newcommand{\ocgfigI}[5]{% + % #1 chapter-local path ; #2 caption ; + % #3 label I ; #4 var I ; #5 list I + \ocgmakeprefixes{#1}% + \def\listI{#5}% + + \centering + \foreach #4/\ignI in \listI {% + \ocmdcase{\prefixI-#4}{% + \input{src/fig/\chapterdir/#1}% + }% + }% + \caption{#2} + \label{fig:\chapterdir/#1} + {% + \small $\triangleright$ + #3% + \foreach \I/\state in \listI {% + \ocgradio{\prefixI}{\prefixI-\I}{\I}{\state}% + }% + }\\ +} +%}}} +%{{{ dynamic figure (2 dimensions) " +\newcommand{\ocgfigII}[8]{% + % #1 chapter-local path ; #2 caption ; + % #3 label I ; #4 var I ; #5 list I ; + % #3 label II ; #4 var II ; #5 list II + \ocgmakeprefixes{#1}% + \def\listI{#5}% + \def\listII{#8}% + + \centering + \foreach #4/\ignI in \listI {% + \foreach #7/\ignII in \listII {% + \ocmdcase{\prefixI-#4,\prefixII-#7}{% + \input{src/fig/\chapterdir/#1}% + }% + }% + }% + \caption{#2} + \label{fig:\chapterdir/#1} + {% + \small $\triangleright$ + #3% + \foreach \I/\state in \listI {% + \ocgradio{\prefixI}{\prefixI-\I}{\I}{\state}% + }% + #6% + \foreach \II/\state in \listII {% + \ocgradio{\prefixII}{\prefixII-\II}{\II}{\state}% + }% + }\\ +} +%}}} +%{{{ dynamic figure (2 bound dimensions) " +\newcommand{\ocgfigIB}[6]{% + % #1 chapter-local path ; #2 caption ; + % #3 label I/II ; #4 var I ; #5 var II ; #6 list I/II + \ocgmakeprefixes{#1}% + \def\list{#6}% + + \centering + \foreach #4/#5/\ign in \list {% + \ocmdcase{\prefix-#4-#5}{% + \input{src/fig/\chapterdir/#1}% + }% + }% + \caption{#2} + \label{fig:\chapterdir/#1} + {% + \small $\triangleright$ + #3% + \foreach \I/\II/\state in \list {% + \ocgradio{\prefix}{\prefix-\I-\II}{\I/\II}{\state}% + }% + }\\ +} +%}}} +%{{{ dynamic figure (1 dimension with remember picture) " +%{{{ ocgfigRPbuttons " +\newcommand{\ocgfigRPbuttons}[4]{% + \def\listI{#2}% + \foreach #1/\state in \listI {% + \foreach \position in {#4} {% + \tikz[remember picture,overlay]{\node[#3,trigger ocg=onmouseall,% + show ocg={{\prefixI-#1},,,{\prefixI-#1}}] at (\position) {};}% + }% + }% +} +%}}} +\newcommand{\ocgfigRP}[7]{% + % #1 local path (tikz rp) ; #2 local path ; + % #3 var I ; #4 list I ; + % #5 node style ; #6 node positions ; + % #7 OCG layer + \ocgmakeprefixes{#2}% + \def\listI{#4}% + \begin{ocg}{#7}{\prefixI}{on}% + \makebox[0pt][c]{\begin{ocg}{Boutons}{.buttons}{on}\input{src/fig/#1}\end{ocg}}% + \foreach #3/\state in \listI {% + \ocgcase{\prefixI}{#7 (#3)}{\prefixI-#3}{\state}{% + \input{src/fig/#2}% + }% + }% + \ocgfigRPbuttons{#3}{#4}{#5}{#6}% + \end{ocg} +} +%}}} +%{{{ dynamic figure (1 dimension) with includegraphics " +%{{{ ocgfigIGbuttons " +\newcommand{\ocgfigIGbuttons}[4]{% + \def\listI{#1}% + \vspace{#3}\hspace{#4}% + {% + \small $\triangleright$ + #2% + \foreach \I/\state in \listI {% + \ocgradio{\prefixI}{\prefixI-\I}{\I}{\state}% + }% + }% +} +%}}} +\newcommand{\ocgfigIG}[8]{% + % #1 chapter-local path ; #2 fn pre ; #3 fn post ; + % #4 label I ; #5 var I ; #6 list I ; + % #7 OCG layer ; #8 hspace ; + % #9 btn vspace ; #10 btn hspace + \ocgmakeprefixes{#1}% + \def\listI{#6}% + \begin{ocg}{#7}{\prefixI}{on}% + \foreach #5/\ignI in \listI {% + \ocmdcase{\prefixI-#5}{% + \hspace{#8}\includegraphics{img/#1/#2#5#3}% + }% + }% + \end{ocg} + + \ocgfigIGbuttons{#6}{#4} +} +%}}} +%}}} +%{{{ Specific for chapter par " +\newcommand*{\ocgpdfonly}[1]{% +\begin{ocg}[printocg=never,exportocg=never]{}{}{1} +#1 +\end{ocg} +} + +\newcommand{\ocgalt}[4]{% +\makebox[0pt][l]{% +\begin{ocg}[printocg=never,exportocg=never]{#1 (alt)}{#2-alt}{0} +#4 +\end{ocg} +} +\begin{ocg}[printocg=always,exportocg=always]{#1}{#2}{1} +#3 +\end{ocg} +} + +\newcommand{\ocgtikzalt}[4][n]{% +\ifstrequal{#1}{n} +{\def\status{visible}\def\altstatus{invisible}} +{\def\status{invisible}\def\altstatus{visible}} +\begin{scope}[ocg={ref=#2,status=\status}] +#3 +\end{scope} +\begin{scope}[ocg={ref=#2-alt,status=\altstatus}] +#4 +\end{scope} +} + +\newcommand*{\switchocgalt}[2]{\switchocg{#1 #1-alt}{#2}} + +\newcommand*{\ocgtogglestaticdynamic}[1]{% +\ocgpdfonly{% +\switchocgalt{#1}{% +\small $\triangleright$ basculer entre la version statique et la version dynamique +} +} +} +%}}} diff --git a/src/usr/silence.tex b/src/usr/silence.tex new file mode 100644 index 0000000..a46db3d --- /dev/null +++ b/src/usr/silence.tex @@ -0,0 +1,5 @@ +\makeatletter +\renewcommand{\PackageInfo}[2]{}% Remove package information +\renewcommand{\@font@info}[1]{}% Remove font information +\renewcommand{\@latex@info}[1]{}% Remove LaTeX information +\makeatother diff --git a/src/usr/tikz.tex b/src/usr/tikz.tex new file mode 100644 index 0000000..e00e89b --- /dev/null +++ b/src/usr/tikz.tex @@ -0,0 +1,3 @@ +\makeatletter +\newcommand\curcoord{\the\tikz@lastxsaved,\the\tikz@lastysaved} +\makeatother diff --git a/sty/acref.sty b/sty/acref.sty new file mode 100644 index 0000000..5260ab6 --- /dev/null +++ b/sty/acref.sty @@ -0,0 +1,132 @@ +\ProvidesPackage{sty/acref} + +\RequirePackage{etoolbox} +\RequirePackage{listofitems} + +%{{{ +\def\acref@instring#1#2{TT\fi\begingroup + \edef\x{\endgroup\noexpand\in@{#1}{#2}}\x\ifin@} +%}}} + +%{{{ cleveref bindings " +\def\acref@cleveref@getname#1#2{\csname #1@#2@name\endcsname} +%}}} + +%{{{ acref " +\let\acref@cref\cref +\renewcommand*{\cref}[1]{\begin{otherlanguage}{english}\acref@cref{#1}\end{otherlanguage}\xspace} + +\newcommand*{\acref@error@article}[2]{% + \PackageError{acref}{undefined article for '#1' (type: '#2', page: \thepage) (possible solution is to add: + \string\acrefarticle{#2}{}{})}{}% +} + +\newcommand*{\acref@error@type}[2]{% + \PackageError{acref}{undefined type for '#1' (type: '#2', page: \thepage) (require changes in + package in \string\acref@article and \string\acref@Article: add + \string\acref@printarticle{\#1}{#2}{\string\acref@art@#2}}{} +} + +\newcommand*{\acref@warning@prefix}[1]{% + \ClassWarning{acref}{Reference '#1' on page \thepage\space has unknown prefix}% +} + +\newcommand*{\acref@printarticle}[3]{\expandafter\ifstrequal\expandafter{#1}{#2}{% + \csname acref@#3@#2\endcsname\def\acref@article@isset{1}}{}% +} + +\newcommand*{\acref@prefixtotype}[1]{\csname acref@prefix@#1\endcsname} +\newcommand*{\acref@crefname}[1]{\acref@cleveref@getname{cref}{#1}} + +\newcommand*{\acref@article}[2]{% + \acref@printarticle{#1}{algorithm}{#2}% + \acref@printarticle{#1}{chapter}{#2}% + \acref@printarticle{#1}{enumi}{#2}% + \acref@printarticle{#1}{equation}{#2}% + \acref@printarticle{#1}{figure}{#2}% + \acref@printarticle{#1}{listing}{#2}% + \acref@printarticle{#1}{section}{#2}% + \acref@printarticle{#1}{subfigure}{#2}% + \acref@printarticle{#1}{subsection}{#2}% + \acref@printarticle{#1}{subsubsection}{#2}% + \acref@printarticle{#1}{table}{#2}% + \acref@printarticle{#1}{theorem}{#2}% + \acref@printarticle{#1}{plural}{#2}% +} + +\newcommand*{\acref@acref}[2]{% + \if\acref@instring{,}{#1}% + \acref@article{plural}{#2}% + \else + \begin{otherlanguage}{english} + \ifcsname r@#1@cref\endcsname + \cref@gettype{#1}{\acref@type}% + \ifcsname acref@art@\acref@type\endcsname + \def\acref@article@isset{}% + \acref@article{\acref@type}{#2}% + \expandafter\ifstrequal\expandafter{\acref@article@isset}{1}{}{\acref@error@type{#1}{\acref@type}}% + \else + \acref@error@article{#1}{\acref@type} + \fi + \else + {% invalid reference + \setsepchar{:}% + \edef\@arg{#1}% + \readlist*\@tmp{\@arg}% + \edef\@prefix{\@tmp[1]}% + \ifcsname acref@prefix@\@prefix\endcsname + \edef\acref@type{\acref@prefixtotype{\@prefix}}% + \acref@article{\acref@type}{#2}% + \acref@crefname{\acref@type}% + \else + \textbf{\@prefix}% + \acref@warning@prefix{#1}% + \fi + } + \fi + \end{otherlanguage} + \fi + \cref{#1}% +} + +\newcommand*{\acrefarticle}[3]{% + \expandafter\def\csname acref@art@#1\endcsname{#2} + \expandafter\def\csname acref@Art@#1\endcsname{#3} +} + +\newcommand*{\acrefprefix}[2]{% + \expandafter\def\csname acref@prefix@#1\endcsname{#2} +} + +\newcommand*{\acref}[2][n]{\acref@acref{#2}{art}} +\newcommand*{\Acref}[2][n]{\acref@acref{#2}{Art}} +%}}} + +%{{{ " default configuration +\acrefarticle{algorithm}{l'}{L'} +\acrefarticle{chapter}{le }{Le } +\acrefarticle{enumi}{le }{Le } +\acrefarticle{equation}{l'}{L'} +\acrefarticle{figure}{la }{La } +\acrefarticle{listing}{la }{La } +\acrefarticle{section}{la }{La } +\acrefarticle{subfigure}{la }{La } +\acrefarticle{subsection}{la }{La } +\acrefarticle{subsubsection}{la }{La } +\acrefarticle{table}{le }{Le } +\acrefarticle{theorem}{le }{Le } + +\acrefarticle{plural}{les }{Les } + +\acrefprefix{alg}{algorithm} +\acrefprefix{ch}{chapter} +\acrefprefix{enumi}{enumi} +\acrefprefix{eq}{equation} +\acrefprefix{fig}{figure} +\acrefprefix{lst}{listing} +\acrefprefix{sec}{section} +\acrefprefix{subsec}{subsection} +\acrefprefix{subsubsec}{subsubsection} +\acrefprefix{tab}{table} +\acrefprefix{th}{theorem} +%}}}