Grappa  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Synchronization

Classes

class  Grappa::CompletionEvent
 Synchronization primitive useful for waking a worker after a number of other things complete. More...
 
class  Grappa::ConditionVariable
 
class  Grappa::CountingSemaphore
 Counting semaphore. Maximum count is 2^15 - 1. More...
 
class  Grappa::FullEmpty< T >
 Wrapper class to provide full-bit semantics for arbitrary data. More...
 
class  Grappa::GlobalCompletionEvent
 GlobalCompletionEvent (GCE): Synchronization construct for determining when a global phase of asynchronous tasks have all completed. More...
 

Functions

void Grappa::barrier ()
 Blocking SPMD barrier (must be called once on all cores to continue) More...
 
template<typename CompletionType >
void Grappa::complete (CompletionType *ce)
 Match ConditionVariable-style function call. More...
 
void Grappa::complete (GlobalAddress< CompletionEvent > ce, int64_t decr=1)
 Overload to work on GlobalAddresses. More...
 
void Grappa::enroll (GlobalAddress< CompletionEvent > ce, int64_t incr=1)
 
template<TaskMode B = TaskMode::Bound, typename TF = decltype(nullptr)>
void Grappa::spawn (CompletionEvent *ce, TF tf)
 Spawn Grappa::privateTask and implicitly synchronize with the given CompletionEvent (or GlobalCompletionEvent, though if using GlobalCompletionEvent, it may be better to use the verison that takes the GCE pointer as a template parameter only). More...
 
void Grappa::wait (GlobalAddress< ConditionVariable > m)
 Proxy for remote ConditionVariable manipulation. More...
 
template<typename ConditionVariable >
void Grappa::signal (const GlobalAddress< ConditionVariable > m)
 
void Grappa::signal_all (GlobalAddress< ConditionVariable > m)
 TODO: implement. More...
 
template<typename ConditionVariable >
void Grappa::add_waiter (ConditionVariable *cv, Worker *w)
 Verify that ConditionVariable is only one word. More...
 
template<typename ConditionVariable >
void Grappa::wait (ConditionVariable *cv)
 
template<typename ConditionVariable >
void Grappa::signal (ConditionVariable *cv)
 Wake one waiter on a condition variable. More...
 
template<typename ConditionVariable >
void Grappa::broadcast (ConditionVariable *cv)
 Wake all waiters on a condition variable. More...
 
template<typename T >
void Grappa::fill_remote (GlobalAddress< FullEmpty< T >> result_addr, const T &val)
 
template<typename T >
Grappa::readFF (GlobalAddress< FullEmpty< T >> fe_addr)
 Remote version of readFF method. Suspend until FullEmpty is full, and then return its contents, leaving it full. More...
 
template<typename T , typename U >
void Grappa::writeXF (GlobalAddress< FullEmpty< T >> fe_addr, const U &val)
 Remote, blocking version of writeXF method. Writes data to FullEmpty no matter what its current state, leaving it full. Existing contents are overwritten. More...
 
template<typename T >
Grappa::writeXF (FullEmpty< T > *fe_addr, T t)
 Non-member version of writeXF method. More...
 
template<typename T >
Grappa::writeEF (FullEmpty< T > *fe_addr, T t)
 Non-member version of writeEF method. More...
 
template<typename T >
Grappa::writeFF (FullEmpty< T > *fe_addr, T t)
 Non-member version of writeFF method. More...
 
template<typename T >
Grappa::readXX (FullEmpty< T > *fe_addr)
 Non-member version of readXX method. More...
 
template<typename T >
Grappa::readFF (FullEmpty< T > *fe_addr)
 Non-member version of readFF method. More...
 
template<typename T >
Grappa::readFE (FullEmpty< T > *fe_addr)
 Non-member version of readFE method. More...
 
void Grappa::enroll (GlobalAddress< GlobalCompletionEvent > ce, int64_t decr=1)
 
void Grappa::complete (GlobalAddress< GlobalCompletionEvent > ce, int64_t decr=1)
 Allow calling send_completion using the old way (with global address) TODO: replace all instances with gce.send_completion and remove this? More...
 
template<typename Semaphore >
void Grappa::increment (Semaphore *s, int64_t incr=1)
 
template<typename Semaphore >
void Grappa::decrement (Semaphore *s, int64_t decr=1)
 
template<typename Semaphore >
bool Grappa::try_decrement (Semaphore *s, int64_t decr=1)
 
template<typename Semaphore >
int64_t Grappa::get_value (Semaphore *s)
 
void Grappa::CompletionEvent::send_completion (Core origin, int64_t decr=1)
 

Detailed Description

Function Documentation

template<typename ConditionVariable >
void Grappa::add_waiter ( ConditionVariable *  cv,
Worker *  w 
)
inline

Verify that ConditionVariable is only one word.

Wait on a condition variable (no mutex).

Definition at line 88 of file ConditionVariableLocal.hpp.

void Grappa::barrier ( )
inline

Blocking SPMD barrier (must be called once on all cores to continue)

Definition at line 35 of file Barrier.hpp.

template<typename ConditionVariable >
void Grappa::broadcast ( ConditionVariable *  cv)
inline

Wake all waiters on a condition variable.

Definition at line 117 of file ConditionVariableLocal.hpp.

template<typename CompletionType >
void Grappa::complete ( CompletionType *  ce)
inline

Match ConditionVariable-style function call.

Definition at line 95 of file CompletionEvent.hpp.

void Grappa::complete ( GlobalAddress< CompletionEvent >  ce,
int64_t  decr = 1 
)
inline

Overload to work on GlobalAddresses.

Definition at line 106 of file CompletionEvent.hpp.

void Grappa::complete ( GlobalAddress< GlobalCompletionEvent >  ce,
int64_t  decr = 1 
)
inline

Allow calling send_completion using the old way (with global address) TODO: replace all instances with gce.send_completion and remove this?

Definition at line 302 of file GlobalCompletionEvent.hpp.

template<typename Semaphore >
void Grappa::decrement ( Semaphore *  s,
int64_t  decr = 1 
)
inline

Definition at line 41 of file Semaphore.hpp.

void Grappa::enroll ( GlobalAddress< CompletionEvent >  ce,
int64_t  incr = 1 
)
inline

Definition at line 133 of file CompletionEvent.hpp.

void Grappa::enroll ( GlobalAddress< GlobalCompletionEvent >  ce,
int64_t  decr = 1 
)
inline

Definition at line 295 of file GlobalCompletionEvent.hpp.

template<typename T >
void Grappa::fill_remote ( GlobalAddress< FullEmpty< T >>  result_addr,
const T &  val 
)

Definition at line 36 of file FullEmpty.hpp.

template<typename Semaphore >
int64_t Grappa::get_value ( Semaphore *  s)
inline

Definition at line 51 of file Semaphore.hpp.

template<typename Semaphore >
void Grappa::increment ( Semaphore *  s,
int64_t  incr = 1 
)
inline

Definition at line 36 of file Semaphore.hpp.

template<typename T >
T Grappa::readFE ( FullEmpty< T > *  fe_addr)

Non-member version of readFE method.

See also
FullEmpty::readFE

Definition at line 179 of file FullEmptyLocal.hpp.

template<typename T >
T Grappa::readFF ( GlobalAddress< FullEmpty< T >>  fe_addr)

Remote version of readFF method. Suspend until FullEmpty is full, and then return its contents, leaving it full.

See also
FullEmpty::readFF

Definition at line 44 of file FullEmpty.hpp.

template<typename T >
T Grappa::readFF ( FullEmpty< T > *  fe_addr)

Non-member version of readFF method.

See also
FullEmpty::readFE

Definition at line 173 of file FullEmptyLocal.hpp.

template<typename T >
T Grappa::readXX ( FullEmpty< T > *  fe_addr)

Non-member version of readXX method.

See also
FullEmpty::readXX

Definition at line 167 of file FullEmptyLocal.hpp.

void Grappa::CompletionEvent::send_completion ( Core  origin,
int64_t  decr = 1 
)
inline

Definition at line 125 of file CompletionEvent.hpp.

template<typename ConditionVariable >
void Grappa::signal ( const GlobalAddress< ConditionVariable >  m)
inline

Definition at line 45 of file ConditionVariable.hpp.

template<typename ConditionVariable >
void Grappa::signal ( ConditionVariable *  cv)
inline

Wake one waiter on a condition variable.

Definition at line 102 of file ConditionVariableLocal.hpp.

void Grappa::signal_all ( GlobalAddress< ConditionVariable >  m)
inline

TODO: implement.

Definition at line 58 of file ConditionVariable.hpp.

template<TaskMode B = TaskMode::Bound, typename TF = decltype(nullptr)>
void Grappa::spawn ( CompletionEvent *  ce,
TF  tf 
)

Spawn Grappa::privateTask and implicitly synchronize with the given CompletionEvent (or GlobalCompletionEvent, though if using GlobalCompletionEvent, it may be better to use the verison that takes the GCE pointer as a template parameter only).

Definition at line 141 of file CompletionEvent.hpp.

template<typename Semaphore >
bool Grappa::try_decrement ( Semaphore *  s,
int64_t  decr = 1 
)
inline

Definition at line 46 of file Semaphore.hpp.

void Grappa::wait ( GlobalAddress< ConditionVariable >  m)
inline

Proxy for remote ConditionVariable manipulation.

Todo:
: implement

Definition at line 39 of file ConditionVariable.hpp.

template<typename ConditionVariable >
void Grappa::wait ( ConditionVariable *  cv)
inline

Definition at line 94 of file ConditionVariableLocal.hpp.

template<typename T >
T Grappa::writeEF ( FullEmpty< T > *  fe_addr,
t 
)

Non-member version of writeEF method.

See also
FullEmpty::writeEF

Definition at line 155 of file FullEmptyLocal.hpp.

template<typename T >
T Grappa::writeFF ( FullEmpty< T > *  fe_addr,
t 
)

Non-member version of writeFF method.

See also
FullEmpty::writeFF

Definition at line 161 of file FullEmptyLocal.hpp.

template<typename T , typename U >
void Grappa::writeXF ( GlobalAddress< FullEmpty< T >>  fe_addr,
const U &  val 
)

Remote, blocking version of writeXF method. Writes data to FullEmpty no matter what its current state, leaving it full. Existing contents are overwritten.

See also
FullEmpty::writeXF

Definition at line 75 of file FullEmpty.hpp.

template<typename T >
T Grappa::writeXF ( FullEmpty< T > *  fe_addr,
t 
)

Non-member version of writeXF method.

See also
FullEmpty::writeXF

Definition at line 149 of file FullEmptyLocal.hpp.