Galois
|
Contains threading and machine OS support. More...
Classes | |
class | Barrier |
struct | CacheLineStorage |
struct | ThreadTopoInfo |
struct | MachineTopoInfo |
struct | HWTopoInfo |
class | PaddedLock |
PaddedLock is a spinlock. More... | |
class | PaddedLock< true > |
class | PaddedLock< false > |
class | PerBackend |
class | PerThreadStorage |
class | PerSocketStorage |
class | PtrLock |
PtrLock is a spinlock and a pointer. More... | |
class | DummyPtrLock |
class | SharedMem |
class | SimpleLock |
SimpleLock is a spinlock. More... | |
class | DummyLock |
Dummy Lock implements the lock interface without a lock for serial code. More... | |
struct | StaticInstance |
class | TerminationDetection |
class | ThreadPool |
class | ThreadRWlock |
Typedefs | |
typedef std::unique_ptr< void, internal::largeFreer > | LAptr |
template<bool Enabled> | |
using | CondLock = typename std::conditional< Enabled, SimpleLock, DummyLock >::type |
using | lock_guard_galois = std::lock_guard< SimpleLock > |
Functions | |
void | initPTS (unsigned) |
Barrier & | getBarrier (unsigned activeThreads) |
Return a reference to system barrier. More... | |
std::unique_ptr< Barrier > | createPthreadBarrier (unsigned) |
Create specific types of barriers. More... | |
std::unique_ptr< Barrier > | createMCSBarrier (unsigned) |
std::unique_ptr< Barrier > | createTopoBarrier (unsigned) |
std::unique_ptr< Barrier > | createCountingBarrier (unsigned) |
std::unique_ptr< Barrier > | createDisseminationBarrier (unsigned) |
std::unique_ptr< Barrier > | createSimpleBarrier (unsigned int) |
Creates a new simple barrier. More... | |
bool | EnvCheck (const char *varName) |
Return true if the Enviroment variable is set. More... | |
bool | EnvCheck (const std::string &varName) |
template<typename T > | |
bool | EnvCheck (const char *varName, T &retVal) |
Return true if Enviroment variable is set, and extract its value into 'retVal' parameter. More... | |
template<typename T > | |
bool | EnvCheck (const std::string &varName, T &retVal) |
HWTopoInfo | getHWTopo () |
getHWTopo determines the machine topology from the process information exposed in /proc and /dev filesystems. More... | |
std::vector< int > | parseCPUList (const std::string &in) |
parseCPUList parses cpuset information in "List format" as described in cpuset(7) and available under /proc/self/status More... | |
bool | bindThreadSelf (unsigned osContext) |
bindThreadSelf binds a thread to an osContext as returned by getHWTopo. More... | |
LAptr | largeMallocLocal (size_t bytes) |
LAptr | largeMallocFloating (size_t bytes) |
LAptr | largeMallocInterleaved (size_t bytes, unsigned numThreads) |
LAptr | largeMallocBlocked (size_t bytes, unsigned numThreads) |
template<typename RangeArrayTy > | |
LAptr | largeMallocSpecified (size_t bytes, uint32_t numThreads, RangeArrayTy &threadRanges, size_t elementSize) |
Allocates pages for some specified number of bytes, then does NUMA page faulting based on a specified distribution of elements among threads. More... | |
size_t | allocSize () |
void * | allocPages (unsigned num, bool preFault) |
void | freePages (void *ptr, unsigned num) |
PerBackend & | getPTSBackend () |
PerBackend & | getPPSBackend () |
TerminationDetection & | getSystemTermination (unsigned activeThreads) |
ThreadPool & | getThreadPool (void) |
return a reference to system thread pool More... | |
template<typename L , typename R , typename W > | |
void | readUpdateProtected (L &rwmutex, R &readAndCheck, W &write) |
readOrUpdate is a generic function to perform reads or writes using a rwmutex More... | |
Variables | |
constexpr int | GALOIS_CACHE_LINE_SIZE = 128 |
thread_local char * | ptsBase |
thread_local char * | pssBase |
Contains threading and machine OS support.
using galois::substrate::CondLock = typedef typename std::conditional<Enabled, SimpleLock, DummyLock>::type |
typedef std::unique_ptr<void, internal::largeFreer> galois::substrate::LAptr |
using galois::substrate::lock_guard_galois = typedef std::lock_guard<SimpleLock> |
void * galois::substrate::allocPages | ( | unsigned | num, |
bool | preFault | ||
) |
size_t galois::substrate::allocSize | ( | ) |
bool galois::substrate::bindThreadSelf | ( | unsigned | osContext | ) |
bindThreadSelf binds a thread to an osContext as returned by getHWTopo.
binds current thread to OS HW context "proc"
std::unique_ptr< galois::substrate::Barrier > galois::substrate::createCountingBarrier | ( | unsigned | activeThreads | ) |
std::unique_ptr< galois::substrate::Barrier > galois::substrate::createDisseminationBarrier | ( | unsigned | activeThreads | ) |
std::unique_ptr< galois::substrate::Barrier > galois::substrate::createMCSBarrier | ( | unsigned | activeThreads | ) |
std::unique_ptr< galois::substrate::Barrier > galois::substrate::createPthreadBarrier | ( | unsigned | ) |
Create specific types of barriers.
For benchmarking only. Use getBarrier() for all production code
std::unique_ptr< galois::substrate::Barrier > galois::substrate::createSimpleBarrier | ( | unsigned int | v | ) |
Creates a new simple barrier.
This barrier is not designed to be fast but does gaurantee that all threads have left the barrier before returning control. Useful when the number of active threads is modified to avoid a race in getBarrier(). Client is reponsible for deallocating returned barrier.
std::unique_ptr< galois::substrate::Barrier > galois::substrate::createTopoBarrier | ( | unsigned | activeThreads | ) |
bool galois::substrate::EnvCheck | ( | const char * | varName | ) |
Return true if the Enviroment variable is set.
bool galois::substrate::EnvCheck | ( | const std::string & | varName | ) |
bool galois::substrate::EnvCheck | ( | const char * | varName, |
T & | retVal | ||
) |
Return true if Enviroment variable is set, and extract its value into 'retVal' parameter.
varName,: | name of the variable |
retVal,: | lvalue to store the value of environment variable |
bool galois::substrate::EnvCheck | ( | const std::string & | varName, |
T & | retVal | ||
) |
void galois::substrate::freePages | ( | void * | ptr, |
unsigned | num | ||
) |
galois::substrate::Barrier & galois::substrate::getBarrier | ( | unsigned | activeThreads | ) |
Return a reference to system barrier.
galois::substrate::HWTopoInfo galois::substrate::getHWTopo | ( | ) |
getHWTopo determines the machine topology from the process information exposed in /proc and /dev filesystems.
galois::substrate::PerBackend & galois::substrate::getPPSBackend | ( | ) |
galois::substrate::PerBackend & galois::substrate::getPTSBackend | ( | ) |
galois::substrate::TerminationDetection & galois::substrate::getSystemTermination | ( | unsigned | activeThreads | ) |
galois::substrate::ThreadPool & galois::substrate::getThreadPool | ( | void | ) |
return a reference to system thread pool
void galois::substrate::initPTS | ( | unsigned | ) |
LAptr galois::substrate::largeMallocBlocked | ( | size_t | bytes, |
unsigned | numThreads | ||
) |
LAptr galois::substrate::largeMallocFloating | ( | size_t | bytes | ) |
LAptr galois::substrate::largeMallocInterleaved | ( | size_t | bytes, |
unsigned | numThreads | ||
) |
LAptr galois::substrate::largeMallocLocal | ( | size_t | bytes | ) |
LAptr galois::substrate::largeMallocSpecified | ( | size_t | bytes, |
uint32_t | numThreads, | ||
RangeArrayTy & | threadRanges, | ||
size_t | elementSize | ||
) |
Allocates pages for some specified number of bytes, then does NUMA page faulting based on a specified distribution of elements among threads.
RangeArrayTy | Type of threadRanges array: should either be uint32_t* or uint64_t* |
bytes | Number of bytes to allocate |
numThreads | Number of threads to page in regions for |
threadRanges | Array specifying distribution of elements among threads |
elementSize | Size of a data element that will be stored in the allocated memory |
std::vector< int > galois::substrate::parseCPUList | ( | const std::string & | in | ) |
parseCPUList parses cpuset information in "List format" as described in cpuset(7) and available under /proc/self/status
void galois::substrate::readUpdateProtected | ( | L & | rwmutex, |
R & | readAndCheck, | ||
W & | write | ||
) |
readOrUpdate is a generic function to perform reads or writes using a rwmutex
rwmutex | is a read/write lock that implements readLock/readUnlock, writeLoack/writeUnlock |
readAndCheck | is function object to execute when reading. It returns true only if read was successful. Should update state to store read result. Shouldn't use rwmutex internally |
write | is function object to perform the write. It should update state to store result after writing. Shouldn't use rwmutex internally |
constexpr int galois::substrate::GALOIS_CACHE_LINE_SIZE = 128 |
thread_local char * galois::substrate::pssBase |
thread_local char * galois::substrate::ptsBase |