SimGrid  3.18
Versatile Simulation of Distributed Systems
reduce-rab.cpp File Reference
#include "../colls_private.hpp"
#include <cstdio>
#include <cstdlib>

Namespaces

 simgrid
 Alltoall Bruck.
 
 simgrid::smpi
 

Macros

#define REDUCE_NEW_ALWAYS   1
 
#define REDUCE_LIMITS
 
#define MPI_I_Sendrecv(sb, sc, sd, dest, st, rb, rc, rd, source, rt, comm, stat)   Request::sendrecv(sb,sc,sd,dest,st,rb,rc,rd,source,rt,comm,stat)
 
#define MPI_I_DO_OP_C_INTEGER(MPI_I_do_op_TYPE, TYPE)
 
#define MPI_I_DO_OP_FP(MPI_I_do_op_TYPE, TYPE)
 
#define MPI_I_DO_OP_BYTE(MPI_I_do_op_TYPE, TYPE)
 
#define MPI_I_DO_OP_CALL(MPI_I_do_op_TYPE, TYPE)   MPI_I_do_op_TYPE ((TYPE*)b1, (TYPE*)b2, (TYPE*)rslt, cnt, op); break;
 
#define OLDRANK(new)   ((new) < r ? (new)*2 : (new)+r)
 
#define OLDRANK(new)   ((new) < r ? (new)*2 : (new)+r)
 
#define OLDRANK(new)
 

Enumerations

enum  MPIM_Datatype {
  MPIM_SHORT, MPIM_INT, MPIM_LONG, MPIM_UNSIGNED_SHORT,
  MPIM_UNSIGNED, MPIM_UNSIGNED_LONG, MPIM_UNSIGNED_LONG_LONG, MPIM_FLOAT,
  MPIM_DOUBLE, MPIM_BYTE
}
 
enum  MPIM_Op {
  MPIM_MAX, MPIM_MIN, MPIM_SUM, MPIM_PROD,
  MPIM_LAND, MPIM_BAND, MPIM_LOR, MPIM_BOR,
  MPIM_LXOR, MPIM_BXOR
}
 

Functions

static void MPI_I_do_op (void *b1, void *b2, void *rslt, int cnt, MPIM_Datatype datatype, MPIM_Op op)
 
static int simgrid::smpi::MPI_I_anyReduce (void *Sendbuf, void *Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op, int root, MPI_Comm comm, int is_all)
 

Macro Definition Documentation

◆ REDUCE_NEW_ALWAYS

#define REDUCE_NEW_ALWAYS   1

◆ REDUCE_LIMITS

#define REDUCE_LIMITS
Value:
/* values are lower limits for count arg. */ \
/* routine = reduce allreduce */ \
/* size = 2, 3,2**n,other 2, 3,2**n,other */ \
static int Lsh[2][4]={{ 1, 1, 1, 1},{ 1, 1, 1, 1}}; \
static int Lin[2][4]={{ 1, 1, 1, 1},{ 1, 1, 1, 1}}; \
static int Llg[2][4]={{ 1, 1, 1, 1},{ 1, 1, 1, 1}}; \
static int Lfp[2][4]={{ 1, 1, 1, 1},{ 1, 1, 1, 1}}; \
static int Ldb[2][4]={{ 1, 1, 1, 1},{ 1, 1, 1, 1}}; \
static int Lby[2][4]={{ 1, 1, 1, 1},{ 1, 1, 1, 1}};

◆ MPI_I_Sendrecv

#define MPI_I_Sendrecv (   sb,
  sc,
  sd,
  dest,
  st,
  rb,
  rc,
  rd,
  source,
  rt,
  comm,
  stat 
)    Request::sendrecv(sb,sc,sd,dest,st,rb,rc,rd,source,rt,comm,stat)

◆ MPI_I_DO_OP_C_INTEGER

#define MPI_I_DO_OP_C_INTEGER (   MPI_I_do_op_TYPE,
  TYPE 
)
Value:
static void MPI_I_do_op_TYPE(TYPE* b1,TYPE* b2,TYPE* rslt, int cnt,MPIM_Op op)\
{ int i; \
switch (op) { \
case MPIM_MAX : \
for(i=0;i<cnt;i++) rslt[i] = (b1[i]>b2[i]?b1[i]:b2[i]); break; \
case MPIM_MIN : \
for(i=0;i<cnt;i++) rslt[i] = (b1[i]<b2[i]?b1[i]:b2[i]); break; \
case MPIM_SUM :for(i=0;i<cnt;i++) rslt[i] = b1[i] + b2[i]; break; \
case MPIM_PROD:for(i=0;i<cnt;i++) rslt[i] = b1[i] * b2[i]; break; \
case MPIM_LAND:for(i=0;i<cnt;i++) rslt[i] = b1[i] && b2[i]; break; \
case MPIM_LOR :for(i=0;i<cnt;i++) rslt[i] = b1[i] || b2[i]; break; \
case MPIM_LXOR:for(i=0;i<cnt;i++) rslt[i] = b1[i] != b2[i]; break; \
case MPIM_BAND:for(i=0;i<cnt;i++) rslt[i] = b1[i] & b2[i]; break; \
case MPIM_BOR :for(i=0;i<cnt;i++) rslt[i] = b1[i] | b2[i]; break; \
case MPIM_BXOR:for(i=0;i<cnt;i++) rslt[i] = b1[i] ^ b2[i]; break; \
default: break; \
} \
}
Definition: reduce-rab.cpp:426
Definition: reduce-rab.cpp:435
Definition: reduce-rab.cpp:432
Definition: reduce-rab.cpp:428
Definition: reduce-rab.cpp:431
MPIM_Op
Definition: reduce-rab.cpp:425
Definition: reduce-rab.cpp:434
Definition: reduce-rab.cpp:429
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38
Definition: reduce-rab.cpp:430
Definition: reduce-rab.cpp:427
Definition: reduce-rab.cpp:433

◆ MPI_I_DO_OP_FP

#define MPI_I_DO_OP_FP (   MPI_I_do_op_TYPE,
  TYPE 
)
Value:
static void MPI_I_do_op_TYPE(TYPE* b1,TYPE* b2,TYPE* rslt, int cnt,MPIM_Op op) \
{ int i; \
switch (op) { \
case MPIM_MAX : \
for(i=0;i<cnt;i++) rslt[i] = (b1[i]>b2[i]?b1[i]:b2[i]); break; \
case MPIM_MIN : \
for(i=0;i<cnt;i++) rslt[i] = (b1[i]<b2[i]?b1[i]:b2[i]); break; \
case MPIM_SUM :for(i=0;i<cnt;i++) rslt[i] = b1[i] + b2[i]; break; \
case MPIM_PROD:for(i=0;i<cnt;i++) rslt[i] = b1[i] * b2[i]; break; \
default: break; \
} \
}
Definition: reduce-rab.cpp:426
Definition: reduce-rab.cpp:428
MPIM_Op
Definition: reduce-rab.cpp:425
Definition: reduce-rab.cpp:429
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38
Definition: reduce-rab.cpp:427

◆ MPI_I_DO_OP_BYTE

#define MPI_I_DO_OP_BYTE (   MPI_I_do_op_TYPE,
  TYPE 
)
Value:
static void MPI_I_do_op_TYPE(TYPE* b1,TYPE* b2,TYPE* rslt, int cnt,MPIM_Op op)\
{ int i; \
switch (op) { \
case MPIM_BAND:for(i=0;i<cnt;i++) rslt[i] = b1[i] & b2[i]; break; \
case MPIM_BOR :for(i=0;i<cnt;i++) rslt[i] = b1[i] | b2[i]; break; \
case MPIM_BXOR:for(i=0;i<cnt;i++) rslt[i] = b1[i] ^ b2[i]; break; \
default: break; \
} \
}
Definition: reduce-rab.cpp:435
Definition: reduce-rab.cpp:431
MPIM_Op
Definition: reduce-rab.cpp:425
void int MPI_Datatype int MPI_Aint int MPI_Datatype MPI_Op op
Definition: smpi_mpi.cpp:38
Definition: reduce-rab.cpp:433

◆ MPI_I_DO_OP_CALL

#define MPI_I_DO_OP_CALL (   MPI_I_do_op_TYPE,
  TYPE 
)    MPI_I_do_op_TYPE ((TYPE*)b1, (TYPE*)b2, (TYPE*)rslt, cnt, op); break;

◆ OLDRANK [1/3]

#define OLDRANK (   new)    ((new) < r ? (new)*2 : (new)+r)

◆ OLDRANK [2/3]

#define OLDRANK (   new)    ((new) < r ? (new)*2 : (new)+r)

◆ OLDRANK [3/3]

#define OLDRANK (   new)
Value:
((new)==newroot ? root \
: ((new)<r ? (new)*2 : (new)+r) )
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 int root
Definition: smpi_mpi.cpp:50

Enumeration Type Documentation

◆ MPIM_Datatype

Enumerator
MPIM_SHORT 
MPIM_INT 
MPIM_LONG 
MPIM_UNSIGNED_SHORT 
MPIM_UNSIGNED 
MPIM_UNSIGNED_LONG 
MPIM_UNSIGNED_LONG_LONG 
MPIM_FLOAT 
MPIM_DOUBLE 
MPIM_BYTE 

◆ MPIM_Op

enum MPIM_Op
Enumerator
MPIM_MAX 
MPIM_MIN 
MPIM_SUM 
MPIM_PROD 
MPIM_LAND 
MPIM_BAND 
MPIM_LOR 
MPIM_BOR 
MPIM_LXOR 
MPIM_BXOR 

Function Documentation

◆ MPI_I_do_op()

static void MPI_I_do_op ( void b1,
void b2,
void rslt,
int  cnt,
MPIM_Datatype  datatype,
MPIM_Op  op 
)
static