TapEnvForThread

public final class TapEnvForThread

Contains all settings needed by Tapenade at some point, (except those specific to AD that go into adEnv), and that are specific for each individual thread.

Fields

absLinearForm

public boolean absLinearForm

Set to true to test Andreas’ ABS Linear Forms (“ALF”).

adActivityAnalyzer

protected ADActivityAnalyzer adActivityAnalyzer

The activity analyzer, finding variables that must have a derivative.

adTbrAnalyzer

protected ADTBRAnalyzer adTbrAnalyzer

The TBR analyzer, finding variables that must be stored and then retrieved during an adjoint differentiation.

argRK

protected int argRK

assocAddressDiffSuffix

public String assocAddressDiffSuffix

Suffix for diff values with association-by-address.

assocAddressDiffTypesUnits

protected Unit[] assocAddressDiffTypesUnits

The FORTRAN module, C unit, C++ unit that defines the special types for association-by-address.

assocAddressValueSuffix

public String assocAddressValueSuffix

Suffix for orig values with association-by-address.

associationByAddress

protected boolean associationByAddress

When true, place differentiated values using association-by-address instead of association-by-name.

byteSize

public int byteSize

Size of a byte for this system.

charSize

public int charSize

Size of a char for this system.

combineDeclMessagesSwitch

protected boolean combineDeclMessagesSwitch

When false, messages DD05 (Cannot combine successive declarations…) are inhibited. Because repeated inclusion of C standard include files cause spurious DD05 messages.

complexStep

public boolean complexStep

When true, fortran REAL’s are turned into COMPLEX’es to enable the complex-step method

cppCommand

public String cppCommand

The command to run the/a preprocessor before AD of a C file.

cppOptions

public String cppOptions

The options for the preprocessor before AD of a C file.

createStub

public boolean createStub

True when -p and no analysis.

curOutputStream

public OutputStream curOutputStream

The current output stream used by print().

currentDirectory

protected String currentDirectory

The current directory, used to look for include files.

currentIncludeInstruction

protected Instruction currentIncludeInstruction

The include Instruction that contained the current Instruction.

currentParsedFile

protected String currentParsedFile

currentTranslationUnitSymbolTable

protected SymbolTable currentTranslationUnitSymbolTable

danglingMessages

protected TapList<PositionAndMessage> danglingMessages

The list of all messages that could not be related to such or such Unit.

debugADMM

protected boolean debugADMM

label all calls to ADMM primitives with a unique label for debugging

debugActivity

protected boolean debugActivity

When true, deactivates filterVariedUsefulWithDeps() and mergeUsefulnessIntoVariedness() so that when the normal mode eventually finds no activity at all, this mode still runs top-down activity analysis through the code. This may help find where the activity chain is broken.

debugAdMode

protected int debugAdMode

Debug mode of differentiated programs. NO_DEBUG:no debug ; TGT_DEBUG:debug tangent ; ADJ_DEBUG:debug adjoint.

debugPassives

public boolean debugPassives

When true, in debug tangent mode, tries also to test that the passives are not varied.

defaultCheckpointCalls

public boolean defaultCheckpointCalls

The default checkpointing decision on call sites.

depsAnalyzer

protected DepsAnalyzer depsAnalyzer

The data-dependency analyzer, finding dependencies of outputs wrt inputs of procedures.

diffFileSuffix

public String diffFileSuffix

The suffix used to build the names of differentiated files.

diffKind

protected int diffKind

The kind of zones that are currently differentiated. Usually, it is REALKIND, but in a very special mode, it can be ALLKIND.

diffLivenessAnalyzer

protected DiffLivenessAnalyzer diffLivenessAnalyzer

The differentiable liveness analyzer, finding original code that is eventually useful or not for the derivative computations.

diffMode

protected int diffMode

Current differentiation mode.

diffReplica

public int diffReplica

Number of replicates of diff variables, as requested by “-replicateDiff” option.

differentiatedIncludeNames

public final TapList<TapTriplet<String, String, Tree>> differentiatedIncludeNames

Association from original include-file name to differentiated include-file name, plus collection of waiting include Trees that should receive the differentiated include-file name if it is created.

doActivity

protected boolean doActivity

When true, activity analysis is activated.

doMPI

protected boolean doMPI

When true, run special analyses on MPI calls.

doOpenMP

protected boolean doOpenMP

When true, run analyses for OpenMP clauses.

doOpenMPZ3

protected boolean doOpenMPZ3

When true, run special analyses for OpenMP clauses using Z3 model checker.

doRecompute

public boolean doRecompute

When true, cheap instructions may be repeated to further reduce the adjoint mode stack.

doTBR

public boolean doTBR

When true, TBR analysis is run to further reduce the adjoint mode stack.

doUsefulness

protected boolean doUsefulness

When false, usefulness analysis is de-activated.

dontSaveUnused

public boolean dontSaveUnused

When true, only used variables are pushed on the adjoint mode stack.

doubleDoubleRealSize

public int doubleDoubleRealSize

Size of a long double precision float for this system.

doubleRealSize

public int doubleRealSize

Size of a double precision float for this system.

dumpCallGraph

public boolean dumpCallGraph

True if user wants a compact dump of the source Call Graph.

dumpDataFlow

public boolean dumpDataFlow

True if user wants a dump of the Data Flow results on the source.

dumpDeps

public boolean dumpDeps

True if user wants a dump of dependency info matrices in the data-flow of the Call Graph.

dumpDiffFlowGraphs

public boolean dumpDiffFlowGraphs

True if user wants a dump of the differentiated code’s Flow-Graphs.

dumpDiffSymbolTables

public boolean dumpDiffSymbolTables

True if user wants a dump of the differentiated code’s Symbol Tables.

dumpFlowGraphs

public boolean dumpFlowGraphs

True if user wants a dump of the source Flow-Graphs.

dumpInOut

public boolean dumpInOut

True if user wants a dump of In-Out info in the data-flow of the Call Graph.

dumpOutputStream

public OutputStream dumpOutputStream

The OutputStream for traces (milestones, differentiation debug traces…).

dumpPointers

public boolean dumpPointers

True if user wants a dump of pointer info in the data-flow of the Call Graph.

dumpSymbolTables

public boolean dumpSymbolTables

True if user wants a dump of the source Symbol Tables.

dumpUnitNames

public TapList<String> dumpUnitNames

List of names of Unit’s to be dumped.

dumpZones

public boolean dumpZones

True if user wants a dump of the zones numbers used in the dump.

dumps

public boolean dumps

True when dump mode is on.

duplicableUnitNames

public TapList<String> duplicableUnitNames

List of names of function Unit’s declared by the user as “duplicable”, i.e. cheap and without side-effects

expRK

protected int expRK

expandAllIncludeFile

public boolean expandAllIncludeFile

When true, expand all includes in the generated files.

expandDiffIncludeFile

public boolean expandDiffIncludeFile

fixInterface

public boolean fixInterface

When true, forbids modifications of the dependent and independent of root Units.

fixedNbdirsString

public String fixedNbdirsString

When non-null, the expression to use as the number of vector-diff directions.

fixedNbdirsTree

public Tree fixedNbdirsTree

When non-null, the Tree to use as the number of vector-diff directions.

fixedNbdirsmaxString

public String fixedNbdirsmaxString

When non-null, the expression to use as the max number of vector-diff directions.

fixedNbdirsmaxTree

public Tree fixedNbdirsmaxTree

When non-null, the Tree to use as the max number of vector-diff directions.

fortran90LineLength

public String fortran90LineLength

The max line length for our Fortran90 parser.

fortran90OutputLineLength

public int fortran90OutputLineLength

fppCommand

public String fppCommand

The command to run the/a preprocessor before AD of a fortran file.

fppOptions

public String fppOptions

The options for the preprocessor before AD of a fortran file.

hasParsingError

public boolean hasParsingError

If an error during parsing occurs, exit(1).

inIncludeFile

protected boolean inIncludeFile

inOutAnalyzer

protected InOutAnalyzer inOutAnalyzer

The In-Out analyzer, finding variables read and/or written by procedures.

includeDirs

protected TapList<String> includeDirs

-I include path.

includeFileStack

protected TapList<String> includeFileStack

Stack of the currenly opened include files, i.e. the names of the include files we are currently in.

includeFiles

public TapList<String> includeFiles

inlinedFunctions

public InlinedFunctions inlinedFunctions

List of inlinedFunctions (cf libraries/GeneralLibReader).

inputLanguage

public int inputLanguage

integerSize

public int integerSize

Size of an integer for this system.

languages

protected final int[] languages

[FortranDialect, C, CPP].

mergeDiffInstructions

public boolean mergeDiffInstructions

When true, diff instructions are merged when profitable.

mixedLangInfos

protected TapList<MixedLanguageInfos> mixedLangInfos

multiDirDiffMode

public boolean multiDirDiffMode

True if the coming differentiation will be multi-directional.

multiFuncSuffix

public String multiFuncSuffix

The additional suffix for “multi-directional” diff modes.

multithreadAnalyzer

protected MultithreadAnalyzer multithreadAnalyzer

The OpenMP clauses analyzer, finding the OpenMP status of variables (shared, private…)

mustAdjoint

public boolean mustAdjoint

True if the coming differentiation will feature some adjoint diff.

mustContext

public boolean mustContext

When true, code outside the differentiation root is also regenerated, to prepare the context to call the diff code.

mustTangent

public boolean mustTangent

True if the coming differentiation will feature some tangent diff.

newSHdisambiguator

public int newSHdisambiguator

This integer will be incremented each time we create a new temporary symbol (tmp, arg, result, dumm, dummyarraydiff…) and then attached to the new symbol name to make it unique so that it can be recognized, e.g. with sed.

nextCodeTag

protected int nextCodeTag

Used for source-code correspondence.

nextMessageTag

protected int nextMessageTag

nextNewLabel

public int nextNewLabel

Used in treeGen.

nextSourceMsgTag

protected int nextSourceMsgTag

Used for source-message correspondence.

nextSourceTag

protected int nextSourceTag

noComment

public boolean noComment

About handling of comments by the preprocessors (e.g. cpp, fpp…) Default false implies preprocessor called with “-C”, thus keeping comments.

noisize

public boolean noisize

In the differentiated code, do not create “ISIZEOF” constants that the user must then define, but rather use the Fortran90 dynamic SIZE() function.

noisize77

public boolean noisize77

Like noisize, but use the dynamic SIZE() function even when not in Fortran90.

numberPushPops

public boolean numberPushPops

When true, place a common numeric mark on matching Push/POP’s.

oldContext

public boolean oldContext

TEMPORARY: Option to run the old context system (before option “-context” existed), that adds memory allocation and pointer computations of the adjoint variables into the copied “_CD” and “_CB” procedures.

optionsString

public String optionsString

Summarizes all extra options selected for this Tapenade run.

outputDirectory

public String outputDirectory

The directory where to put all generated files.

outputLanguage

public int outputLanguage

outputStreamStack

public TapList<OutputStream> outputStreamStack

parserFileSeparator

public String parserFileSeparator

pointerAnalyzer

protected PointerAnalyzer pointerAnalyzer

The pointer destination anlayzer (points-to analysis).

pointerSize

public int pointerSize

Size of a pointer for this system.

preprocessFileSuffix

public String preprocessFileSuffix

The suffix used to build the names of preprocessed/non-differentiated files.

profile

public boolean profile

When true, instrument the diff code with profiling instructions.

pushPopNumber

public int pushPopNumber

realSize

public int realSize

Size of a float for this system.

refineADMM

public boolean refineADMM

When true, refine application of the ADMM mechanism i.e. Register/Unregister/Rebase by restricting it to those that really need it (according to a static data-flow analysis).

  1. Only Rebase pointers that may point to chunks that may be reallocated

  2. Only Register/Unregister chunks that may be pointed to by TBR pointers.

relatedArrow

protected CallArrow relatedArrow

For dumpUnit.

relatedLanguage

protected int relatedLanguage

relatedUnit

protected Unit relatedUnit

The “current” Unit, used to attach all messages emitted, and also to know the particular programming language, sometimes incurring limitations.

relatedUnits

protected TapList<Unit> relatedUnits

removeDeadControl

public boolean removeDeadControl

When true, original control instructions that are eventuallynot needed for derivatives are sliced away.

removeDeadPrimal

public boolean removeDeadPrimal

When true, primal code that is eventually not needed for derivatives is sliced away.

reqExplicitAnalyzer

protected ReqExplicit reqExplicitAnalyzer

The pointer activity analyzer, finds pointers for which a derivative must be defined. Also finds allocations, de-allocations, and pointer operations that must be transposed for the derivative counterpart.

resultRK

protected int resultRK

Used during instruction splitting: Static ints to increment the number at the end of the intermediate var names such as “result”, “arg”.

rootDirectoryPath

protected Path rootDirectoryPath

The root directory of the parsed files.

seenSymbolTables

public TapList<TapPair<SymbolTable, String>> seenSymbolTables

A-List of SymbolTables already shown on dump. A-List of TapPair’s (SymbolTable,String to refer to it).

spareDiffReinitializations

protected boolean spareDiffReinitializations

When true, reinitialization of derivative of passive variables is postponed.

spareNoDiffArgs

public boolean spareNoDiffArgs

When true, non-active procedure arguments are not differentiated.

splitDiffExpressions

public boolean splitDiffExpressions

When true, diff expressions are split to eliminate common subexpressions.

srcUnitsToTraceInTreeGen

public TapList<Unit> srcUnitsToTraceInTreeGen

List of the source Units requiring detailed trace messages during tree regeneration.

standaloneDiff

public boolean standaloneDiff

When true, the differentiated code incorporates enough of the primal code to be standalone.

staticTape

public boolean staticTape

When true, try to use local static storage when possible instead of PUSH/POP.

stdLibraryDirectory

public String stdLibraryDirectory

The directory where to find the Library specification files.

stripDiffTypes

public boolean stripDiffTypes

When true, differentiated types are simplified by stripping passive components.

stripPrimalCode

public boolean stripPrimalCode

When true, useless primal code (procedures…) is stripped from differentiated files.

stripPrimalEvenIfImportsActive

public boolean stripPrimalEvenIfImportsActive

(Requested by one user, but dangerous) When true, the fact that a unit IMPORTS an active module is not a sufficient reason to keep its primal version in the diff code (as a _NODIFF unit).

stripPrimalModules

public boolean stripPrimalModules

When false, all modules are differentiated (previous default, for compatibility and test) when true, only active modules are differentiated.

suffixF90

public String suffixF90

.f90, .f95 or .f03.

traceADDeps

public TapList<String> traceADDeps

List of names of Unit’s requiring detailed trace messages during ADDeps analysis.

traceActivity

public TapList<String> traceActivity

List of names of Unit’s requiring detailed trace messages during Activity analysis.

traceBlockRk

public int traceBlockRk

Rank of one Block in the selected Unit, on which traces should focus.

traceCallArrowDestinationName

public String traceCallArrowDestinationName

Name of the destination Unit of CallArrow’s on which traces should focus.

traceCallArrowOriginName

public String traceCallArrowOriginName

Name of the origin Unit of CallArrow’s on which traces should focus.

traceCurAnalysis

public boolean traceCurAnalysis

When true, we trace analysis on-the-fly on the curUnit.

traceDeps

public TapList<String> traceDeps

List of names of Unit’s requiring detailed trace messages during Deps analysis.

traceDiffLiveness

public TapList<String> traceDiffLiveness

List of names of Unit’s requiring detailed trace messages during DiffLiveness analysis.

traceDifferentiationUnitNames

public TapList<String> traceDifferentiationUnitNames

List of names of Unit’s of Units requiring detailed trace messages during differentiation.

traceFlowGraphBuild

public TapList<String> traceFlowGraphBuild

Names of Unit’s for which we require detailed trace messages during FlowGraph building.

traceInOut

public TapList<String> traceInOut

List of names of Unit’s requiring detailed trace messages during In-Out analysis.

traceIndent

protected int traceIndent

The current amount of indentation.

traceInline

public TapList<String> traceInline

Names of Unit’s for which we require detailed trace messages during inlining.

traceInlineAnalysis

protected boolean traceInlineAnalysis

True when we want to trace inline analysis on-the-fly on the current Unit.

traceInputIL

public boolean traceInputIL

When true, the tree operators coming from the input IL will be shown.

traceMultithread

public TapList<String> traceMultithread

List of names of Unit’s requiring detailed trace messages during Multithread analysis.

traceOutputStream

public final OutputStream traceOutputStream

The OutputStream for traces (milestones, differentiation debug traces…).

traceParser

public boolean traceParser

When true, Tapenade prints the system command(s) used to parse the input files into IL.

tracePointer

public TapList<String> tracePointer

List of names of Unit’s requiring detailed trace messages during Pointer analysis.

traceReqExplicit

public TapList<String> traceReqExplicit

List of names of Unit’s requiring detailed trace messages during ReqExplicit analysis.

traceTBR

public TapList<String> traceTBR

List of names of Unit’s requiring detailed trace messages during TBR analysis.

traceTreeGenUnitNames

public TapList<String> traceTreeGenUnitNames

List of names of Unit’s of Units requiring detailed trace messages during tree regeneration.

traceTypeCheck

public TapList<String> traceTypeCheck

Names of Unit’s for which we require detailed trace messages during typecheck.

traceTypeCheckAnalysis

protected boolean traceTypeCheckAnalysis

True when we want to trace typeCheck analysis on-the-fly on the current Unit.

tracedInlineUnits

public TapList<Unit> tracedInlineUnits

Unit’s for which we require detailed trace messages during inline.

tracedTypeCheckUnits

protected TapList<Unit> tracedTypeCheckUnits

Unit’s for which we require detailed trace messages during typecheck.

useSharpInclude

public boolean useSharpInclude

When true, prefer generate #include instead of Fortran include

usedLabels

public TapList<String> usedLabels

For a unit, list of all labels.

valid

protected boolean valid

True if the coming tangent diff will include estimation of the differentiability interval.

Constructors

TapEnvForThread

protected TapEnvForThread()

Methods

emitMessage

public final synchronized void emitMessage(int position, Tree tree, String message, int inverseSeverity)

flushOutputStream

public final synchronized void flushOutputStream()

Flush the current OutputStream for all Strings printed and all messages emitted through this TapEnv.

origCallGraph

public CallGraph origCallGraph()

When differentiating, holds the CallGraph of the original, non differentiated code.

parserError

public final void parserError(String message)

restoreIncludeManager

public void restoreIncludeManager()

saveAndResetIncludeManager

public void saveAndResetIncludeManager()

setOrigCallGraph

public void setOrigCallGraph(CallGraph cg)