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

Namespaces

 Grappa
 this core's base pointer
 

Classes

class  GlobalAddress< T >
 Global address class. More...
 
struct  LocalIterator< T >
 

Functions

template<typename T >
GlobalAddress< T > operator+ (const GlobalAddress< T > &t, ptrdiff_t i)
 return an address that's i T's more than t. More...
 
template<typename T >
GlobalAddress< T > operator- (const GlobalAddress< T > &t, ptrdiff_t i)
 return an address that's i T's less than t. More...
 
template<typename T >
ptrdiff_t operator- (const GlobalAddress< T > &t, const GlobalAddress< T > &u)
 how many T's different are t and u? More...
 
template<>
ptrdiff_t operator-< char > (const GlobalAddress< char > &t, const GlobalAddress< char > &u)
 how many bytes different are t and u? More...
 
template<typename T >
GlobalAddress< T > make_global (T *t, Core n=global_communicator.mycore)
 return a 2d global pointer to a local pointer on a particular core More...
 
template<typename T >
GlobalAddress< T > make_linear (T *t)
 takes a local pointer to a block-cyclic distributed chuck of memory allocated at the same base address on all cores, and makes a linear global pointer pointing to that byte. More...
 
template<typename T >
std::ostream & operator<< (std::ostream &o, const GlobalAddress< T > &ga)
 output human-readable version of global address More...
 
template<typename T , typename M >
GlobalAddress< M > global_pointer_to_member (const GlobalAddress< T > t, const M T::*m)
 computes offsets of members in structs and claases call like this: More...
 
template<typename T >
LocalIterator< T > iterate_local (GlobalAddress< T > base, size_t nelem)
 Helper for iterating over local elements of a Linear address range. More...
 
template<typename T >
T * Grappa::locale_alloc (size_t n=1)
 Allocate memory in locale shared heap. More...
 
template<typename T >
T * Grappa::locale_alloc_aligned (size_t alignment, size_t n=1)
 
template<typename T , typename... Args>
T * Grappa::locale_new (Args &&...args)
 
template<typename T >
T * Grappa::locale_new ()
 
void Grappa::locale_free (void *ptr)
 Free memory that was allocated from locale shared heap. More...
 

Detailed Description

Function Documentation

template<typename T , typename M >
GlobalAddress< M > global_pointer_to_member ( const GlobalAddress< T >  t,
const M T::*  m 
)
inline

computes offsets of members in structs and claases call like this:

struct Foo {
int i;
} foo;
GlobalAddress< int > foo_i_gp = global_pointer_to_member( foo_gp, &Foo::i );

Definition at line 452 of file Addressing.hpp.

template<typename T >
LocalIterator<T> iterate_local ( GlobalAddress< T >  base,
size_t  nelem 
)

Helper for iterating over local elements of a Linear address range.

auto array = global_alloc<long>(N);
for (auto& v : iterate_local(array,N)) {
v++;
}
});

Definition at line 479 of file Addressing.hpp.

template<typename T >
void * Grappa::locale_alloc ( size_t  n = 1)
inline

Allocate memory in locale shared heap.

Definition at line 101 of file LocaleSharedMemory.hpp.

template<typename T >
void * Grappa::locale_alloc_aligned ( size_t  alignment,
size_t  n = 1 
)
inline

Definition at line 110 of file LocaleSharedMemory.hpp.

void Grappa::locale_free ( void *  ptr)
inline

Free memory that was allocated from locale shared heap.

Definition at line 130 of file LocaleSharedMemory.hpp.

template<typename T , typename... Args>
T* Grappa::locale_new ( Args &&...  args)
inline

Definition at line 120 of file LocaleSharedMemory.hpp.

template<typename T >
T* Grappa::locale_new ( )
inline

Definition at line 125 of file LocaleSharedMemory.hpp.

template<typename T >
GlobalAddress< T > make_global ( T *  t,
Core  n = global_communicator.mycore 
)

return a 2d global pointer to a local pointer on a particular core

Definition at line 424 of file Addressing.hpp.

template<typename T >
GlobalAddress< T > make_linear ( T *  t)

takes a local pointer to a block-cyclic distributed chuck of memory allocated at the same base address on all cores, and makes a linear global pointer pointing to that byte.

Definition at line 432 of file Addressing.hpp.

template<typename T >
GlobalAddress< T > operator+ ( const GlobalAddress< T > &  t,
ptrdiff_t  i 
)

return an address that's i T's more than t.

Definition at line 386 of file Addressing.hpp.

template<typename T >
GlobalAddress< T > operator- ( const GlobalAddress< T > &  t,
ptrdiff_t  i 
)

return an address that's i T's less than t.

Definition at line 398 of file Addressing.hpp.

template<typename T >
ptrdiff_t operator- ( const GlobalAddress< T > &  t,
const GlobalAddress< T > &  u 
)
inline

how many T's different are t and u?

Definition at line 410 of file Addressing.hpp.

template<>
ptrdiff_t operator-< char > ( const GlobalAddress< char > &  t,
const GlobalAddress< char > &  u 
)
inline

how many bytes different are t and u?

Definition at line 418 of file Addressing.hpp.

template<typename T >
std::ostream& operator<< ( std::ostream &  o,
const GlobalAddress< T > &  ga 
)

output human-readable version of global address

Definition at line 438 of file Addressing.hpp.