Nek5000
SEM for Incompressible NS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros | Functions | Variables
comm.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <float.h>
#include "name.h"
#include "fail.h"
#include "types.h"
#include "tensor.h"
#include "gs_defs.h"
#include "gs_local.h"
#include "comm.h"
+ Include dependency graph for comm.c:

Go to the source code of this file.

Macros

#define SWITCH_OP_CASE(T, OP)   case gs_##OP: WITH_OP(T,OP); break;
 
#define SWITCH_OP(T, op)
 
#define WITH_OP(T, OP)   do { T v = *in++; GS_DO_##OP(accum,v); } while(--n)
 
#define DEFINE_REDUCE(T)
 

Functions

static void scan_imp (void *scan, const struct comm *com, gs_dom dom, gs_op op, const void *v, uint vn, void *buffer)
 
static void allreduce_imp (const struct comm *com, gs_dom dom, gs_op op, void *v, uint vn, void *buf)
 
void comm_scan (void *scan, const struct comm *com, gs_dom dom, gs_op op, const void *v, uint vn, void *buffer)
 
void comm_allreduce (const struct comm *com, gs_dom dom, gs_op op, void *v, uint vn, void *buf)
 
double comm_dot (const struct comm *comm, double *v, double *w, uint n)
 

Variables

uint comm_gbl_id =0
 
uint comm_gbl_np =1
 

Macro Definition Documentation

#define DEFINE_REDUCE (   T)
Value:
T PREFIXED_NAME(comm_reduce__##T)( \
const struct comm *comm, gs_op op, const T *in, uint n) \
{ \
T accum = gs_identity_##T[op], buf; \
if(n!=0) SWITCH_OP(T,op); \
comm_allreduce(comm,gs_##T,op, &accum,1, &buf); \
return accum; \
}
#define uint
Definition: types.h:70
#define SWITCH_OP(T, op)
Definition: comm.c:153
double T
Definition: gs_test.c:14
n
Definition: xxt_test.m:73
void comm_allreduce(const struct comm *com, gs_dom dom, gs_op op, void *v, uint vn, void *buf)
Definition: comm.c:107
Definition: comm.h:85
gs_op
Definition: gs_defs.h:77
#define PREFIXED_NAME(x)
Definition: name.h:25

Definition at line 159 of file comm.c.

#define SWITCH_OP (   T,
  op 
)
Value:
do switch(op) { \
GS_FOR_EACH_OP(T,SWITCH_OP_CASE) case gs_op_n: break; } while(0)
double T
Definition: gs_test.c:14
#define GS_FOR_EACH_OP(T, macro)
Definition: gs_defs.h:26
#define SWITCH_OP_CASE(T, OP)
Definition: comm.c:152

Definition at line 153 of file comm.c.

#define SWITCH_OP_CASE (   T,
  OP 
)    case gs_##OP: WITH_OP(T,OP); break;

Definition at line 152 of file comm.c.

#define WITH_OP (   T,
  OP 
)    do { T v = *in++; GS_DO_##OP(accum,v); } while(--n)

Definition at line 156 of file comm.c.

Function Documentation

static void allreduce_imp ( const struct comm com,
gs_dom  dom,
gs_op  op,
void *  v,
uint  vn,
void *  buf 
)
static

Definition at line 67 of file comm.c.

References comm_recv(), comm_send(), dom, gs_gather_array, comm::id, n, np, comm::np, and uint.

Referenced by comm_allreduce().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void comm_allreduce ( const struct comm com,
gs_dom  dom,
gs_op  op,
void *  v,
uint  vn,
void *  buf 
)

Definition at line 107 of file comm.c.

References allreduce_imp(), and comm::c.

Referenced by allreduce_exec(), comm_dot(), crs_stats(), dry_run_time(), gs_setup_aux(), and hash_bb().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double comm_dot ( const struct comm comm,
double *  v,
double *  w,
uint  n 
)

Definition at line 143 of file comm.c.

References comm_allreduce(), and tensor_dot.

+ Here is the call graph for this function:

void comm_scan ( void *  scan,
const struct comm com,
gs_dom  dom,
gs_op  op,
const void *  v,
uint  vn,
void *  buffer 
)

Definition at line 101 of file comm.c.

References scan_imp().

Referenced by main(), and shared_ids().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void scan_imp ( void *  scan,
const struct comm com,
gs_dom  dom,
gs_op  op,
const void *  v,
uint  vn,
void *  buffer 
)
static

Definition at line 19 of file comm.c.

References comm_irecv(), comm_isend(), comm_recv(), comm_send(), comm_wait(), dom, gs_gather_array, gs_init_array, n, np, and uint.

Referenced by comm_scan().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

uint comm_gbl_id =0

Definition at line 14 of file comm.c.

uint comm_gbl_np =1

Definition at line 14 of file comm.c.