|
IFEM
90A354
|
Class containing threading group partitioning. More...
#include <ThreadGroups.h>

Public Types | |
| enum | StripDirection { NONE , U , V , W , ANY } |
| Directions to consider for element stripes. | |
Public Member Functions | |
| ThreadGroups (StripDirection dir=ANY) | |
| Default constructor. | |
| void | calcGroups (const BoolVec &el1, const BoolVec &el2, int p1, int p2) |
| Calculates a 2D thread group partitioning based on stripes. More... | |
| void | calcGroups (int nel1, int nel2, int minsize) |
| Calculates a 2D thread group partitioning based on stripes. More... | |
| void | calcGroups (const BoolVec &el1, const BoolVec &el2, const BoolVec &el3, int p1, int p2, int p3) |
| Calculates a 3D thread group partitioning based on stripes. More... | |
| void | calcGroups (int nel1, int nel2, int nel3, int minsize) |
| Calculates a 3D thread group partitioning based on stripes. More... | |
| void | oneGroup (size_t nel) |
| Initializes the threading groups in case of no multi-threading. More... | |
| void | oneGroup (size_t nel, const IntVec &elms) |
| Initializes the threading groups for threadsafe integrands. More... | |
| void | oneStripe (size_t nel) |
| Initializes the threading groups in case of a single stripe. More... | |
| void | oneStripe (size_t nel, const IntVec &elms) |
| Initializes the threading groups in case of a single stripe. More... | |
| void | applyMap (const IntVec &map) |
| Maps a partitioning through a map. More... | |
| size_t | size () const |
| Returns the number of groups. | |
| bool | empty () const |
| Return true if both groups are empty. | |
| const IntMat & | operator[] (int i) const |
| Indexing operator. | |
| IntMat & | operator[] (int i) |
| Indexing operator. | |
| ThreadGroups | filter (const IntVec &elmList) const |
| Filters current threading groups through a white-list of elements. | |
| void | analyzeUnstruct (bool listAllSizes=false) const |
| Analyze and print thread group statistics for unstructured ASMs. | |
Public Attributes | |
| StripDirection | stripDir |
| Actual direction to split elements. | |
Static Protected Member Functions | |
| static StripDirection | getStripDirection (int nel1, int nel2, int parts) |
| Calculates the parameter direction of the treading stripes in 2D. | |
| static StripDirection | getStripDirection (int nel1, int nel2, int nel3, int parts) |
| Calculates the parameter direction of the treading stripes in 3D. | |
Private Types | |
| typedef std::vector< bool > | BoolVec |
| List of boolean flags. | |
| typedef std::vector< int > | IntVec |
| List of elements on one thread. | |
| typedef std::vector< IntVec > | IntMat |
| Element lists for all threads. | |
Private Attributes | |
| IntMat | tg [2] |
| Threading groups (always two, but the second may be empty) | |
Class containing threading group partitioning.
| void ThreadGroups::applyMap | ( | const IntVec & | map | ) |
Maps a partitioning through a map.
The original entry n in the group is mapped onto map[n].
References tg.
Referenced by ASMs3DLag::generateThreadGroups(), and ASMs3D::generateThreadGroups().
| void ThreadGroups::calcGroups | ( | const BoolVec & | el1, |
| const BoolVec & | el2, | ||
| const BoolVec & | el3, | ||
| int | p1, | ||
| int | p2, | ||
| int | p3 | ||
| ) |
Calculates a 3D thread group partitioning based on stripes.
| [in] | el1 | Flags non-zero knot spans in first parameter direction |
| [in] | el2 | Flags non-zero knot spans in second parameter direction |
| [in] | el3 | Flags non-zero knot spans in third parameter direction |
| [in] | p1 | Polynomial degree in first parameter direction |
| [in] | p2 | Polynomial degree in second parameter direction |
| [in] | p3 | Polynomial degree in third parameter direction |
References getStripDirection(), oneGroup(), stripDir, and tg.
Calculates a 2D thread group partitioning based on stripes.
| [in] | el1 | Flags non-zero knot spans in first parameter direction |
| [in] | el2 | Flags non-zero knot spans in second parameter direction |
| [in] | p1 | Polynomial degree in first parameter direction |
| [in] | p2 | Polynomial degree in second parameter direction |
References getStripDirection(), oneGroup(), stripDir, and tg.
Referenced by ASMs2DLag::generateThreadGroups(), ASMs2DTri::generateThreadGroups(), ASMs3DLag::generateThreadGroups(), ASMs2D::generateThreadGroups(), and ASMs3D::generateThreadGroups().
| void ThreadGroups::calcGroups | ( | int | nel1, |
| int | nel2, | ||
| int | minsize | ||
| ) |
Calculates a 2D thread group partitioning based on stripes.
| [in] | nel1 | Number of elements in the first direction |
| [in] | nel2 | Number of elements in the second direction |
| [in] | minsize | Minimum element strip size |
References getStripDirection(), oneGroup(), stripDir, and tg.
| void ThreadGroups::calcGroups | ( | int | nel1, |
| int | nel2, | ||
| int | nel3, | ||
| int | minsize | ||
| ) |
Calculates a 3D thread group partitioning based on stripes.
| [in] | nel1 | Number of elements in the first direction |
| [in] | nel2 | Number of elements in the second direction |
| [in] | nel3 | Number of elements in the third direction |
| [in] | minsize | Minimum element strip size |
References getStripDirection(), oneGroup(), stripDir, and tg.
| void ThreadGroups::oneGroup | ( | size_t | nel | ) |
Initializes the threading groups in case of no multi-threading.
| [in] | nel | Total number of elements |
References tg.
Referenced by calcGroups(), ASMu2DLag::generateThreadGroups(), ASMs2DLag::generateThreadGroups(), ASMs2DTri::generateThreadGroups(), ASMs3DLag::generateThreadGroups(), ASMs2D::generateThreadGroups(), ASMs2Dmx::generateThreadGroups(), ASMs3D::generateThreadGroups(), ASMs3Dmx::generateThreadGroups(), ASMu2D::integrate(), ASMu2Dmx::integrate(), ASMu3D::integrate(), ASMu3Dmx::integrate(), and oneGroup().
| void ThreadGroups::oneGroup | ( | size_t | nel, |
| const IntVec & | elms | ||
| ) |
Initializes the threading groups for threadsafe integrands.
| [in] | nel | Number of elements |
| [in] | elms | Elements to include in stripe |
References oneGroup(), and tg.
| void ThreadGroups::oneStripe | ( | size_t | nel | ) |
Initializes the threading groups in case of a single stripe.
| [in] | nel | Total number of elements |
References tg.
Referenced by ASMs2D::integrate(), ASMs2DLag::integrate(), ASMs2Dmx::integrate(), ASMs3D::integrate(), ASMs3DLag::integrate(), ASMs3Dmx::integrate(), ASMu2DLag::integrate(), and oneStripe().
| void ThreadGroups::oneStripe | ( | size_t | nel, |
| const IntVec & | elms | ||
| ) |
Initializes the threading groups in case of a single stripe.
| [in] | nel | Number of elements |
| [in] | elms | Elements to include in stripe |
References oneStripe(), and tg.