Yet Another eXchange Tool 0.11.4
Loading...
Searching...
No Matches
xt_mpi_ddt_cache.c File Reference
#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"
Include dependency graph for xt_mpi_ddt_cache.c:

Go to the source code of this file.

Classes

struct  Xt_mpi_contiguous_arg_desc
 
struct  Xt_mpi_vector_arg_desc
 
struct  Xt_mpi_hvector_arg_desc
 
struct  Xt_mpi_indexed_block_arg_desc
 
struct  Xt_mpi_indexed_arg_desc
 
struct  Xt_mpi_struct_arg_desc
 
struct  Xt_mpiddt_list_entry
 

Macros

#define GROW_DDT_LIST(ddt_list)
 
#define disp_size   (disp_size + (count_ + 2) * sizeof (int))
 

Functions

static struct Xt_mpiddt_list_entrygrow_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])
 

Detailed Description

Macro Definition Documentation

◆ 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) \
entries = grow_ddt_list(ddt_list); \
} 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.

Function Documentation

◆ free_dt_unless_named()

static void free_dt_unless_named ( MPI_Datatype * dt,
MPI_Comm comm )
inlinestatic

Definition at line 133 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grow_ddt_list()

static struct Xt_mpiddt_list_entry * grow_ddt_list ( struct Xt_mpiddt_list * ddt_list)
static

Definition at line 118 of file xt_mpi_ddt_cache.c.

◆ 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_listcache of already created derived datatypes
[in]countnumber of elements in contiguous datatype
[in]oldtypeelement type to create contiguous sequence datatype of
[in]commcommunicator to use for coordination

Definition at line 144 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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_listcache of already created derived datatypes
[in]countnumber of blocks in hindexed datatype
[in]blocklengthnumber of contiguous elements for each block
[in]dispdisplacement of each block in bytes
[in]oldtypeelement type to create derived datatype of
[in]commcommunicator to use for coordination

Definition at line 438 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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_listcache of already created derived datatypes
[in]countnumber of repeated blocks in hindexed block datatype
[in]blocklengthnumber of contiguous elements per repeated block
[in]dispdisplacement of each block in bytes
[in]oldtypeelement type to create derived datatype of
[in]commcommunicator to use for coordination

Definition at line 318 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:

◆ 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_listcache of already created derived datatypes
[in]countnumber of repeated blocks in hvector datatype
[in]blocklengthnumber of contiguous elements per repeated block
[in]stridehvector stride in bytes from start of one block to next block
[in]oldtypeelement type to create derived datatype of
[in]commcommunicator to use for coordination

Definition at line 223 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:

◆ 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_listcache of already created derived datatypes
[in]countnumber of blocks in indexed datatype
[in]blocklengthnumber of contiguous elements for each block
[in]dispdisplacement of each block in unit of elements
[in]oldtypeelement type to create derived datatype of
[in]commcommunicator to use for coordination

Definition at line 383 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:

◆ 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_listcache of already created derived datatypes
[in]countnumber of repeated blocks in indexed block datatype
[in]blocklengthnumber of contiguous elements per repeated block
[in]dispdisplacement of each block in unit of elements from start
[in]oldtypeelement type to create derived datatype of
[in]commcommunicator to use for coordination

Definition at line 264 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:

◆ 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_listcache of already created derived datatypes
[in]countnumber of blocks in struct datatype
[in]blocklengthnumber of contiguous elements for each block
[in]dispdisplacement of each block in bytes
[in]oldtypeelement type for each block
[in]commcommunicator to use for coordination

Definition at line 498 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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_listcache of already created derived datatypes
[in]countnumber of repeated blocks in vector datatype
[in]blocklengthnumber of contiguous elements per repeated block
[in]stridevector stride in unit of elements from start of one block to next block
[in]oldtypeelement type to create derived datatype of
[in]commcommunicator to use for coordination

Definition at line 182 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:

◆ Xt_mpi_ddt_cache_check_retention()

void Xt_mpi_ddt_cache_check_retention ( struct Xt_mpiddt_list * ddt_list,
size_t nmsg,
struct Xt_redist_msg msgs[nmsg] )

Definition at line 623 of file xt_mpi_ddt_cache.c.

Here is the caller graph for this function:

◆ Xt_mpi_ddt_cache_entry_release()

void Xt_mpi_ddt_cache_entry_release ( struct Xt_mpiddt_list * ddt_list,
MPI_Datatype * dt,
MPI_Comm comm )

reduce reference counter for MPI datatype in cache

Parameters
[in,out]ddt_listcache of already created derived datatypes
[in]dtderived datatype to mark as used one instance less
[in]commcommunicator 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Xt_mpi_ddt_cache_free()

void Xt_mpi_ddt_cache_free ( struct Xt_mpiddt_list * ddt_list,
MPI_Comm comm )

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_listcache of already created derived datatypes
[in]commcommunicator to use for coordination and error reporting

Definition at line 605 of file xt_mpi_ddt_cache.c.

Here is the call graph for this function:
Here is the caller graph for this function: