6#ifndef ASTSHAREDMEMORYPARALLELPROCESSING_H 
    7#define ASTSHAREDMEMORYPARALLELPROCESSING_H 
    9#include "rosePublicConfig.h" 
   11#include "AstProcessing.h" 
   19# ifdef ROSE_HAVE_PTHREAD_H                              
   21    pthread_mutex_t *mutex;
 
   23    pthread_cond_t *synchronizationEvent;
 
   25    pthread_cond_t *threadFinishedEvent;
 
   28#   pragma message ("POSIX threads are unavailable on this platform"); 
   30#   warning "POSIX threads are unavailable on this platform." 
   37    size_t *workingThreads;
 
   40    size_t *finishedThreads;
 
   43    size_t synchronizationWindowSize;
 
 
   69    size_t numberOfThreads;
 
 
   77template <
class InheritedAttributeType, 
class SynthesizedAttributeType>
 
   86    typedef typename Superclass::TraversalPtrList TraversalPtrList;
 
   87    typedef typename Superclass::InheritedAttributeTypeList InheritedAttributeTypeList;
 
   88    typedef typename Superclass::SynthesizedAttributeTypeList SynthesizedAttributeTypeList;
 
   89    typedef typename Superclass::SynthesizedAttributesList SynthesizedAttributesList;
 
   93            const TraversalPtrList &);
 
   95    void set_runningParallelTraversal(
bool val);
 
  100            InheritedAttributeTypeList *inheritedValues);
 
  101    virtual void atTraversalEnd();
 
  105    bool runningParallelTraversal;
 
  106    size_t synchronizationWindowSize;
 
 
  112template <
class InheritedAttributeType, 
class SynthesizedAttributeType>
 
  118    typedef typename Superclass::InheritedAttributeTypeList InheritedAttributeTypeList;
 
  119    typedef typename Superclass::SynthesizedAttributeTypeList SynthesizedAttributeTypeList;
 
  121    typedef typename Superclass::TraversalPtrList TraversalPtrList;
 
  124    typedef std::vector<ParallelizableTraversalPtr> ParallelizableTraversalPtrList;
 
  126    SynthesizedAttributeTypeList *traverseInParallel(
SgNode *basenode,
 
  127            InheritedAttributeTypeList *inheritedValue);
 
  132    void set_numberOfThreads(
size_t threads);
 
  133    void set_synchronizationWindowSize(
size_t windowSize);
 
  136    size_t numberOfThreads;
 
  137    size_t synchronizationWindowSize;
 
 
  145template <
class InheritedAttributeType>
 
  154    typedef typename Superclass::TraversalPtrList TraversalPtrList;
 
  155    typedef typename Superclass::InheritedAttributeTypeList InheritedAttributeTypeList;
 
  159            const TraversalPtrList &);
 
  161    void set_runningParallelTraversal(
bool val);
 
  166            InheritedAttributeTypeList *inheritedValues);
 
  167    virtual void atTraversalEnd();
 
  171    bool runningParallelTraversal;
 
  172    size_t synchronizationWindowSize;
 
 
  178template <
class InheritedAttributeType>
 
  184    typedef typename Superclass::InheritedAttributeTypeList InheritedAttributeTypeList;
 
  186    typedef typename Superclass::TraversalPtrList TraversalPtrList;
 
  189    typedef std::vector<ParallelizableTraversalPtr> ParallelizableTraversalPtrList;
 
  191    void traverseInParallel(
SgNode *basenode, InheritedAttributeTypeList *inheritedValue);
 
  196    void set_numberOfThreads(
size_t threads);
 
  197    void set_synchronizationWindowSize(
size_t windowSize);
 
  200    size_t numberOfThreads;
 
  201    size_t synchronizationWindowSize;
 
 
  209template <
class SynthesizedAttributeType>
 
  218    typedef typename Superclass::TraversalPtrList TraversalPtrList;
 
  219    typedef typename Superclass::SynthesizedAttributeTypeList SynthesizedAttributeTypeList;
 
  220    typedef typename Superclass::SynthesizedAttributesList SynthesizedAttributesList;
 
  224            const TraversalPtrList &);
 
  226    void set_runningParallelTraversal(
bool val);
 
  229    virtual SynthesizedAttributeTypeList *evaluateSynthesizedAttribute(
 
  231            SynthesizedAttributesList synthesizedAttributes);
 
  232    virtual void atTraversalEnd();
 
  236    bool runningParallelTraversal;
 
  237    size_t synchronizationWindowSize;
 
 
  243template <
class SynthesizedAttributeType>
 
  249    typedef typename Superclass::SynthesizedAttributeTypeList SynthesizedAttributeTypeList;
 
  251    typedef typename Superclass::TraversalPtrList TraversalPtrList;
 
  254    typedef std::vector<ParallelizableTraversalPtr> ParallelizableTraversalPtrList;
 
  256    SynthesizedAttributeTypeList *traverseInParallel(
SgNode *basenode);
 
  261    void set_numberOfThreads(
size_t threads);
 
  262    void set_synchronizationWindowSize(
size_t windowSize);
 
  265    size_t numberOfThreads;
 
  266    size_t synchronizationWindowSize;
 
 
  269#include "AstSharedMemoryParallelProcessingImpl.h" 
  271#include "AstSharedMemoryParallelSimpleProcessing.h" 
Attribute Evaluator for synthesized attributes.
 
virtual InheritedAttributeTypeList * evaluateInheritedAttribute(SgNode *astNode, InheritedAttributeTypeList *inheritedValues)
pure virtual function which must be implemented to compute the inherited attribute at a node
 
virtual InheritedAttributeTypeList * evaluateInheritedAttribute(SgNode *astNode, InheritedAttributeTypeList *inheritedValues)
pure virtual function which must be implemented to compute the inherited attribute at a node
 
Attribute Evaluator for inherited and synthesized attributes.
 
Attribute Evaluator for inherited attributes.
 
This class represents the base class for all IR nodes within Sage III.