HLIBpro  2.6
TProcSet Class Reference

describes a processor set of continuously numbered processors

#include <TProcSet.hh>

Public Member Functions

 TProcSet (const uint ps_size=0) noexcept
 constructs set of size ps_size
 
 TProcSet (const uint ps_first, const uint ps_last) noexcept
 constructs set from ps_first to ps_last
 
 TProcSet (const TProcSet &ps) noexcept
 copy constructor
 
uint first () const noexcept
 return ID of first processor in set
 
uint last () const noexcept
 return ID of last processor in set
 
TProcSet subset (const uint i, const uint n=2) const noexcept
 return i´th subset in an n-partition of the local set More...
 
void split (const uint n, std::vector< TProcSet > &psets) const
 split processor set in n subsets (of approx. equal size) More...
 
TProcSet join (const TProcSet &ps) const noexcept
 return union with given procsessor set More...
 
bool is_in (const uint p) const noexcept
 return true if given proc is in set
 
uint size () const noexcept
 return size of set
 
bool empty () const noexcept
 return true if processor set is empty
 
uint master () const noexcept
 return id of master processor
 
TProcSetoperator= (const TProcSet &ps) noexcept
 copy operator
 
bool operator== (const TProcSet &ps) const noexcept
 equality operators
 
bool operator!= (const TProcSet &ps) const noexcept
 inequality operators
 
size_t byte_size () const noexcept
 return size in bytes used by this object
 
std::string to_string () const
 return string representation
 
void read (TByteStream &s)
 read data from stream
 
void write (TByteStream &s) const
 write data to stream
 
size_t bs_size () const
 returns size of object in bytestream
 

Member Function Documentation

◆ join()

TProcSet join ( const TProcSet ps) const
inlinenoexcept

Construct a processor set defined by minimum of first processor and maximum of last processor in both sets

◆ split()

void split ( const uint  n,
std::vector< TProcSet > &  psets 
) const
inline

Split local processor set into n subsets of approximately the same size and return the partition in psets

Parameters
nnumber of subsets to generate
psetsarray to store the subsets

◆ subset()

TProcSet subset ( const uint  i,
const uint  n = 2 
) const
inlinenoexcept

Split local processor set into n subsets and return i'th subset.

Parameters
isubset to return
nnumber of subsets to split into