Yet Another eXchange Tool  DO_NOT_EDIT_HERE
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
xt_mpi.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <mpi.h>
#include "core/core.h"
#include "core/ppm_xfuncs.h"
#include "xt/xt_core.h"
#include "xt/xt_mpi.h"
#include "xt_mpi_internal.h"
Include dependency graph for xt_mpi.c:

Go to the source code of this file.

Data Structures

struct  xt_mpi_comm_internal_attr
 

Macros

#define COMPACT_DT
 
#define zero_stripe   ((struct Xt_offset_ext){ .start=0, .stride=0, .size=0 })
 

Typedefs

typedef unsigned long used_map_elem
 

Enumerations

enum  { used_map_elem_bits = sizeof (used_map_elem) * CHAR_BIT }
 

Functions

static MPI_Datatype xt_mpi_generate_compact_datatype_block (const int *disp, const int *blocklengths, int count, MPI_Datatype old_type)
 
static MPI_Datatype xt_mpi_generate_compact_datatype (int const *disp, int disp_len, MPI_Datatype old_type)
 
void xt_mpi_error (int error_code, MPI_Comm comm)
 
MPI_Datatype xt_mpi_generate_datatype_block (const int *displacements, const int *blocklengths, int count, MPI_Datatype old_type, MPI_Comm comm)
 
MPI_Datatype xt_mpi_generate_datatype (int const *displacements, int count, MPI_Datatype old_type, MPI_Comm comm)
 
static size_t scan_stripe (const int *disp, size_t disp_len, struct Xt_offset_ext *restrict v, size_t vsize)
 
static int match_simple_vec (size_t *pstart_, const struct Xt_offset_ext *v, size_t vlen, MPI_Datatype old_type, int *disp, MPI_Datatype *dt)
 
static bool match_block_vec (size_t *pstart_, const struct Xt_offset_ext *v, size_t vlen, MPI_Datatype old_type, int *disp, MPI_Datatype *dt)
 
static bool match_contiguous (size_t *pstart_, const struct Xt_offset_ext *v, size_t vlen, MPI_Datatype old_type, int *restrict disp, MPI_Datatype *dt)
 
static bool match_indexed (size_t *pstart_, const struct Xt_offset_ext *v, size_t vlen, MPI_Datatype old_type, int *disp, MPI_Datatype *dt)
 
static int gen_fallback_type (size_t set_start, size_t set_end, const struct Xt_offset_ext *v, size_t vlen, MPI_Datatype old_type, int *offset, MPI_Datatype *dt)
 
static MPI_Datatype parse_stripe (const struct Xt_offset_ext *v, size_t vlen, MPI_Datatype old_type)
 
MPI_Datatype xt_mpi_generate_datatype_stripe (const struct Xt_offset_ext *v, int count, MPI_Datatype old_type, MPI_Comm XT_UNUSED(comm))
 
static int xt_mpi_comm_internal_keyval_copy (MPI_Comm XT_UNUSED(oldcomm), int XT_UNUSED(keyval), void *XT_UNUSED(extra_state), void *XT_UNUSED(attribute_val_in), void *attribute_val_out, int *flag)
 
static int xt_mpi_comm_internal_keyval_delete (MPI_Comm XT_UNUSED(comm), int XT_UNUSED(comm_keyval), void *attribute_val, void *XT_UNUSED(extra_state))
 
void xt_mpi_init (void)
 
void xt_mpi_finalize (void)
 
static struct xt_mpi_comm_internal_attrxt_mpi_comm_get_internal_attr (MPI_Comm comm)
 
static int ctzl (unsigned long v)
 
MPI_Comm xt_mpi_comm_smart_dup (MPI_Comm comm, int *tag_offset)
 
void xt_mpi_comm_smart_dedup (MPI_Comm *comm, int tag_offset)
 
void xt_mpi_comm_mark_exclusive (MPI_Comm comm)
 
bool xt_mpi_test_some (int *restrict num_req, MPI_Request *restrict req, int *restrict ops_completed, MPI_Comm comm)
 

Variables

int xt_mpi_comm_internal_keyval
 
static int xt_mpi_tag_ub_val
 

Detailed Description

Author
Jörg Behrens behre.nosp@m.ns@d.nosp@m.krz.d.nosp@m.e Moritz Hanke hanke.nosp@m.@dkr.nosp@m.z.de Thomas Jahns jahns.nosp@m.@dkr.nosp@m.z.de

Definition in file xt_mpi.c.

Macro Definition Documentation

◆ COMPACT_DT

#define COMPACT_DT

COMPACT_DT enables the anlysis of displacements in order to give a more compact description to the datatype generators of MPI. For strong enough MPI implementations this not required. Then you can undefine COMPACT_DT and save some prcessing time within yaxt without losing communication performance.

Definition at line 69 of file xt_mpi.c.

◆ zero_stripe

#define zero_stripe   ((struct Xt_offset_ext){ .start=0, .stride=0, .size=0 })

Definition at line 71 of file xt_mpi.c.

Typedef Documentation

◆ used_map_elem

typedef unsigned long used_map_elem

Definition at line 727 of file xt_mpi.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
used_map_elem_bits 

Definition at line 729 of file xt_mpi.c.

Function Documentation

◆ ctzl()

static int ctzl ( unsigned long  v)
inlinestatic

Definition at line 821 of file xt_mpi.c.

Here is the caller graph for this function:

◆ gen_fallback_type()

static int gen_fallback_type ( size_t  set_start,
size_t  set_end,
const struct Xt_offset_ext v,
size_t  vlen,
MPI_Datatype  old_type,
int *  offset,
MPI_Datatype *  dt 
)
static

Definition at line 565 of file xt_mpi.c.

Here is the caller graph for this function:

◆ match_block_vec()

static bool match_block_vec ( size_t *  pstart_,
const struct Xt_offset_ext v,
size_t  vlen,
MPI_Datatype  old_type,
int *  disp,
MPI_Datatype *  dt 
)
static
Returns
true if matched, false if not matched

Definition at line 458 of file xt_mpi.c.

Here is the caller graph for this function:

◆ match_contiguous()

static bool match_contiguous ( size_t *  pstart_,
const struct Xt_offset_ext v,
size_t  vlen,
MPI_Datatype  old_type,
int *restrict  disp,
MPI_Datatype *  dt 
)
static

Definition at line 505 of file xt_mpi.c.

Here is the caller graph for this function:

◆ match_indexed()

static bool match_indexed ( size_t *  pstart_,
const struct Xt_offset_ext v,
size_t  vlen,
MPI_Datatype  old_type,
int *  disp,
MPI_Datatype *  dt 
)
static

Definition at line 523 of file xt_mpi.c.

Here is the caller graph for this function:

◆ match_simple_vec()

static int match_simple_vec ( size_t *  pstart_,
const struct Xt_offset_ext v,
size_t  vlen,
MPI_Datatype  old_type,
int *  disp,
MPI_Datatype *  dt 
)
static

Definition at line 414 of file xt_mpi.c.

Here is the caller graph for this function:

◆ parse_stripe()

static MPI_Datatype parse_stripe ( const struct Xt_offset_ext v,
size_t  vlen,
MPI_Datatype  old_type 
)
static

Definition at line 618 of file xt_mpi.c.

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

◆ scan_stripe()

static size_t scan_stripe ( const int *  disp,
size_t  disp_len,
struct Xt_offset_ext *restrict  v,
size_t  vsize 
)
static

Definition at line 319 of file xt_mpi.c.

Here is the caller graph for this function:

◆ xt_mpi_comm_get_internal_attr()

static struct xt_mpi_comm_internal_attr* xt_mpi_comm_get_internal_attr ( MPI_Comm  comm)
static

Definition at line 796 of file xt_mpi.c.

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

◆ xt_mpi_comm_internal_keyval_copy()

static int xt_mpi_comm_internal_keyval_copy ( MPI_Comm   XT_UNUSEDoldcomm,
int   XT_UNUSEDkeyval,
void *  XT_UNUSEDextra_state,
void *  XT_UNUSEDattribute_val_in,
void *  attribute_val_out,
int *  flag 
)
static

Definition at line 740 of file xt_mpi.c.

Here is the caller graph for this function:

◆ xt_mpi_comm_internal_keyval_delete()

static int xt_mpi_comm_internal_keyval_delete ( MPI_Comm   XT_UNUSEDcomm,
int   XT_UNUSEDcomm_keyval,
void *  attribute_val,
void *  XT_UNUSEDextra_state 
)
static

Definition at line 765 of file xt_mpi.c.

Here is the caller graph for this function:

◆ xt_mpi_comm_mark_exclusive()

void xt_mpi_comm_mark_exclusive ( MPI_Comm  comm)

Annotate communicator that is for exclusive use by YAXT.

YAXT will trust communicators marked this way to not have active communications other than those initiated by YAXT functions. This is useful to prevent unnecessary MPI_Comm_dup() calls.

Parameters
[in,out]commcommunicator that will not be used by application code

Definition at line 918 of file xt_mpi.c.

Here is the caller graph for this function:

◆ xt_mpi_comm_smart_dedup()

void xt_mpi_comm_smart_dedup ( MPI_Comm comm,
int  tag_offset 
)
Examples:
test_mpi_smartdedup.c.

Definition at line 901 of file xt_mpi.c.

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

◆ xt_mpi_comm_smart_dup()

MPI_Comm xt_mpi_comm_smart_dup ( MPI_Comm  comm,
int *  tag_offset 
)
Examples:
test_mpi_smartdedup.c.

Definition at line 850 of file xt_mpi.c.

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

◆ xt_mpi_error()

void xt_mpi_error ( int  error_code,
MPI_Comm  comm 
)

report error return of MPI call

Parameters
[in]error_codereturn code of an MPI call
[in]commcommunicator which was used for the respective MPI call

Definition at line 82 of file xt_mpi.c.

◆ xt_mpi_finalize()

void xt_mpi_finalize ( void  )

Definition at line 790 of file xt_mpi.c.

Here is the caller graph for this function:

◆ xt_mpi_generate_compact_datatype()

static MPI_Datatype xt_mpi_generate_compact_datatype ( int const *  disp,
int  disp_len,
MPI_Datatype  old_type 
)
static

Definition at line 712 of file xt_mpi.c.

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

◆ xt_mpi_generate_compact_datatype_block()

static MPI_Datatype xt_mpi_generate_compact_datatype_block ( const int *  disp,
const int *  blocklengths,
int  count,
MPI_Datatype  old_type 
)
static

Definition at line 696 of file xt_mpi.c.

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

◆ xt_mpi_generate_datatype()

MPI_Datatype xt_mpi_generate_datatype ( int const *  displacements,
int  count,
MPI_Datatype  old_type,
MPI_Comm  comm 
)

generates an MPI datatype

Parameters
[in]displacementsarray of displacements
[in]countnumber of elements
[in]old_typebase MPI datatype of all elements
[in]commMPI communicator
Returns
MPI datatype for the given data layout
Remarks
the returned datatype needs to be freed by the user (MPI_Type_free)

Definition at line 263 of file xt_mpi.c.

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

◆ xt_mpi_generate_datatype_block()

MPI_Datatype xt_mpi_generate_datatype_block ( const int *  displacements,
const int *  blocklengths,
int  count,
MPI_Datatype  old_type,
MPI_Comm  comm 
)

generates an MPI datatype

Parameters
[in]displacementsarray of displacements
[in]blocklengthsarray of block sizes
[in]countnumber of blocks
[in]old_typebase MPI datatype of all elements
[in]commMPI communicator
Returns
MPI datatype for the given data layout
Remarks
the returned datatype needs to be freed by the user (MPI_Type_free)

Definition at line 229 of file xt_mpi.c.

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

◆ xt_mpi_generate_datatype_stripe()

MPI_Datatype xt_mpi_generate_datatype_stripe ( const struct Xt_offset_ext v,
int  count,
MPI_Datatype  old_type,
MPI_Comm   XT_UNUSEDcomm 
)

Definition at line 686 of file xt_mpi.c.

Here is the call graph for this function:

◆ xt_mpi_init()

void xt_mpi_init ( void  )

Definition at line 776 of file xt_mpi.c.

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

◆ xt_mpi_test_some()

bool xt_mpi_test_some ( int *restrict  num_req,
MPI_Request *restrict  req,
int *restrict  ops_completed,
MPI_Comm  comm 
)

Definition at line 929 of file xt_mpi.c.

Here is the caller graph for this function:

Variable Documentation

◆ xt_mpi_comm_internal_keyval

int xt_mpi_comm_internal_keyval

Definition at line 725 of file xt_mpi.c.

◆ xt_mpi_tag_ub_val

int xt_mpi_tag_ub_val
static

Definition at line 773 of file xt_mpi.c.