t8
1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
|
TODO: document this file. More...
#include <t8_data/t8_shmem.h>
Data Structures | |
struct | t8_shmem_array |
Shared memory array structure. More... | |
Typedefs | |
typedef struct t8_shmem_array | t8_shmem_array_struct_t |
Shared memory array structure. More... | |
Functions | |
void | t8_shmem_init (sc_MPI_Comm comm) |
Initialize shared memory usage for a communicator. More... | |
void | t8_shmem_finalize (sc_MPI_Comm comm) |
Finalize shared memory usage for a communicator. More... | |
void | t8_shmem_set_type (sc_MPI_Comm comm, sc_shmem_type_t type) |
Set a shared memory type of a communicator. More... | |
void | t8_shmem_array_init (t8_shmem_array_t *parray, size_t elem_size, size_t elem_count, sc_MPI_Comm comm) |
Initialize and allocate a shared memory array structure. More... | |
int | t8_shmem_array_start_writing (t8_shmem_array_t array) |
Enable writing mode for a shmem array. More... | |
void | t8_shmem_array_end_writing (t8_shmem_array_t array) |
Disable writing mode for a shmem array. More... | |
void | t8_shmem_array_copy (t8_shmem_array_t dest, t8_shmem_array_t source) |
Copy the contents of one t8_shmem array into another. More... | |
void | t8_shmem_array_allgather (const void *sendbuf, int sendcount, sc_MPI_Datatype sendtype, t8_shmem_array_t recvarray, int recvcount, sc_MPI_Datatype recvtype) |
Fill a t8_shmem array with an allgather. More... | |
sc_MPI_Comm | t8_shmem_array_get_comm (t8_shmem_array_t array) |
Return the MPI communicator associated with a shmem array. More... | |
size_t | t8_shmem_array_get_elem_size (t8_shmem_array_t array) |
Get the element size of a t8_shmem_array. More... | |
size_t | t8_shmem_array_get_elem_count (t8_shmem_array_t array) |
Get the number of elements of a t8_shmem_array. More... | |
const t8_gloidx_t * | t8_shmem_array_get_gloidx_array (t8_shmem_array_t array) |
Return a read-only pointer to the data of a shared memory array interpreted as an t8_gloidx_t array. More... | |
t8_gloidx_t * | t8_shmem_array_get_gloidx_array_for_writing (t8_shmem_array_t array) |
Return a pointer to the data of a shared memory array interpreted as an t8_gloidx_t array. More... | |
t8_gloidx_t | t8_shmem_array_get_gloidx (t8_shmem_array_t array, int index) |
Return an entry of a shared memory array that stores t8_gloidx_t. More... | |
void | t8_shmem_array_set_gloidx (t8_shmem_array_t array, int index, t8_gloidx_t value) |
Set an entry of a t8_shmem array that is used to store t8_gloidx_t. More... | |
const void * | t8_shmem_array_get_array (t8_shmem_array_t array) |
Return a pointer to the data array of a t8_shmem_array. More... | |
const void * | t8_shmem_array_index (t8_shmem_array_t array, size_t index) |
Return a read-only pointer to an element in a t8_shmem_array. More... | |
void * | t8_shmem_array_index_for_writing (t8_shmem_array_t array, size_t index) |
Return a pointer to an element in a t8_shmem_array in writing mode. More... | |
int | t8_shmem_array_is_equal (t8_shmem_array_t array_a, t8_shmem_array_t array_b) |
void | t8_shmem_array_destroy (t8_shmem_array_t *parray) |
Free all memory associated with a t8_shmem_array. More... | |
TODO: document this file.
typedef struct t8_shmem_array t8_shmem_array_struct_t |
Shared memory array structure.
The array uses sc_shmem shared memory.
void t8_shmem_array_allgather | ( | const void * | sendbuf, |
int | sendcount, | ||
sc_MPI_Datatype | sendtype, | ||
t8_shmem_array_t | recvarray, | ||
int | recvcount, | ||
sc_MPI_Datatype | recvtype | ||
) |
Fill a t8_shmem array with an allgather.
[in] | sendbuf | the source from this process |
[in] | sendcount | the number of items to allgather |
[in] | sendtype | the type of items to allgather |
[in,out] | recvbuf | the destination shmem array |
[in] | recvcount | the number of items to allgather |
[in] | recvtype | the type of items to allgather |
void t8_shmem_array_copy | ( | t8_shmem_array_t | dest, |
t8_shmem_array_t | source | ||
) |
Copy the contents of one t8_shmem array into another.
[in,out] | dest | The array in which source should be copied. |
[in] | source | The array to copy. |
void t8_shmem_array_destroy | ( | t8_shmem_array_t * | parray | ) |
Free all memory associated with a t8_shmem_array.
[in,out] | parray | On input a pointer to a valid t8_shmem_array. This array is freed and parray is set to NULL on return. |
void t8_shmem_array_end_writing | ( | t8_shmem_array_t | array | ) |
Disable writing mode for a shmem array.
[in,out] | array | Initialized with writing mode enabled. |
const void* t8_shmem_array_get_array | ( | t8_shmem_array_t | array | ) |
Return a pointer to the data array of a t8_shmem_array.
[in] | array | The t8_shmem_array. |
sc_MPI_Comm t8_shmem_array_get_comm | ( | t8_shmem_array_t | array | ) |
Return the MPI communicator associated with a shmem array.
[in] | array | The shmem_array to be queried. |
size_t t8_shmem_array_get_elem_count | ( | t8_shmem_array_t | array | ) |
Get the number of elements of a t8_shmem_array.
[in] | array | The array. |
size_t t8_shmem_array_get_elem_size | ( | t8_shmem_array_t | array | ) |
Get the element size of a t8_shmem_array.
[in] | array | The array. |
t8_gloidx_t t8_shmem_array_get_gloidx | ( | t8_shmem_array_t | array, |
int | index | ||
) |
Return an entry of a shared memory array that stores t8_gloidx_t.
[in] | array | The t8_shmem_array |
[in] | index | The index of the entry to be queried. |
const t8_gloidx_t* t8_shmem_array_get_gloidx_array | ( | t8_shmem_array_t | array | ) |
Return a read-only pointer to the data of a shared memory array interpreted as an t8_gloidx_t array.
[in] | array | The t8_shmem_array |
t8_gloidx_t* t8_shmem_array_get_gloidx_array_for_writing | ( | t8_shmem_array_t | array | ) |
Return a pointer to the data of a shared memory array interpreted as an t8_gloidx_t array.
The array must have writing enabled t8_shmem_array_start_writing and you should not write into the memory after t8_shmem_array_end_writing was called.
[in] | array | The t8_shmem_array |
const void* t8_shmem_array_index | ( | t8_shmem_array_t | array, |
size_t | index | ||
) |
Return a read-only pointer to an element in a t8_shmem_array.
[in] | array | The t8_shmem_array. |
[in] | index | The index of an element. |
void* t8_shmem_array_index_for_writing | ( | t8_shmem_array_t | array, |
size_t | index | ||
) |
Return a pointer to an element in a t8_shmem_array in writing mode.
[in] | array | The t8_shmem_array. |
[in] | index | The index of an element. |
void t8_shmem_array_init | ( | t8_shmem_array_t * | parray, |
size_t | elem_size, | ||
size_t | elem_count, | ||
sc_MPI_Comm | comm | ||
) |
Initialize and allocate a shared memory array structure.
[in,out] | parray | On input this pointer must be non-NULL. On return this pointer is set to the new t8_shmem_array. |
[in] | elem_size | The size in bytes of an array element. |
[in] | elem_count | The total number of elements to allocate. |
[in] | comm | The MPI communicator to be associated with the shmem_array. If not set, the shared memory type will be set to T8_SHMEM_BEST_TYPE. |
void t8_shmem_array_set_gloidx | ( | t8_shmem_array_t | array, |
int | index, | ||
t8_gloidx_t | value | ||
) |
Set an entry of a t8_shmem array that is used to store t8_gloidx_t.
The array must have writing mode enabled t8_shmem_array_start_writing.
[in,out] | array | The array to be mofified. |
[in] | index | The array entry to be modified. |
[in] | value | The new value to be set. |
int t8_shmem_array_start_writing | ( | t8_shmem_array_t | array | ) |
Enable writing mode for a shmem array.
Only some processes may be allowed to write into the array, which is indicated by the return value being non-zero.
[in,out] | array | Initialized array. Writing will be enabled on certain processes. |
void t8_shmem_finalize | ( | sc_MPI_Comm | comm | ) |
Finalize shared memory usage for a communicator.
This destroys the intra- and internode communicators.
[in] | comm | The MPI Communicator. |
void t8_shmem_init | ( | sc_MPI_Comm | comm | ) |
Initialize shared memory usage for a communicator.
This sets up the intra- and internode communicators.
[in] | comm | The MPI Communicator. |
void t8_shmem_set_type | ( | sc_MPI_Comm | comm, |
sc_shmem_type_t | type | ||
) |
Set a shared memory type of a communicator.
If the type was already set it is overwritten.
[in,out] | comm | The MPI Communicator |
[in] | type | A shared memory type. |