HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_WorkItemTypes.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __PDG_WORK_ITEM_TYPES_H__
10 #define __PDG_WORK_ITEM_TYPES_H__
11 
12 #include <UT/UT_Array.h>
13 #include <UT/UT_ArrayMap.h>
14 #include <UT/UT_ArraySet.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_Optional.h>
17 
18 #include <SYS/SYS_Types.h>
19 
20 class PDG_BatchWorkItem;
21 class PDG_WorkItem;
22 class PDG_WorkItemData;
23 
24 /// Type def for registered type objects
26 
27 /// Type defs for unique work item IDs
34  std::pair<const PDG_WorkItem*, bool>>;
35 
36 /// Array, set and map of work items
41 
42 /// Pair and array of work item pairs
43 using PDG_WorkItemPair = std::pair<PDG_WorkItem*, PDG_WorkItem*>;
45 
46 /// Array and set of batch work items
48 
49 /// Optional frame value, used when constructing work items and partitions
51 
52 /// Enumeration of activiation modes for the batch, i.e. the condition under
53 /// which the batch item is first submitted to the scheduler
55 {
56  /// The batch is scheduled once any of the subitems are ready to cook
57  eAny,
58 
59  /// The batch is scheduled once the first sub item is ready to cook
60  eFirst,
61 
62  /// The batch is scheduled once all of the subitems are ready to cook
63  eAll,
64 
65  /// The batch is scheduled once a specific number of subitems are ready
66  /// to cook
67  eFixed
68 };
69 
70 /// Enumeration of evaluation states that a work item can be in. Used when
71 /// checking if the subitem is able to evaluate yet.
73 {
74  /// The work item is blocked on a dependency
76 
77  /// The work item is ready to cook
78  eEvalReady,
79 
80  /// The work item has a failed dependency
82 };
83 
84 /// Enumeration of work item cache states, returned when checking if a work
85 /// item is cached with respect to a particular node
87 {
88  /// The work item's cache state is undefined, e.g. because it doesn't
89  /// exist or the node doesn't support caching
90  eUndefined,
91 
92  /// The cache state is always dirty, usually due to the node's caching
93  /// mode parameter
95 
96  /// The cache state is dirty because the work item has no files
98 
99  /// The cache state is dirty because the work item has new files that
100  /// didn't exist on a previous cook
101  eDirtyNew,
102 
103  /// The cache state is dirty because the work item is stale with
104  /// respect to its input tasks
105  eDirtyStale,
106 
107  /// The cache state is dirty because an output file is missing on disk
109 
110  /// The cache is clean, assuming the parent task is also clean
112 
113  /// The cache is clean
114  eClean,
115 };
116 
117 /// Enumeration of work item log message types
119 {
120  /// Error log message
121  eLogError,
122 
123  /// Warning log message
124  eLogWarning,
125 
126  /// Plain log message
127  eLogMessage,
128 
129  /// Raw log data
130  eLogRaw,
131 };
132 
133 /// Enumeration of sort order types, currently used by the partitionItems
134 /// method
136 {
137  /// Explicitly chosen no sorting
138  eSortNone,
139 
140  /// Index based sorting
141  eSortIndex,
142 
143  /// Input ordering
145 
146  /// Order by a specific attribute value
148 
149  /// Order by the work item's frame value
150  eSortFrame,
151 };
152 
153 /// Enum of possible work item states
155 {
156  /// Undefined state, e.g. for uninitialized data. Work items should never
157  /// actually have this state
158  eUndefined,
159 
160  /// The item is uncooked and no cooked has been attempted yet
161  eUncooked,
162 
163  /// The item is uncooked and waiting on its dependencies to finish
164  /// cooking
165  eWaiting,
166 
167  /// The item has been sent to the scheduler(s), but might not yet
168  /// be executing
169  eScheduled,
170 
171  /// The item is cooking
172  eCooking,
173 
174  /// The item has finished cooking and succeeded
176 
177  /// The item has was marked as successfully cooked because it a cached
178  /// file was found on disk
179  eCookedCache,
180 
181  /// The item has finished cooking and failed
182  eCookedFail,
183 
184  /// The item has finished cooking by cancellation
186 
187  /// The item was dirty; it may have been cooked before, but not
188  /// necessarily. This is effectively the same as uncooked, but it
189  /// gives an indication that item may need additional cleanup or
190  /// repartitioning.
191  eDirty,
192 
193  /// The number of states
194  eStateCount,
195 };
196 
197 /// Enum of work item types
199 {
200  /// A static or dynamic work item that does real work, and has one
201  /// upstream parent
202  eRegular,
203 
204  /// A batch item, which consists of one or more subitems that are
205  /// Regular type items
206  eBatch,
207 
208  /// A partition, which has a list of upstream components
209  ePartition,
210 };
211 
212 /// Enum of work item runtime types
214 {
215  /// A regular work item, with normal running time
216  eRegular,
217 
218  /// A long running work item that's process may outlive the cooking state
219  /// of the work item
220  eLongRunning,
221 
222  /// A work item that cleans up another long running item
223  eCleanup
224 };
225 
226 /// Enumeration of work item cook types
228 {
229  /// The work item does its processing during the generation stage,
230  /// and doesn't "cook" in the traditional sense.
231  eGenerate,
232 
233  /// The work item cooks in process
234  eInProcess,
235 
236  /// The work item cooks out of process
238 
239  /// The work item cooks as a service
240  eService,
241 
242  /// Unspecified/automatic cook type
243  eAutomatic
244 };
245 
246 #endif /* __PDG_WORK_ITEM_TYPES_H__ */
exint PDG_WorkItemID
Type defs for unique work item IDs.
PDG_BatchActivation
The cache is clean.
Custom service defintion.
Order by a specific attribute value.
int64 exint
Definition: SYS_Types.h:125
The cache state is dirty because an output file is missing on disk.
UT_Optional< fpreal > PDG_OptionalFrame
Optional frame value, used when constructing work items and partitions.
The cache state is dirty because the work item has no files.
PDG_WorkItemEvalState
PDG_WorkItemSortOrder
A regular node – default value.
std::optional< T > UT_Optional
Definition: UT_Optional.h:26
Explicitly chosen no sorting.
unsigned char uint8
Definition: SYS_Types.h:36
Unspecified/automatic cook type.
PDG_WorkItemType
Enum of work item types.
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
PDG_WorkItemState
Enum of possible work item states.
The work item is blocked on a dependency.
The work item cooks out of process.
PDG_WorkItemCookType
Enumeration of work item cook types.
The work item cooks in process.
The batch is scheduled once any of the subitems are ready to cook.
Order by the work item's frame value.
PDG_WorkItemLogType
Enumeration of work item log message types.
PDG_WorkItemCacheState
UT_SharedPtr< PDG_WorkItemData > PDG_WorkItemDataPtr
Type def for registered type objects.
The item has finished cooking by cancellation.
The cache is clean, assuming the parent task is also clean.
The batch is scheduled once the first sub item is ready to cook.
std::pair< PDG_WorkItem *, PDG_WorkItem * > PDG_WorkItemPair
Pair and array of work item pairs.
The work item has a failed dependency.
PDG_WorkItemExecutionType
Enum of work item runtime types.
A work item that cleans up another long running item.
The work item is ready to cook.
The node is waiting on upstream nodes to make progress.
The number of states.
The node is actively cooking work items.
The item has finished cooking and succeeded.
A partition, which has a list of upstream components.
The item has finished cooking and failed.