ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AstSharedMemoryParallelSimpleProcessing.h
Go to the documentation of this file.
1 // Author: Gergo Barany
2 // $Id: AstSharedMemoryParallelSimpleProcessing.h,v 1.1 2008/01/08 02:56:39 dquinlan Exp $
3 
4 // Class for parallelizing AstSimpleProcessing traversals; see the comment in
5 // AstSharedMemoryParallelProcessing.h for general information.
6 
7 #ifndef ASTSHAREDMEMORYPARALLELSIMPLEPROCESSING_H
8 #define ASTSHAREDMEMORYPARALLELSIMPLEPROCESSING_H
9 
10 #include "AstSimpleProcessing.h"
12 
13 // parallel SIMPLE processing class
14 
15 // Class representing a traversal that can run in parallel with some other instances of the same type. It is basically a
16 // combined processing class with a thin synchronization layer. The user will probably never need to instantiate this
17 // class, they should use the AstSharedMemoryParallel*Processing classes instead.
21 {
22 public:
27 
30  const TraversalPtrList &);
31 
32  void set_runningParallelTraversal(bool val);
33 
34 protected:
35  virtual void visit(SgNode *astNode);
36  virtual void atTraversalEnd();
37 
38 private:
39  size_t visitedNodes;
42 };
43 
44 // Class for parallel execution of a number of traversals. This is a drop-in
45 // replacement for the corresponding AstCombined*Processing class, the usage
46 // is identical except that you call traverseInParallel() instead of
47 // traverse(). (Calling traverse() is identical to AstCombined*Processing,
48 // i.e. it will not run in parallel.)
51 {
52 public:
56 
58  typedef std::vector<ParallelizableTraversalPtr> ParallelizableTraversalPtrList;
59 
62 
63  void traverseInParallel(SgNode *basenode, t_traverseOrder treeTraverseOrder);
64 
65 private:
68 };
69 
70 // parallel PRE POST processing class
71 
72 // Class representing a traversal that can run in parallel with some other instances of the same type. It is basically a
73 // combined processing class with a thin synchronization layer. The user will probably never need to instantiate this
74 // class, they should use the AstSharedMemoryParallel*Processing classes instead.
78 {
79 public:
84 
87  const TraversalPtrList &);
88 
89  void set_runningParallelTraversal(bool val);
90 
91 protected:
92  virtual void preOrderVisit(SgNode *astNode);
93  virtual void atTraversalEnd();
94 
95 private:
96  size_t visitedNodes;
99 };
100 
101 // Class for parallel execution of a number of traversals. This is a drop-in
102 // replacement for the corresponding AstCombined*Processing class, the usage
103 // is identical except that you call traverseInParallel() instead of
104 // traverse(). (Calling traverse() is identical to AstCombined*Processing,
105 // i.e. it will not run in parallel.)
108 {
109 public:
113 
115  typedef std::vector<ParallelizableTraversalPtr> ParallelizableTraversalPtrList;
116 
119 
120  void traverseInParallel(SgNode *basenode);
121 
122 private:
125 };
126 
127 #endif