.. java:import:: java.util HashMap .. java:import:: fr.inria.tapenade.differentiation CallGraphDifferentiator MultithreadAnalyzer =================== .. java:package:: fr.inria.tapenade.analysis :noindex: .. java:type:: public final class MultithreadAnalyzer extends DataFlowAnalyzer Analysis of multithread clauses for e.g. OpenMP or Cuda. At present, computes two things: .. * For every Block, whether this block is run multithread, and if so the (zones of) variables that are shared * For every multithread region, a collection of indexes used in the primal code to refer to shared variables, which may be used to prove that accesses to differentiated shared variables are conflict-free. Fields ------ blockInstancesAfter ^^^^^^^^^^^^^^^^^^^ .. java:field:: BlockStorage blockInstancesAfter :outertype: MultithreadAnalyzer blockInstancesBefore ^^^^^^^^^^^^^^^^^^^^ .. java:field:: BlockStorage blockInstancesBefore :outertype: MultithreadAnalyzer freeInstances ^^^^^^^^^^^^^ .. java:field:: MTInstances freeInstances :outertype: MultithreadAnalyzer loopModifiedZones ^^^^^^^^^^^^^^^^^ .. java:field:: BlockStorage loopModifiedZones :outertype: MultithreadAnalyzer Constructors ------------ MultithreadAnalyzer ^^^^^^^^^^^^^^^^^^^ .. java:constructor:: public MultithreadAnalyzer(CallGraph cg) :outertype: MultithreadAnalyzer Methods ------- analyze ^^^^^^^ .. java:method:: @Override protected boolean analyze() :outertype: MultithreadAnalyzer analyzeSharedAdjointConflicts ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public void analyzeSharedAdjointConflicts(Unit unit, ActivityPattern activity, CallGraphDifferentiator cgDifferentiator) :outertype: MultithreadAnalyzer Main method: for the given "unit", builds all contexts and all instance numbers, then collects all future (read or writes) of multithread shared (primal and adjoint) variables, then, from these collections, fills each context with its list of conflict-free knowledge (from the primal) and its list of conflict-free questions (for the adjoint), finally on each context, (hopefully) calls Z3 with knowledge and questions, and consequently fills the resulting BoolVector of conflict-free conflict-free shared adjoint variables, which is attached to the ParallelInfoOfBlock of the parallel region header Block. attachInstances ^^^^^^^^^^^^^^^ .. java:method:: public static void attachInstances(Tree expr, MTInstances instances, Instruction instr, boolean inIndex) :outertype: MultithreadAnalyzer buildConflicts ^^^^^^^^^^^^^^ .. java:method:: public void buildConflicts(ParallelInfoOfBlock parallelRegionInfo, boolean isQuestion) :outertype: MultithreadAnalyzer buildContexts ^^^^^^^^^^^^^ .. java:method:: public void buildContexts() :outertype: MultithreadAnalyzer buildInstances ^^^^^^^^^^^^^^ .. java:method:: public void buildInstances() :outertype: MultithreadAnalyzer collectAllSharedUses ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public void collectAllSharedUses(CallGraphDifferentiator cgDifferentiator) :outertype: MultithreadAnalyzer collectOneSharedVarUse ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public void collectOneSharedVarUse(Tree expr, MTInstances instances, Instruction instr, boolean justRead, SharedVarUses[] sharedVarUses) :outertype: MultithreadAnalyzer dumpExistingContexts ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public void dumpExistingContexts() :outertype: MultithreadAnalyzer getConflictFreeSharedAdjointZones ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public BoolVector getConflictFreeSharedAdjointZones(Block block) :outertype: MultithreadAnalyzer getSharedZonesOfBlock ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public BoolVector getSharedZonesOfBlock(Block block) :outertype: MultithreadAnalyzer Returns the detected shared zones for the given Block. getSharedZonesOfUnit ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public BoolVector getSharedZonesOfUnit(Unit unit) :outertype: MultithreadAnalyzer Returns the detected shared zones for the given Unit. initializeCGForRootUnit ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void initializeCGForRootUnit() :outertype: MultithreadAnalyzer initializeCGForUnit ^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected Object initializeCGForUnit() :outertype: MultithreadAnalyzer initializeInitBlock ^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void initializeInitBlock() :outertype: MultithreadAnalyzer initializeUnit ^^^^^^^^^^^^^^ .. java:method:: @Override protected void initializeUnit() :outertype: MultithreadAnalyzer isGPU ^^^^^ .. java:method:: public boolean isGPU(Unit unit) :outertype: MultithreadAnalyzer propagateValuesStaticallyThroughBlock ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void propagateValuesStaticallyThroughBlock() :outertype: MultithreadAnalyzer run ^^^ .. java:method:: public void run() :outertype: MultithreadAnalyzer Runs detection. runAnalysis ^^^^^^^^^^^ .. java:method:: public static void runAnalysis(CallGraph callGraph) :outertype: MultithreadAnalyzer terminateCGForUnit ^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void terminateCGForUnit() :outertype: MultithreadAnalyzer terminateUnit ^^^^^^^^^^^^^ .. java:method:: @Override protected boolean terminateUnit() :outertype: MultithreadAnalyzer