Grappa  r3821, hash 22cd626d567a91ead5b23302066d1e9469f45c66
Grappa Namespace Reference

this core's base pointer More...

Namespaces

 delegate
 
 Metrics
 
 SharedMessagePool
 
 util
 

Classes

struct  AdjIterator
 
class  BasicScheduler
 A basic Worker Scheduler with just a readyQ and periodicQ. More...
 
class  CallbackMetric
 Metric that uses a callback to determine the value at sample time. More...
 
class  CompletionEvent
 Synchronization primitive useful for waking a worker after a number of other things complete. More...
 
struct  CompletionTarget
 Type returned by enroll used to indicate where to send a completion. More...
 
class  ConditionVariable
 
class  CountingSemaphore
 Counting semaphore. Maximum count is 2^15 - 1. More...
 
struct  Empty
 Empty struct, for specifying lack of either Vertex or Edge data in Graph. More...
 
class  ExternalCountPayloadMessage
 For Payload messages that need to set an existing flag when message created and unset when message sent. More...
 
struct  File
 Grappa file descriptor. More...
 
class  FlatCombiner
 
class  FullEmpty
 Wrapper class to provide full-bit semantics for arbitrary data. More...
 
class  GlobalBag
 Global unordered queue with local insert and iteration. More...
 
class  GlobalCompletionEvent
 GlobalCompletionEvent (GCE): Synchronization construct for determining when a global phase of asynchronous tasks have all completed. More...
 
class  GlobalCounter
 
class  GlobalHashMap
 
class  GlobalHashSet
 
class  GlobalVector
 
struct  Graph
 Distributed graph data structure, with customizable vertex and edge data. More...
 
class  HistogramMetric
 
struct  IODescriptor
 Basically a wrapper around a POSIX "struct aiocb" with info for resuming the calling Grappa thread. More...
 
class  MaxMetric
 Metric that simply keeps track of a single value over time. More...
 
class  Message
 A standard message. More...
 
class  MessagePool
 
class  MessagePoolStatic
 
class  Mutex
 
class  PayloadMessage
 A message with dynamic payload. More...
 
class  PoolAllocator
 
class  PoolAllocatorInternal
 
class  PrefetchingThreadQueue
 
class  ReuseMessage
 message to be used in message pools. adds itself to a list after being sent More...
 
class  ReuseMessageList
 Reuse list of messages. More...
 
class  Scheduler
 
class  SimpleMetric
 Metric that simply keeps track of a single value over time.
 
class  StringMetric
 Metric that simply keeps track of a single string value over time. More...
 
class  SummarizingMetric
 
class  SuspendedDelegate
 
class  SuspendedDelegateQueue
 
class  ThreadQueue
 A queue of threads. More...
 
class  TupleGraph
 
class  Worker
 Worker/coroutine. More...
 

Typedefs

using VertexID = int64_t
 Currently just an overload for int64, may someday be used for distinguishing parameters in forall(). More...
 
using MetricList = std::vector< impl::MetricBase * >
 
typedef Core Core
 
typedef int64_t Timestamp
 Timestamps are 64-bit signed integers. More...
 

Enumerations

enum  TaskMode { TaskMode::Bound, TaskMode::Unbound }
 Specify whether tasks are bound to the core they're spawned on, or if they can be load-balanced (via work-stealing). More...
 
enum  SyncMode { SyncMode::Blocking, SyncMode::Async }
 Specify whether an operation blocks until complete, or returns "immediately". More...
 
enum  FCStatus { FCStatus::SATISFIED, FCStatus::BLOCKED, FCStatus::MATCHED }
 Mixin for adding common global data structure functionality, such as mirrored allocation on all cores. More...
 

Functions

template<typename T , typename S >
void memset (GlobalAddress< T > base, S value, size_t count)
 Initialize an array of elements of generic type with a given value. More...
 
template<typename T , typename S >
void memset (T *base, S value, size_t count)
 Type-based memset for local arrays to match what is provided for distributed arrays. More...
 
template<typename T >
void memcpy (GlobalAddress< T > dst, GlobalAddress< T > src, size_t nelem)
 Memcpy over Grappa global arrays. More...
 
template<typename T >
void memcpy (T *dst, T *src, size_t nelem)
 Helper so we don't have to change the code if we change a Global pointer to a normal pointer (in theory). More...
 
template<>
void memcpy< void > (void *dst, void *src, size_t nelem)
 
template<GlobalCompletionEvent * GCE = &impl::local_gce, typename T = void>
void memcpy_async (GlobalAddress< T > dst, GlobalAddress< T > src, size_t nelem)
 Asynchronous version of memcpy, spawns only on cores with array elements. More...
 
template<typename T >
void prefix_sum (GlobalAddress< T > array, size_t nelem)
 not implemented yet More...
 
void barrier ()
 Blocking SPMD barrier (must be called once on all cores to continue) More...
 
template<typename F >
void call_on_all_cores (F work)
 Call message (work that cannot block) on all cores, block until ack received from all. More...
 
template<typename F >
void on_all_cores (F work)
 Spawn a private task on each core, block until all complete. More...
 
template<typename T , T(*)(const T &, const T &) ReduceOp>
allreduce (T myval)
 Called from SPMD context, reduces values from all cores calling allreduce and returns reduced values to everyone. More...
 
template<typename T , T(*)(const T &, const T &) ReduceOp>
void allreduce_inplace (T *array, size_t nelem=1)
 Called from SPMD context. More...
 
template<typename T , T(*)(const T &, const T &) ReduceOp>
reduce (const T *global_ptr)
 Called from a single task (usually user_main), reduces values from all cores onto the calling node. More...
 
template<typename T , T(*)(const T &, const T &) ReduceOp>
reduce (GlobalAddress< T > localizable)
 Reduce over a symmetrically allocated object. More...
 
template<typename T , typename P , T(*)(const T &, const T &) ReduceOp, T(*)(GlobalAddress< P >) Accessor>
reduce (GlobalAddress< P > localizable)
 Reduce over a member of a symmetrically allocated object. More...
 
template<typename F = nullptr_t>
auto sum_all_cores (F func) -> decltype(func())
 Custom reduction from all cores. More...
 
double walltime (void)
 "Universal" wallclock time (works at least for Mac, and most Linux) More...
 
template<typename T >
const char * typename_of ()
 Get string containing name of type. More...
 
template<typename T >
const char * typename_of (const T &unused)
 Get string containing name of type. More...
 
const Core cores ()
 How many cores are there in this job? More...
 
const Core mycore ()
 What's my core ID in this job? More...
 
const Core locale_cores ()
 How many cores are in my shared memory domain? More...
 
const Core locale_mycore ()
 What's my core ID within my shared memory domain? More...
 
const Locale locales ()
 How many shared memory domains are in this job? More...
 
const Locale mylocale ()
 What's my shared memory domain ID within this job? More...
 
const Locale locale_of (Core c)
 What shared memory domain does core c belong to? More...
 
const char * hostname ()
 What name does MPI think this node has? More...
 
template<typename CompletionType >
void complete (CompletionType *ce)
 Match ConditionVariable-style function call. More...
 
void complete (GlobalAddress< CompletionEvent > ce, int64_t decr=1)
 Overload to work on GlobalAddresses. More...
 
void enroll (GlobalAddress< CompletionEvent > ce, int64_t incr=1)
 
template<TaskMode B = TaskMode::Bound, typename TF = decltype(nullptr)>
void 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 wait (GlobalAddress< ConditionVariable > m)
 Proxy for remote ConditionVariable manipulation. More...
 
template<typename ConditionVariable >
void signal (const GlobalAddress< ConditionVariable > m)
 
void signal_all (GlobalAddress< ConditionVariable > m)
 TODO: implement. More...
 
template<typename ConditionVariable >
void add_waiter (ConditionVariable *cv, Worker *w)
 Verify that ConditionVariable is only one word. More...
 
template<typename ConditionVariable >
void wait (ConditionVariable *cv)
 
template<typename ConditionVariable >
void signal (ConditionVariable *cv)
 Wake one waiter on a condition variable. More...
 
template<typename ConditionVariable >
void broadcast (ConditionVariable *cv)
 Wake all waiters on a condition variable. More...
 
template<TaskMode B = TaskMode::Bound, GlobalCompletionEvent * C = &impl::local_gce, typename F = decltype(nullptr)>
void spawnRemote (Core dest, F f)
 Synchronizing remote private task spawn. More...
 
template<typename T >
Grappa::ExternalCountPayloadMessage Grappa::PayloadMessage __attribute__ ((aligned(64)))
 
template<typename T >
ExternalCountPayloadMessage< T > * send_heap_message (Core dest, T t, void *payload, size_t payload_size, uint64_t *count)
 
template<typename T >
void read_array (File &f, GlobalAddress< T > array, size_t nelem)
 Read a file or directory of files into a global array. More...
 
template<typename T >
void save_array (File &f, bool asDirectory, GlobalAddress< T > array, size_t nelem)
 
template<typename T >
void write_array_unordered (std::string filename, GlobalAddress< T > array, size_t nelem)
 
template<typename T >
void read_array_unordered (std::string filename, GlobalAddress< T > array, size_t nelem)
 
template<typename T >
void fill_remote (GlobalAddress< FullEmpty< T >> result_addr, const T &val)
 
template<typename T >
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 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 >
writeXF (FullEmpty< T > *fe_addr, T t)
 Non-member version of writeXF method. More...
 
template<typename T >
writeEF (FullEmpty< T > *fe_addr, T t)
 Non-member version of writeEF method. More...
 
template<typename T >
writeFF (FullEmpty< T > *fe_addr, T t)
 Non-member version of writeFF method. More...
 
template<typename T >
readXX (FullEmpty< T > *fe_addr)
 Non-member version of readXX method. More...
 
template<typename T >
readFF (FullEmpty< T > *fe_addr)
 Non-member version of readFF method. More...
 
template<typename T >
readFE (FullEmpty< T > *fe_addr)
 Non-member version of readFE method. More...
 
template<typename T = int8_t>
GlobalAddress< T > global_alloc (size_t count)
 Allocate bytes from the global shared heap. More...
 
template<typename T >
void global_free (GlobalAddress< T > address)
 Free memory allocated from global shared heap. More...
 
template<typename T , Core MASTER_CORE = 0>
GlobalAddress< T > symmetric_global_alloc ()
 Allocate space for a T at the same localizable global address on all cores (must currently round up to a multiple of block_size plus an additional block to ensure there is a valid address range no matter which core allocation starts on). More...
 
template<SyncMode S = SyncMode::Blocking, GlobalCompletionEvent * C = &impl::local_gce, int64_t Th = impl::USE_LOOP_THRESHOLD_FLAG, typename F = nullptr_t, typename T >
void forall (GlobalAddress< GlobalBag< T >> b, F body)
 
CompletionTarget enroll (GlobalAddress< GlobalCompletionEvent > ce, int64_t decr=1)
 
void 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<TaskMode B, GlobalCompletionEvent * C, typename TF = decltype(nullptr)>
void spawn (TF tf)
 Synchronizing private task spawn. More...
 
template<GlobalCompletionEvent * C = &impl::local_gce, typename F = decltype(nullptr)>
void finish (F f)
 
template<SyncMode S = SyncMode::Blocking, GlobalCompletionEvent * C = &impl::local_gce, typename K = nullptr_t, typename V = nullptr_t, typename F = nullptr_t>
void insert (GlobalAddress< GlobalHashMap< K, V >> self, K key, F on_insert)
 
template<GlobalCompletionEvent * GCE = &impl::local_gce, int64_t Threshold = impl::USE_LOOP_THRESHOLD_FLAG, typename T = decltype(nullptr), typename V = decltype(nullptr), typename F = decltype(nullptr)>
void forall (GlobalAddress< GlobalHashMap< T, V >> self, F visit)
 
template<typename G >
AdjIterator< G > adj (GlobalAddress< G > g, typename G::Vertex &v)
 Iterator over adjacent vertices. Used with Grappa::forall(). More...
 
template<typename G >
AdjIterator< G > adj (GlobalAddress< G > g, GlobalAddress< typename G::Vertex > v)
 
template<typename G >
AdjIterator< G > adj (GlobalAddress< G > g, VertexID i)
 
 OVERLOAD (SyncMode S=SyncMode::Blocking, GlobalCompletionEvent *C=&impl::local_gce, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG)
 Parallel loop over adjacent vertices. Use adj() to construct iterator. More...
 
 OVERLOAD (GlobalCompletionEvent *C, SyncMode S=SyncMode::Blocking, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG)
 
template<typename G = nullptr_t, typename F = nullptr_t>
void serial_for (AdjIterator< G > a, F body)
 
template<GlobalCompletionEvent * C = &impl::local_gce, int64_t Threshold = impl::USE_LOOP_THRESHOLD_FLAG, typename V , typename E , typename F = nullptr_t>
void forall (GlobalAddress< Graph< V, E >> g, F loop_body)
 Parallel iterator over Graph, specializes based on arguments. More...
 
void local_load_bintsv4 (const char *filename, Grappa::TupleGraph::Edge *local_ptr, Grappa::TupleGraph::Edge *local_end)
 reading More...
 
void local_save_bintsv4 (const char *filename, Grappa::TupleGraph::Edge *local_ptr, Grappa::TupleGraph::Edge *local_end)
 helper function run on each core to save edges stored as int32_t tuples More...
 
void local_save_tsv (const char *filename, Grappa::TupleGraph::Edge *local_ptr, Grappa::TupleGraph::Edge *local_end)
 helper function run on each core to save edges stored as ASCII tab-delimited pairs More...
 
void global_heap_init (size_t init_size)
 
void init (int *argc_p, char **argv_p[], int64_t size=-1)
 Initialize Grappa. More...
 
int finalize ()
 Clean up Grappa. More...
 
template<typename T >
T * locale_alloc (size_t n=1)
 Allocate memory in locale shared heap. More...
 
template<typename T >
T * locale_alloc_aligned (size_t alignment, size_t n=1)
 
template<typename T , typename... Args>
T * locale_new (Args &&...args)
 allocate an object in the locale shared heap, passing arguments to its constructor More...
 
template<typename T >
T * locale_new ()
 allocate an object in the locale shared heap More...
 
template<typename T >
T * locale_new_array (size_t n=1)
 allocate an array in the locale shared heap More...
 
void locale_free (void *ptr)
 Free memory that was allocated from locale shared heap. More...
 
template<typename T >
Grappa::Message Grappa::impl::MessageBase __attribute__ ((aligned(64)))
 
template<typename T >
Grappa::PayloadMessage Grappa::impl::MessageBase __attribute__ ((aligned(64)))
 
template<typename T >
Message< T > message (Core dest, T t)
 Construct a message allocated on the stack. More...
 
template<typename T >
PayloadMessage< T > message (Core dest, T t, void *payload, size_t payload_size)
 Message with payload. More...
 
template<typename T >
Message< T > send_message (Core dest, T t)
 Same as message, but immediately enqueued to be sent. More...
 
template<typename T >
PayloadMessage< T > send_message (Core dest, T t, void *payload, size_t payload_size)
 Message with payload, immediately enqueued to be sent. More...
 
template<typename Mutex >
void lock (Mutex *t)
 Verify that Mutex is only one word. More...
 
template<typename Mutex >
bool trylock (Mutex *t)
 Try to lock a mutex. Note: wait scheme is unfairly LIFO. More...
 
template<typename Mutex >
bool is_unlocked (Mutex *t)
 
template<typename Mutex >
void unlock (Mutex *t)
 Unlock a mutex. Note: wait scheme is unfairly LIFO. More...
 
template<typename Mutex >
void lock (GlobalAddress< Mutex > m)
 TODO: implement. More...
 
template<typename Mutex >
void trylock (GlobalAddress< Mutex > m)
 TODO: implement. More...
 
template<typename Mutex >
void unlock (GlobalAddress< Mutex > m)
 TODO: implement. More...
 
GlobalCompletionEventdefault_gce ()
 
template<SyncMode S = SyncMode::Blocking, TaskMode B = TaskMode::Bound, GlobalCompletionEvent * GCE = nullptr, int64_t Threshold = impl::USE_LOOP_THRESHOLD_FLAG, typename F = decltype(nullptr)>
void forall_here (int64_t start, int64_t iters, F loop_body)
 
 FORALL_HERE_OVERLOAD (TaskMode B, SyncMode S=SyncMode::Blocking, GlobalCompletionEvent *GCE=nullptr, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG)
 
 FORALL_HERE_OVERLOAD (SyncMode S, GlobalCompletionEvent *GCE, TaskMode B=TaskMode::Bound, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG)
 
 FORALL_HERE_OVERLOAD (SyncMode S, GlobalCompletionEvent *GCE, int64_t Threshold, TaskMode B=TaskMode::Bound)
 
 FORALL_HERE_OVERLOAD (GlobalCompletionEvent *GCE, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG, TaskMode B=TaskMode::Bound, SyncMode S=SyncMode::Blocking)
 
 FORALL_HERE_OVERLOAD (int64_t Threshold, GlobalCompletionEvent *GCE=nullptr, TaskMode B=TaskMode::Bound, SyncMode S=SyncMode::Blocking)
 
 FORALL_OVERLOAD (TaskMode B=TaskMode::Bound, SyncMode S=SyncMode::Blocking, GlobalCompletionEvent *C=&impl::local_gce, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG)
 
 FORALL_OVERLOAD (SyncMode S, TaskMode B=TaskMode::Bound, GlobalCompletionEvent *C=&impl::local_gce, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG)
 
 FORALL_OVERLOAD (GlobalCompletionEvent *C, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG, TaskMode B=TaskMode::Bound, SyncMode S=SyncMode::Blocking)
 
 FORALL_OVERLOAD (int64_t Threshold, GlobalCompletionEvent *C=&impl::local_gce, TaskMode B=TaskMode::Bound, SyncMode S=SyncMode::Blocking)
 
 FORALL_OVERLOAD (TaskMode B, GlobalCompletionEvent *C, SyncMode S=SyncMode::Blocking, int64_t Threshold=impl::USE_LOOP_THRESHOLD_FLAG)
 
template<typename T >
std::pair< Core, Corecores_with_elements (GlobalAddress< T > base, size_t nelem)
 Return range of cores that have elements for the given linear address range. More...
 
template<GlobalCompletionEvent * GCE = &impl::local_gce, int64_t Threshold = impl::USE_LOOP_THRESHOLD_FLAG, typename T = decltype(nullptr), typename F = decltype(nullptr)>
void on_cores_localized_async (GlobalAddress< T > base, int64_t nelems, F do_on_core)
 Run privateTasks on each core that contains elements of the given region of global memory. More...
 
template<TaskMode B = TaskMode::Bound, SyncMode S = SyncMode::Blocking, GlobalCompletionEvent * GCE = &impl::local_gce, int64_t Threshold = impl::USE_LOOP_THRESHOLD_FLAG, typename T = decltype(nullptr), typename F = decltype(nullptr)>
void forall (GlobalAddress< T > base, int64_t nelems, F loop_body)
 Parallel loop over a global array. More...
 
template<typename T >
Grappa::ReuseMessage Grappa::Message __attribute__ ((aligned(64)))
 
template<typename Semaphore >
void increment (Semaphore *s, int64_t incr=1)
 
template<typename Semaphore >
void decrement (Semaphore *s, int64_t decr=1)
 
template<typename Semaphore >
bool try_decrement (Semaphore *s, int64_t decr=1)
 
template<typename Semaphore >
int64_t get_value (Semaphore *s)
 
template<typename T >
Message< T > * heap_message (Core dest, T t)
 
template<typename T >
PayloadMessage< T > * heap_message (Core dest, T t, void *payload, size_t payload_size)
 Message with payload, allocated on heap. More...
 
template<typename T >
Message< T > * send_heap_message (Core dest, T t)
 Same as message, but allocated on heap and immediately enqueued to be sent. More...
 
template<typename T >
PayloadMessage< T > * send_heap_message (Core dest, T t, void *payload, size_t payload_size)
 Message with payload, allocated on heap and immediately enqueued to be sent. More...
 
void invoke (SuspendedDelegate *c)
 
bool is_suspended_delegate (Worker *w)
 
template<typename TF >
void privateTask (TF tf)
 Spawn a task visible to this Core only. More...
 
template<typename TF >
void publicTask (TF tf)
 Spawn a task that may be stolen between cores. More...
 
template<typename TF >
void spawn_worker (TF &&tf)
 internal More...
 
template<TaskMode B = TaskMode::Bound, typename F = decltype(nullptr)>
void spawn (F f)
 
template<typename FP >
void run (FP fp)
 
Workercurrent_worker ()
 

Variables

ConditionVariable barrier_cv
 
struct Grappa::File __attribute__
 
IODescriptoraio_completed_stack
 
class Grappa::GlobalBag GRAPPA_BLOCK_ALIGNED
 
const Core MASTER = 0
 
double tick_rate = 0.0
 
Workermaster_thread
 
const auto unbound = Grappa::TaskMode::Unbound
 Specify non-default behavior: stealable tasks. More...
 
const auto async = Grappa::SyncMode::Async
 Specify non-blocking operation (to be used in loops, delegates, etc) More...
 

Detailed Description

this core's base pointer

TODO: this should be based on some actual time-related metric so behavior is predictable across machines.

Synchronizing spawns.

Typedef Documentation

typedef Core Grappa::Core

Definition at line 100 of file RDMAAggregator.hpp.

using Grappa::MetricList = typedef std::vector<impl::MetricBase*>

Definition at line 52 of file Metrics.hpp.

typedef int64_t Grappa::Timestamp

Timestamps are 64-bit signed integers.

Theoretically this should allow us to do overflow detection, but we ignore it for now. This will still allow many years of operation.

Definition at line 52 of file Timestamp.hpp.

Enumeration Type Documentation

enum Grappa::FCStatus
strong

Mixin for adding common global data structure functionality, such as mirrored allocation on all cores.

Enumerator
SATISFIED 
BLOCKED 
MATCHED 

Definition at line 92 of file FlatCombiner.hpp.

enum Grappa::SyncMode
strong

Specify whether an operation blocks until complete, or returns "immediately".

Enumerator
Blocking 
Async 

Definition at line 96 of file common.hpp.

enum Grappa::TaskMode
strong

Specify whether tasks are bound to the core they're spawned on, or if they can be load-balanced (via work-stealing).

Enumerator
Bound 
Unbound 

Definition at line 93 of file common.hpp.

Function Documentation

template<typename T >
Grappa::PayloadMessage Grappa::impl::MessageBase Grappa::__attribute__ ( (aligned(64))  )
template<typename T >
Grappa::ReuseMessage Grappa::Message Grappa::__attribute__ ( (aligned(64))  )
template<typename T >
Grappa::ExternalCountPayloadMessage Grappa::PayloadMessage Grappa::__attribute__ ( (aligned(64))  )
int Grappa::finalize ( )

Clean up Grappa.

Call in SPMD context after all Grappa code finishes. Running Grappa code after calling finalize() is illegal.

Definition at line 755 of file Grappa.cpp.

template<GlobalCompletionEvent * C = &impl::local_gce, typename F = decltype(nullptr)>
void Grappa::finish ( f)

Definition at line 439 of file GlobalCompletionEvent.hpp.

template<SyncMode S = SyncMode::Blocking, GlobalCompletionEvent * C = &impl::local_gce, int64_t Th = impl::USE_LOOP_THRESHOLD_FLAG, typename F = nullptr_t, typename T >
void Grappa::forall ( GlobalAddress< GlobalBag< T >>  b,
body 
)

Definition at line 81 of file GlobalBag.hpp.

template<GlobalCompletionEvent * GCE = &impl::local_gce, int64_t Threshold = impl::USE_LOOP_THRESHOLD_FLAG, typename T = decltype(nullptr), typename V = decltype(nullptr), typename F = decltype(nullptr)>
void Grappa::forall ( GlobalAddress< GlobalHashMap< T, V >>  self,
visit 
)

Definition at line 297 of file GlobalHashMap.hpp.

template<typename T = int8_t>
GlobalAddress<T> Grappa::global_alloc ( size_t  count)

Allocate bytes from the global shared heap.

Definition at line 151 of file GlobalAllocator.hpp.

template<typename T >
void Grappa::global_free ( GlobalAddress< T >  address)

Free memory allocated from global shared heap.

Definition at line 158 of file GlobalAllocator.hpp.

void Grappa::global_heap_init ( size_t  init_size)

Definition at line 130 of file Grappa.cpp.

void Grappa::init ( int *  argc_p,
char **  argv_p[],
int64_t  size = -1 
)

Initialize Grappa.

Call in SPMD context before running Grappa code. Running Grappa code before calling init() is illegal.

Definition at line 750 of file Grappa.cpp.

template<SyncMode S = SyncMode::Blocking, GlobalCompletionEvent * C = &impl::local_gce, typename K = nullptr_t, typename V = nullptr_t, typename F = nullptr_t>
void Grappa::insert ( GlobalAddress< GlobalHashMap< K, V >>  self,
key,
on_insert 
)

Definition at line 277 of file GlobalHashMap.hpp.

void Grappa::invoke ( SuspendedDelegate c)
inline

Definition at line 96 of file SuspendedDelegate.hpp.

bool Grappa::is_suspended_delegate ( Worker w)
inline

Definition at line 111 of file SuspendedDelegate.hpp.

template<typename Mutex >
bool Grappa::is_unlocked ( Mutex t)
inline

Definition at line 88 of file Mutex.hpp.

void Grappa::local_load_bintsv4 ( const char *  filename,
Grappa::TupleGraph::Edge local_ptr,
Grappa::TupleGraph::Edge local_end 
)

reading

helper function run on each core to load edges stored as int32_t tuples in bintsv4 format

Definition at line 96 of file TupleGraph.cpp.

void Grappa::local_save_bintsv4 ( const char *  filename,
Grappa::TupleGraph::Edge local_ptr,
Grappa::TupleGraph::Edge local_end 
)

helper function run on each core to save edges stored as int32_t tuples

Definition at line 618 of file TupleGraph.cpp.

void Grappa::local_save_tsv ( const char *  filename,
Grappa::TupleGraph::Edge local_ptr,
Grappa::TupleGraph::Edge local_end 
)

helper function run on each core to save edges stored as ASCII tab-delimited pairs

Definition at line 660 of file TupleGraph.cpp.

template<typename Mutex >
void Grappa::lock ( Mutex t)
inline

Verify that Mutex is only one word.

Lock a mutex. Note: wait scheme is unfairly LIFO

Definition at line 66 of file Mutex.hpp.

template<typename Mutex >
void Grappa::lock ( GlobalAddress< Mutex m)
inline

TODO: implement.

Definition at line 101 of file Mutex.hpp.

template<typename T >
ExternalCountPayloadMessage<T>* Grappa::send_heap_message ( Core  dest,
t,
void *  payload,
size_t  payload_size,
uint64_t *  count 
)

Definition at line 84 of file ExternalCountPayloadMessage.hpp.

template<typename T , Core MASTER_CORE = 0>
GlobalAddress<T> Grappa::symmetric_global_alloc ( )

Allocate space for a T at the same localizable global address on all cores (must currently round up to a multiple of block_size plus an additional block to ensure there is a valid address range no matter which core allocation starts on).

Definition at line 166 of file GlobalAllocator.hpp.

template<typename Mutex >
bool Grappa::trylock ( Mutex t)
inline

Try to lock a mutex. Note: wait scheme is unfairly LIFO.

Definition at line 77 of file Mutex.hpp.

template<typename Mutex >
void Grappa::trylock ( GlobalAddress< Mutex m)
inline

TODO: implement.

Definition at line 112 of file Mutex.hpp.

template<typename Mutex >
void Grappa::unlock ( Mutex t)
inline

Unlock a mutex. Note: wait scheme is unfairly LIFO.

Definition at line 92 of file Mutex.hpp.

template<typename Mutex >
void Grappa::unlock ( GlobalAddress< Mutex m)
inline

TODO: implement.

Definition at line 119 of file Mutex.hpp.

double Grappa::walltime ( void  )
inline

"Universal" wallclock time (works at least for Mac, and most Linux)

Definition at line 100 of file common.hpp.

Variable Documentation

const auto Grappa::async = Grappa::SyncMode::Async

Specify non-blocking operation (to be used in loops, delegates, etc)

forall<async>(...)
delegate::call<async>(...)
delegate::write<async>(...)

Definition at line 102 of file Grappa.hpp.

ConditionVariable Grappa::barrier_cv

Definition at line 39 of file Barrier.cpp.

Worker * Grappa::master_thread

Definition at line 110 of file Grappa.cpp.

double Grappa::tick_rate = 0.0

Definition at line 108 of file Grappa.cpp.

const auto Grappa::unbound = Grappa::TaskMode::Unbound

Specify non-default behavior: stealable tasks.

spawn<unbound>(...)

Definition at line 91 of file Grappa.hpp.