Tapenade

public final class Tapenade

Top class for Tapenade. Contains the “main” method.

Fields

TAPENADE_GEN_HTML_DIR

protected static final String TAPENADE_GEN_HTML_DIR

TAPENADE_SERVLET_OUTPUT_DIR

protected static final String TAPENADE_SERVLET_OUTPUT_DIR

diffRoots

protected TapList<DiffRoot> diffRoots

Hatted TapList of DiffRoot objects. The hat itself is used as a pointer to the current “diffRoot” of interest, so that isolated “-vars” or “-outvars” arguments will affect this current “diffRoot” defined by a previous “-root” option.

dumpFileName

protected String dumpFileName

htmlMessageFileName

protected String htmlMessageFileName

textMessageFileName

protected String textMessageFileName

Constructors

Tapenade

protected Tapenade(int fileLang, String aliParser, int diffmode, String webAppRoot, String absoluteDirectory, String clientDirectory, String[] inputfilenames, String libDirectory, String headFunction, String activevariables, String usefulvariables, boolean multiDirDiffMode)

Creation of one “Tapenade” for the servlet.

Methods

analyzeFile

protected boolean analyzeFile()

cssDir

protected String cssDir()
Returns

Html css directory for html output.

diffCallGraph

protected CallGraph diffCallGraph()

dumpDataFlow

public void dumpDataFlow()

Dump the static data-flow info on each Unit for dumpUnitNames

dumpZones

public void dumpZones()

Dump the zones of each SymbolTable for dumpUnitNames

extractFiles

protected static String[] extractFiles(String directory, String filename)

Extracts files contained in an archive file.

Parameters
  • directory – directory containing archive file.

  • filename – archive file name (with .zip or .jar suffix).

Returns

file names contained in archive file.

generateListInputFiles

public static TapList<TapPair<String, Integer>> generateListInputFiles(String[] fnames, int[] flanguages)

getTransformedSourceUnits

protected TapList<Unit> getTransformedSourceUnits(TapList<TapPair<Unit, TapList<Unit>>> differentiationAssociations)

Collect the source CallGraph Units that have at least one differentiated counterpart.

main

public static void main(String[] args)

Called by bin/tapenade shell script.

Parameters
  • args – provided by user.

origCallGraph

protected CallGraph origCallGraph()

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

parseFiles

public static void parseFiles(boolean addDirectory, String directory, TapList<TapPair<String, Integer>> inputFiles, CallGraph origCallGraph, TapList<String> includeDirs, int defaultFormat, boolean parseOpenMP)

Parses all the source files into the given CallGraph.

Parameters
  • addDirectory – if true. localInputFileNames are in directory.

  • directory – directory.

  • inputFiles – TapList of pairs of full path of input files and their inputlanguages.

  • origCallGraph – current callGraph.

  • includeDirs – include directories.

  • parseOpenMP – OpenMP option for fortran parser.

Throws
  • IOException – if an input error is detected.

preProcess

public static CallGraph preProcess(String[] files)