#include <UT_ThreadedAlgorithm.h>
Defines the work required for each invocation of *Partial to complete.
- Examples:
- SIM/SIM_GasAdd.C, and SIM/SIM_GasAdd.h.
Definition at line 92 of file UT_ThreadedAlgorithm.h.
void UT_JobInfo::divideWork |
( |
int |
units, |
|
|
int & |
start, |
|
|
int & |
end |
|
) |
| const |
Given "units" work, report which units you are responsible for with this JobInfo. The resulting interval is [start, end), Appropriate for loop: for (info.divideWork(total, i, end); i < end; i++)
int UT_JobInfo::job |
( |
| ) |
const |
|
inline |
void UT_JobInfo::lock |
( |
| ) |
const |
|
inline |
lock and unlock a lock shared by all the jobs. This lock is special cased to a no-op in the threadless case to avoid overhead.
Definition at line 136 of file UT_ThreadedAlgorithm.h.
int32 UT_JobInfo::nextTask |
( |
| ) |
const |
These control a shared AtomicInt32 so you can split tasks among jobs using load balancing. The total number is in this case up to you to detect. The JobIds will start with 0 and each call will get a unique higher number. Example: for (i = info.nextTask(); i < maxtask; i = info.nextTask())
int UT_JobInfo::numJobs |
( |
| ) |
const |
|
inline |
void UT_JobInfo::resetTasks |
( |
| ) |
const |
Resets the task list. You are responsible for creating a barrier to ensure that all the other threads have hit the end of the tasks! This is not required for your first loop as you will already start at task 0.
void UT_JobInfo::unlock |
( |
| ) |
const |
|
inline |
int UT_JobInfo::myLocalTask |
|
mutableprotected |
int UT_JobInfo::myNumJobs |
|
protected |
The documentation for this class was generated from the following file: