SimGrid  3.16
Versatile Simulation of Distributed Systems
smpi_op.cpp File Reference

Namespaces

 simgrid
 Alltoall Bruck.
 
 simgrid::smpi
 

Macros

#define MAX_OP(a, b)   (b) = (a) < (b) ? (b) : (a)
 
#define MIN_OP(a, b)   (b) = (a) < (b) ? (a) : (b)
 
#define SUM_OP(a, b)   (b) += (a)
 
#define PROD_OP(a, b)   (b) *= (a)
 
#define LAND_OP(a, b)   (b) = (a) && (b)
 
#define LOR_OP(a, b)   (b) = (a) || (b)
 
#define LXOR_OP(a, b)   (b) = (not(a) && (b)) || ((a) && not(b))
 
#define BAND_OP(a, b)   (b) &= (a)
 
#define BOR_OP(a, b)   (b) |= (a)
 
#define BXOR_OP(a, b)   (b) ^= (a)
 
#define MAXLOC_OP(a, b)   (b) = (a.value) < (b.value) ? (b) : ((a.value) == (b.value) ? ((a.index) < (b.index) ? (a) : (b)) : (a))
 
#define MINLOC_OP(a, b)   (b) = (a.value) < (b.value) ? (a) : ((a.value) == (b.value) ? ((a.index) < (b.index) ? (a) : (b)) : (b))
 
#define APPLY_FUNC(a, b, length, type, func)
 
#define APPLY_OP_LOOP(dtype, type, op)
 
#define APPLY_BASIC_OP_LOOP(op)
 
#define APPLY_BOOL_OP_LOOP(op)   APPLY_OP_LOOP(MPI_C_BOOL, bool,op)
 
#define APPLY_FLOAT_OP_LOOP(op)
 
#define APPLY_COMPLEX_OP_LOOP(op)
 
#define APPLY_PAIR_OP_LOOP(op)
 
#define APPLY_END_OP_LOOP(op)
 
#define CREATE_MPI_OP(name, func)
 

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (smpi_op, smpi, "Logging specific to SMPI (op)")
 
static void max_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void min_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void sum_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void prod_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void land_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void lor_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void lxor_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void band_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void bor_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void bxor_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void minloc_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void maxloc_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void replace_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
static void no_func (void *a, void *b, int *length, MPI_Datatype *datatype)
 
 CREATE_MPI_OP (MPI_MAX, max_func)
 
 CREATE_MPI_OP (MPI_MIN, min_func)
 
 CREATE_MPI_OP (MPI_SUM, sum_func)
 
 CREATE_MPI_OP (MPI_PROD, prod_func)
 
 CREATE_MPI_OP (MPI_LAND, land_func)
 
 CREATE_MPI_OP (MPI_LOR, lor_func)
 
 CREATE_MPI_OP (MPI_LXOR, lxor_func)
 
 CREATE_MPI_OP (MPI_BAND, band_func)
 
 CREATE_MPI_OP (MPI_BOR, bor_func)
 
 CREATE_MPI_OP (MPI_BXOR, bxor_func)
 
 CREATE_MPI_OP (MPI_MAXLOC, maxloc_func)
 
 CREATE_MPI_OP (MPI_MINLOC, minloc_func)
 
 CREATE_MPI_OP (MPI_REPLACE, replace_func)
 
 CREATE_MPI_OP (MPI_NO_OP, no_func)
 

Macro Definition Documentation

◆ MAX_OP

#define MAX_OP (   a,
 
)    (b) = (a) < (b) ? (b) : (a)

◆ MIN_OP

#define MIN_OP (   a,
 
)    (b) = (a) < (b) ? (a) : (b)

◆ SUM_OP

#define SUM_OP (   a,
 
)    (b) += (a)

◆ PROD_OP

#define PROD_OP (   a,
 
)    (b) *= (a)

◆ LAND_OP

#define LAND_OP (   a,
 
)    (b) = (a) && (b)

◆ LOR_OP

#define LOR_OP (   a,
 
)    (b) = (a) || (b)

◆ LXOR_OP

#define LXOR_OP (   a,
 
)    (b) = (not(a) && (b)) || ((a) && not(b))

◆ BAND_OP

#define BAND_OP (   a,
 
)    (b) &= (a)

◆ BOR_OP

#define BOR_OP (   a,
 
)    (b) |= (a)

◆ BXOR_OP

#define BXOR_OP (   a,
 
)    (b) ^= (a)

◆ MAXLOC_OP

#define MAXLOC_OP (   a,
 
)    (b) = (a.value) < (b.value) ? (b) : ((a.value) == (b.value) ? ((a.index) < (b.index) ? (a) : (b)) : (a))

◆ MINLOC_OP

#define MINLOC_OP (   a,
 
)    (b) = (a.value) < (b.value) ? (a) : ((a.value) == (b.value) ? ((a.index) < (b.index) ? (a) : (b)) : (b))

◆ APPLY_FUNC

#define APPLY_FUNC (   a,
  b,
  length,
  type,
  func 
)
Value:
{ \
int i; \
type* x = (type*)(a); \
type* y = (type*)(b); \
for(i = 0; i < *(length); i++) { \
func(x[i], y[i]); \
} \
}
int int errorclass int flag void baseptr void int MPI_Datatype void int int MPI_Datatype int MPI_Comm comm MPI_Status MPI_Datatype int count char int resultlen void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Win win void void MPI_Datatype int MPI_Aint MPI_Op MPI_Win win MPI_Group MPI_Group MPI_Group newgroup MPI_Group group MPI_Group MPI_Group MPI_Group newgroup MPI_Group int int MPI_Group newgroup MPI_Group int size MPI_Group MPI_Group MPI_Group newgroup MPI_Info char key MPI_Info info MPI_Info int nkeys MPI_Info char int int flag int flag int char int int provided void int MPI_Datatype int int MPI_Comm MPI_Request request void int MPI_Datatype int int MPI_Comm MPI_Request request MPI_Copy_function MPI_Delete_function int void extra_state MPI_User_function int MPI_Op op MPI_Op int commute void int MPI_Datatype type
Definition: smpi_mpi.cpp:127

◆ APPLY_OP_LOOP

#define APPLY_OP_LOOP (   dtype,
  type,
  op 
)
Value:
if (*datatype == dtype) {\
APPLY_FUNC(a, b, length, type, op)\
} else \
int int errorclass int flag void baseptr void int MPI_Datatype void int int MPI_Datatype int MPI_Comm comm MPI_Status MPI_Datatype int count char int resultlen void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Win win void void MPI_Datatype int MPI_Aint MPI_Op MPI_Win win MPI_Group MPI_Group MPI_Group newgroup MPI_Group group MPI_Group MPI_Group MPI_Group newgroup MPI_Group int int MPI_Group newgroup MPI_Group int size MPI_Group MPI_Group MPI_Group newgroup MPI_Info char key MPI_Info info MPI_Info int nkeys MPI_Info char int int flag int flag int char int int provided void int MPI_Datatype int int MPI_Comm MPI_Request request void int MPI_Datatype int int MPI_Comm MPI_Request request MPI_Copy_function MPI_Delete_function int void extra_state MPI_User_function int MPI_Op op MPI_Op int commute void int MPI_Datatype type
Definition: smpi_mpi.cpp:127
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op MPI_Win win void int MPI_Datatype void int MPI_Datatype MPI_Comm comm MPI_Aint MPI_Info void baseptr void int MPI_Datatype void int MPI_Datatype MPI_Comm comm MPI_Comm int keyval MPI_Comm int void attr_value void int MPI_Datatype datatype
Definition: smpi_mpi.cpp:50

◆ APPLY_BASIC_OP_LOOP

#define APPLY_BASIC_OP_LOOP (   op)
Value:
APPLY_OP_LOOP(MPI_SHORT, short,op)\
APPLY_OP_LOOP(MPI_INT, int,op)\
APPLY_OP_LOOP(MPI_LONG, long,op)\
APPLY_OP_LOOP(MPI_LONG_LONG, long long,op)\
APPLY_OP_LOOP(MPI_SIGNED_CHAR, signed char,op)\
APPLY_OP_LOOP(MPI_UNSIGNED_CHAR, unsigned char,op)\
APPLY_OP_LOOP(MPI_UNSIGNED_SHORT, unsigned short,op)\
APPLY_OP_LOOP(MPI_UNSIGNED, unsigned int,op)\
APPLY_OP_LOOP(MPI_UNSIGNED_LONG, unsigned long,op)\
APPLY_OP_LOOP(MPI_UNSIGNED_LONG_LONG, unsigned long long,op)\
APPLY_OP_LOOP(MPI_WCHAR, wchar_t,op)\
APPLY_OP_LOOP(MPI_BYTE, int8_t,op)\
APPLY_OP_LOOP(MPI_INT8_T, int8_t,op)\
APPLY_OP_LOOP(MPI_INT16_T, int16_t,op)\
APPLY_OP_LOOP(MPI_INT32_T, int32_t,op)\
APPLY_OP_LOOP(MPI_INT64_T, int64_t,op)\
APPLY_OP_LOOP(MPI_UINT8_T, uint8_t,op)\
APPLY_OP_LOOP(MPI_UINT16_T, uint16_t,op)\
APPLY_OP_LOOP(MPI_UINT32_T, uint32_t,op)\
APPLY_OP_LOOP(MPI_UINT64_T, uint64_t,op)\
APPLY_OP_LOOP(MPI_AINT, MPI_Aint,op)\
APPLY_OP_LOOP(MPI_OFFSET, MPI_Offset,op)\
APPLY_OP_LOOP(MPI_INTEGER1, int,op)\
APPLY_OP_LOOP(MPI_INTEGER2, int16_t,op)\
APPLY_OP_LOOP(MPI_INTEGER4, int32_t,op)\
APPLY_OP_LOOP(MPI_INTEGER8, int64_t,op)
const MPI_Datatype MPI_SIGNED_CHAR
const MPI_Datatype MPI_UINT16_T
const MPI_Datatype MPI_INT32_T
const MPI_Datatype MPI_UNSIGNED
const MPI_Datatype MPI_INT8_T
const MPI_Datatype MPI_UINT64_T
const MPI_Datatype MPI_UNSIGNED_LONG
long long MPI_Offset
Definition: smpi.h:231
const MPI_Datatype MPI_UNSIGNED_SHORT
const MPI_Datatype MPI_INTEGER4
const MPI_Datatype MPI_SHORT
const MPI_Datatype MPI_AINT
#define APPLY_OP_LOOP(dtype, type, op)
Definition: smpi_op.cpp:36
const MPI_Datatype MPI_INTEGER2
const MPI_Datatype MPI_BYTE
const MPI_Datatype MPI_INTEGER8
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38
const MPI_Datatype MPI_LONG
const MPI_Datatype MPI_WCHAR
const MPI_Datatype MPI_INTEGER1
const MPI_Datatype MPI_UINT32_T
const MPI_Datatype MPI_INT16_T
const MPI_Datatype MPI_CHAR
const MPI_Datatype MPI_UINT8_T
ptrdiff_t MPI_Aint
Definition: smpi.h:230
const MPI_Datatype MPI_UNSIGNED_LONG_LONG
const MPI_Datatype MPI_INT
const MPI_Datatype MPI_INT64_T
const MPI_Datatype MPI_LONG_LONG
const MPI_Datatype MPI_UNSIGNED_CHAR
const MPI_Datatype MPI_OFFSET

◆ APPLY_BOOL_OP_LOOP

#define APPLY_BOOL_OP_LOOP (   op)    APPLY_OP_LOOP(MPI_C_BOOL, bool,op)

◆ APPLY_FLOAT_OP_LOOP

#define APPLY_FLOAT_OP_LOOP (   op)
Value:
APPLY_OP_LOOP(MPI_DOUBLE, double,op)\
APPLY_OP_LOOP(MPI_LONG_DOUBLE, long double,op)\
APPLY_OP_LOOP(MPI_REAL, float,op)\
APPLY_OP_LOOP(MPI_REAL4, float,op)\
APPLY_OP_LOOP(MPI_REAL8, float,op)\
APPLY_OP_LOOP(MPI_REAL16, double,op)
const MPI_Datatype MPI_REAL4
const MPI_Datatype MPI_REAL8
#define APPLY_OP_LOOP(dtype, type, op)
Definition: smpi_op.cpp:36
const MPI_Datatype MPI_FLOAT
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38
const MPI_Datatype MPI_REAL16
const MPI_Datatype MPI_DOUBLE
const MPI_Datatype MPI_REAL
const MPI_Datatype MPI_LONG_DOUBLE

◆ APPLY_COMPLEX_OP_LOOP

#define APPLY_COMPLEX_OP_LOOP (   op)
Value:
APPLY_OP_LOOP(MPI_C_DOUBLE_COMPLEX, double _Complex,op)\
APPLY_OP_LOOP(MPI_C_LONG_DOUBLE_COMPLEX, long double _Complex,op)
const MPI_Datatype MPI_C_FLOAT_COMPLEX
#define APPLY_OP_LOOP(dtype, type, op)
Definition: smpi_op.cpp:36
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38
const MPI_Datatype MPI_C_LONG_DOUBLE_COMPLEX
const MPI_Datatype MPI_C_DOUBLE_COMPLEX

◆ APPLY_PAIR_OP_LOOP

#define APPLY_PAIR_OP_LOOP (   op)
Value:
APPLY_OP_LOOP(MPI_LONG_INT, long_int,op)\
APPLY_OP_LOOP(MPI_DOUBLE_INT, double_int,op)\
APPLY_OP_LOOP(MPI_SHORT_INT, short_int,op)\
APPLY_OP_LOOP(MPI_2INT, int_int,op)\
APPLY_OP_LOOP(MPI_2FLOAT, float_float,op)\
APPLY_OP_LOOP(MPI_2DOUBLE, double_double,op)\
APPLY_OP_LOOP(MPI_2LONG, long_long,op)
Definition: smpi_datatype.hpp:53
Definition: smpi_datatype.hpp:61
const MPI_Datatype MPI_2FLOAT
const MPI_Datatype MPI_LONG_INT
Definition: smpi_datatype.hpp:57
const MPI_Datatype MPI_LONG_DOUBLE_INT
const MPI_Datatype MPI_DOUBLE_INT
const MPI_Datatype MPI_SHORT_INT
Definition: smpi_datatype.hpp:33
#define APPLY_OP_LOOP(dtype, type, op)
Definition: smpi_op.cpp:36
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38
const MPI_Datatype MPI_2LONG
const MPI_Datatype MPI_FLOAT_INT
Definition: smpi_datatype.hpp:49
const MPI_Datatype MPI_2DOUBLE
Definition: smpi_datatype.hpp:45
Definition: smpi_datatype.hpp:41
const MPI_Datatype MPI_2INT
Definition: smpi_datatype.hpp:65
Definition: smpi_datatype.hpp:37

◆ APPLY_END_OP_LOOP

#define APPLY_END_OP_LOOP (   op)
Value:
{\
xbt_die("Failed to apply " #op " to type %s", (*datatype)->name());\
}
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38

◆ CREATE_MPI_OP

#define CREATE_MPI_OP (   name,
  func 
)
Value:
static SMPI_Op mpi_##name (&(func) /* func */, true ); \
MPI_Op name = &mpi_##name;
static const char * name
Definition: msg.h:186
struct SMPI_Op SMPI_Op
Definition: forward.hpp:56

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( smpi_op  ,
smpi  ,
"Logging specific to SMPI (op)"   
)

◆ max_func()

static void max_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ min_func()

static void min_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ sum_func()

static void sum_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ prod_func()

static void prod_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ land_func()

static void land_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ lor_func()

static void lor_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ lxor_func()

static void lxor_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ band_func()

static void band_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ bor_func()

static void bor_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ bxor_func()

static void bxor_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ minloc_func()

static void minloc_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ maxloc_func()

static void maxloc_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ replace_func()

static void replace_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ no_func()

static void no_func ( void a,
void b,
int *  length,
MPI_Datatype datatype 
)
static

◆ CREATE_MPI_OP() [1/14]

CREATE_MPI_OP ( MPI_MAX  ,
max_func   
)

◆ CREATE_MPI_OP() [2/14]

CREATE_MPI_OP ( MPI_MIN  ,
min_func   
)

◆ CREATE_MPI_OP() [3/14]

CREATE_MPI_OP ( MPI_SUM  ,
sum_func   
)

◆ CREATE_MPI_OP() [4/14]

CREATE_MPI_OP ( MPI_PROD  ,
prod_func   
)

◆ CREATE_MPI_OP() [5/14]

CREATE_MPI_OP ( MPI_LAND  ,
land_func   
)

◆ CREATE_MPI_OP() [6/14]

CREATE_MPI_OP ( MPI_LOR  ,
lor_func   
)

◆ CREATE_MPI_OP() [7/14]

CREATE_MPI_OP ( MPI_LXOR  ,
lxor_func   
)

◆ CREATE_MPI_OP() [8/14]

CREATE_MPI_OP ( MPI_BAND  ,
band_func   
)

◆ CREATE_MPI_OP() [9/14]

CREATE_MPI_OP ( MPI_BOR  ,
bor_func   
)

◆ CREATE_MPI_OP() [10/14]

CREATE_MPI_OP ( MPI_BXOR  ,
bxor_func   
)

◆ CREATE_MPI_OP() [11/14]

CREATE_MPI_OP ( MPI_MAXLOC  ,
maxloc_func   
)

◆ CREATE_MPI_OP() [12/14]

CREATE_MPI_OP ( MPI_MINLOC  ,
minloc_func   
)

◆ CREATE_MPI_OP() [13/14]

CREATE_MPI_OP ( MPI_REPLACE  ,
replace_func   
)

◆ CREATE_MPI_OP() [14/14]

CREATE_MPI_OP ( MPI_NO_OP  ,
no_func   
)