14 #ifndef _THREAD_GROUPS_H
15 #define _THREAD_GROUPS_H
49 void calcGroups(
int nel1,
int nel2,
int minsize);
59 int p1,
int p2,
int p3);
65 void calcGroups(
int nel1,
int nel2,
int nel3,
int minsize);
86 size_t size()
const {
return tg[1].empty() ? 1 : 2; }
88 bool empty()
const {
return tg[0].empty() &&
tg[1].empty(); }
std::vector< int > IntVec
General integer vector.
Definition: ASMbase.h:25
Class containing threading group partitioning.
Definition: ThreadGroups.h:26
bool empty() const
Return true if both groups are empty.
Definition: ThreadGroups.h:88
void calcGroups(const BoolVec &el1, const BoolVec &el2, int p1, int p2)
Calculates a 2D thread group partitioning based on stripes.
Definition: ThreadGroups.C:88
IntMat & operator[](int i)
Indexing operator.
Definition: ThreadGroups.h:92
StripDirection stripDir
Actual direction to split elements.
Definition: ThreadGroups.h:109
const IntMat & operator[](int i) const
Indexing operator.
Definition: ThreadGroups.h:90
void applyMap(const IntVec &map)
Maps a partitioning through a map.
Definition: ThreadGroups.C:481
StripDirection
Directions to consider for element stripes.
Definition: ThreadGroups.h:33
std::vector< bool > BoolVec
List of boolean flags.
Definition: ThreadGroups.h:27
void oneGroup(size_t nel)
Initializes the threading groups in case of no multi-threading.
Definition: ThreadGroups.C:45
void analyzeUnstruct(bool listAllSizes=false) const
Analyze and print thread group statistics for unstructured ASMs.
Definition: ThreadGroups.C:507
void oneStripe(size_t nel)
Initializes the threading groups in case of a single stripe.
Definition: ThreadGroups.C:65
size_t size() const
Returns the number of groups.
Definition: ThreadGroups.h:86
IntMat tg[2]
Threading groups (always two, but the second may be empty)
Definition: ThreadGroups.h:112
ThreadGroups filter(const IntVec &elmList) const
Filters current threading groups through a white-list of elements.
Definition: ThreadGroups.C:490
std::vector< int > IntVec
List of elements on one thread.
Definition: ThreadGroups.h:28
ThreadGroups(StripDirection dir=ANY)
Default constructor.
Definition: ThreadGroups.h:36
static StripDirection getStripDirection(int nel1, int nel2, int parts)
Calculates the parameter direction of the treading stripes in 2D.
Definition: ThreadGroups.C:426
std::vector< IntVec > IntMat
Element lists for all threads.
Definition: ThreadGroups.h:29