#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <mpi.h>
#include "xt/xt_mpi.h"
#include "xt_arithmetic_util.h"
#include "core/cksum.h"
#include "core/core.h"
#include "core/ppm_xfuncs.h"
#include "xt_mpi_ddt_wrap.h"
#include "xt_mpi_ddt_cache.h"
Go to the source code of this file.
|
static struct Xt_mpiddt_list_entry * | grow_ddt_list (struct Xt_mpiddt_list *ddt_list) |
|
static void | free_dt_unless_named (MPI_Datatype *dt, MPI_Comm comm) |
|
MPI_Datatype | Xt_mpi_ddt_cache_acquire_contiguous (struct Xt_mpiddt_list *ddt_list, int count, MPI_Datatype oldtype, MPI_Comm comm) |
|
MPI_Datatype | Xt_mpi_ddt_cache_acquire_vector (struct Xt_mpiddt_list *ddt_list, int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Comm comm) |
|
MPI_Datatype | Xt_mpi_ddt_cache_acquire_hvector (struct Xt_mpiddt_list *ddt_list, int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Comm comm) |
|
MPI_Datatype | Xt_mpi_ddt_cache_acquire_indexed_block (struct Xt_mpiddt_list *ddt_list, int count, int blocklength, const int disp[count], MPI_Datatype oldtype, MPI_Comm comm) |
|
MPI_Datatype | Xt_mpi_ddt_cache_acquire_hindexed_block (struct Xt_mpiddt_list *ddt_list, int count, int blocklength, const MPI_Aint disp[count], MPI_Datatype oldtype, MPI_Comm comm) |
|
MPI_Datatype | Xt_mpi_ddt_cache_acquire_indexed (struct Xt_mpiddt_list *ddt_list, int count, const int blocklength[count], const int disp[count], MPI_Datatype oldtype, MPI_Comm comm) |
|
MPI_Datatype | Xt_mpi_ddt_cache_acquire_hindexed (struct Xt_mpiddt_list *ddt_list, int count, const int blocklength[count], const MPI_Aint disp[count], MPI_Datatype oldtype, MPI_Comm comm) |
|
MPI_Datatype | Xt_mpi_ddt_cache_acquire_struct (struct Xt_mpiddt_list *ddt_list, int count, const int blocklength[count], const MPI_Aint disp[count], const MPI_Datatype oldtype[count], MPI_Comm comm) |
|
void | Xt_mpi_ddt_cache_entry_release (struct Xt_mpiddt_list *ddt_list, MPI_Datatype *dt, MPI_Comm comm) |
|
void | Xt_mpi_ddt_cache_free (struct Xt_mpiddt_list *ddt_list, MPI_Comm comm) |
|
void | Xt_mpi_ddt_cache_check_retention (struct Xt_mpiddt_list *ddt_list, size_t nmsg, struct Xt_redist_msg msgs[nmsg]) |
|
◆ disp_size
#define disp_size (disp_size + (count_ + 2) * sizeof (int)) |
◆ GROW_DDT_LIST
#define GROW_DDT_LIST |
( |
| ddt_list | ) |
|
Value: do { \
if (ddt_list->num_entries == ddt_list->size_entries) \
} while (0)
static struct Xt_mpiddt_list_entry * grow_ddt_list(struct Xt_mpiddt_list *ddt_list)
Definition at line 126 of file xt_mpi_ddt_cache.c.
◆ free_dt_unless_named()
static void free_dt_unless_named |
( |
MPI_Datatype * | dt, |
|
|
MPI_Comm | comm ) |
|
inlinestatic |
◆ grow_ddt_list()
◆ Xt_mpi_ddt_cache_acquire_contiguous()
MPI_Datatype Xt_mpi_ddt_cache_acquire_contiguous |
( |
struct Xt_mpiddt_list * | ddt_list, |
|
|
int | count, |
|
|
MPI_Datatype | oldtype, |
|
|
MPI_Comm | comm ) |
lookup MPI contiguous datatype in cache or create if not yet present
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | count | number of elements in contiguous datatype |
[in] | oldtype | element type to create contiguous sequence datatype of |
[in] | comm | communicator to use for coordination |
Definition at line 144 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_acquire_hindexed()
MPI_Datatype Xt_mpi_ddt_cache_acquire_hindexed |
( |
struct Xt_mpiddt_list * | ddt_list, |
|
|
int | count, |
|
|
const int | blocklength[count], |
|
|
const MPI_Aint | disp[count], |
|
|
MPI_Datatype | oldtype, |
|
|
MPI_Comm | comm ) |
lookup MPI hindexed datatype in cache or create if not yet present
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | count | number of blocks in hindexed datatype |
[in] | blocklength | number of contiguous elements for each block |
[in] | disp | displacement of each block in bytes |
[in] | oldtype | element type to create derived datatype of |
[in] | comm | communicator to use for coordination |
Definition at line 438 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_acquire_hindexed_block()
MPI_Datatype Xt_mpi_ddt_cache_acquire_hindexed_block |
( |
struct Xt_mpiddt_list * | ddt_list, |
|
|
int | count, |
|
|
int | blocklength, |
|
|
const MPI_Aint | disp[count], |
|
|
MPI_Datatype | oldtype, |
|
|
MPI_Comm | comm ) |
lookup MPI hindexed block datatype in cache or create if not yet present
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | count | number of repeated blocks in hindexed block datatype |
[in] | blocklength | number of contiguous elements per repeated block |
[in] | disp | displacement of each block in bytes |
[in] | oldtype | element type to create derived datatype of |
[in] | comm | communicator to use for coordination |
Definition at line 318 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_acquire_hvector()
MPI_Datatype Xt_mpi_ddt_cache_acquire_hvector |
( |
struct Xt_mpiddt_list * | ddt_list, |
|
|
int | count, |
|
|
int | blocklength, |
|
|
MPI_Aint | stride, |
|
|
MPI_Datatype | oldtype, |
|
|
MPI_Comm | comm ) |
lookup MPI hvector datatype in cache or create if not yet present
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | count | number of repeated blocks in hvector datatype |
[in] | blocklength | number of contiguous elements per repeated block |
[in] | stride | hvector stride in bytes from start of one block to next block |
[in] | oldtype | element type to create derived datatype of |
[in] | comm | communicator to use for coordination |
Definition at line 223 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_acquire_indexed()
MPI_Datatype Xt_mpi_ddt_cache_acquire_indexed |
( |
struct Xt_mpiddt_list * | ddt_list, |
|
|
int | count, |
|
|
const int | blocklength[count], |
|
|
const int | disp[count], |
|
|
MPI_Datatype | oldtype, |
|
|
MPI_Comm | comm ) |
lookup MPI indexed datatype in cache or create if not yet present
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | count | number of blocks in indexed datatype |
[in] | blocklength | number of contiguous elements for each block |
[in] | disp | displacement of each block in unit of elements |
[in] | oldtype | element type to create derived datatype of |
[in] | comm | communicator to use for coordination |
Definition at line 383 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_acquire_indexed_block()
MPI_Datatype Xt_mpi_ddt_cache_acquire_indexed_block |
( |
struct Xt_mpiddt_list * | ddt_list, |
|
|
int | count, |
|
|
int | blocklength, |
|
|
const int | disp[count], |
|
|
MPI_Datatype | oldtype, |
|
|
MPI_Comm | comm ) |
lookup MPI indexed block datatype in cache or create if not yet present
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | count | number of repeated blocks in indexed block datatype |
[in] | blocklength | number of contiguous elements per repeated block |
[in] | disp | displacement of each block in unit of elements from start |
[in] | oldtype | element type to create derived datatype of |
[in] | comm | communicator to use for coordination |
Definition at line 264 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_acquire_struct()
MPI_Datatype Xt_mpi_ddt_cache_acquire_struct |
( |
struct Xt_mpiddt_list * | ddt_list, |
|
|
int | count, |
|
|
const int | blocklength[count], |
|
|
const MPI_Aint | disp[count], |
|
|
const MPI_Datatype | oldtype[count], |
|
|
MPI_Comm | comm ) |
lookup MPI struct datatype in cache or create if not yet present
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | count | number of blocks in struct datatype |
[in] | blocklength | number of contiguous elements for each block |
[in] | disp | displacement of each block in bytes |
[in] | oldtype | element type for each block |
[in] | comm | communicator to use for coordination |
Definition at line 498 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_acquire_vector()
MPI_Datatype Xt_mpi_ddt_cache_acquire_vector |
( |
struct Xt_mpiddt_list * | ddt_list, |
|
|
int | count, |
|
|
int | blocklength, |
|
|
int | stride, |
|
|
MPI_Datatype | oldtype, |
|
|
MPI_Comm | comm ) |
lookup MPI vector datatype in cache or create if not yet present
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | count | number of repeated blocks in vector datatype |
[in] | blocklength | number of contiguous elements per repeated block |
[in] | stride | vector stride in unit of elements from start of one block to next block |
[in] | oldtype | element type to create derived datatype of |
[in] | comm | communicator to use for coordination |
Definition at line 182 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_check_retention()
◆ Xt_mpi_ddt_cache_entry_release()
reduce reference counter for MPI datatype in cache
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | dt | derived datatype to mark as used one instance less |
[in] | comm | communicator to use for coordination and error reporting |
- Todo
- : implement heuristic to free datatypes going unused in a while
Definition at line 579 of file xt_mpi_ddt_cache.c.
◆ Xt_mpi_ddt_cache_free()
Remove ddt cache data structure
This function will also call MPI_Type_free for all datatypes in cache that have 0 reference count
- Parameters
-
[in,out] | ddt_list | cache of already created derived datatypes |
[in] | comm | communicator to use for coordination and error reporting |
Definition at line 605 of file xt_mpi_ddt_cache.c.