GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
sell_kacz_bmc.c File Reference
#include "ghost/sell_kacz_bmc.h"
Include dependency graph for sell_kacz_bmc.c:

Macros

#define NVECS   1
 
#define CHUNKHEIGHT   1
 
#define FORWARD_LOOP(start, end)
 
#define BACKWARD_LOOP(start, end)
 
#define LOOP(start, end, stride)
 
#define LOCK_NEIGHBOUR(tid)
 
#define FORWARD_SHIFT_LOOP(start, end)
 
#define BACKWARD_SHIFT_LOOP(start, end)
 
#define SHIFT_LOOP(start, end, stride)
 

Functions

ghost_error ghost_initialize_kacz_bmc (ghost_sparsemat *mat, ghost_densemat *b, ghost_kacz_opts opts)
 
ghost_error ghost_kacz_bmc (ghost_densemat *x, ghost_sparsemat *mat, ghost_densemat *b, ghost_kacz_opts opts)
 
ghost_error ghost_kacz_shift_bmc (ghost_densemat *x_real, ghost_densemat *x_imag, ghost_sparsemat *mat, ghost_densemat *b, double sigma_r, double sigma_i, ghost_kacz_opts opts)
 

Macro Definition Documentation

#define BACKWARD_LOOP (   start,
  end 
)
Value:
for (ghost_lidx row=start; row>end; --row){ \
double rownorm = 0.; \
double scal = 0; \
ghost_lidx idx = mat->chunkStart[row]; \
\
if(bval != NULL) \
scal = -bval[row]; \
for (ghost_lidx j=0; j<mat->rowLen[row]; ++j) { \
scal += (double)mval[idx] * xval[mat->col[idx]]; \
if(opts.normalize==GHOST_KACZ_NORMALIZE_NO) \
rownorm += mval[idx]*mval[idx]; \
idx += 1; \
} \
if(opts.normalize==GHOST_KACZ_NORMALIZE_NO){ \
scal /= (double)rownorm; \
} \
scal *= omega; \
idx -= mat->rowLen[row]; \
\
_Pragma("simd vectorlength(4)") \
for (ghost_lidx j=0; j<mat->rowLen[row]; j++) { \
xval[mat->col[idx]] = xval[mat->col[idx]] - scal * (double)mval[idx];\
idx += 1; \
} \
} \
int32_t ghost_lidx
Definition: types.h:503
Definition: sparsemat.h:93
#define BACKWARD_SHIFT_LOOP (   start,
  end 
)
#define CHUNKHEIGHT   1
#define FORWARD_LOOP (   start,
  end 
)
Value:
for (ghost_lidx row=start; row<end; ++row){ \
double rownorm = 0.; \
double scal = 0; \
ghost_lidx idx = mat->chunkStart[row]; \
\
if(bval != NULL) \
scal = -bval[row]; \
for (ghost_lidx j=0; j<mat->rowLen[row]; ++j) { \
scal += (double)mval[idx] * xval[mat->col[idx]]; \
if(opts.normalize==GHOST_KACZ_NORMALIZE_NO) \
rownorm += mval[idx]*mval[idx]; \
idx += 1; \
} \
if(opts.normalize==GHOST_KACZ_NORMALIZE_NO){ \
scal /= (double)rownorm; \
} \
scal *= omega; \
idx -= mat->rowLen[row]; \
\
_Pragma("simd vectorlength(4)") \
for (ghost_lidx j=0; j<mat->rowLen[row]; j++) { \
xval[mat->col[idx]] = xval[mat->col[idx]] - scal * (double)mval[idx];\
idx += 1; \
} \
} \
int32_t ghost_lidx
Definition: types.h:503
Definition: sparsemat.h:93
#define FORWARD_SHIFT_LOOP (   start,
  end 
)
#define LOCK_NEIGHBOUR (   tid)
Value:
if(tid == 0) \
flag[0] = zone+1; \
if(tid == nthreads-1) \
flag[nthreads+1] = zone+1; \
\
flag[tid+1] = zone+1; \
_Pragma("omp flush") \
\
if(opts.direction == GHOST_KACZ_DIRECTION_FORWARD) { \
while(flag[tid+2]<zone+1){ \
_Pragma("omp flush") \
} \
} else { \
while(flag[tid]<zone+1 ){ \
_Pragma("omp flush") \
} \
}
Definition: sparsemat.h:86
#define LOOP (   start,
  end,
  stride 
)
Value:
for (ghost_lidx row=start; row!=end; row+=stride){ \
double rownorm = 0.; \
double scal = 0; \
ghost_lidx idx = mat->chunkStart[row]; \
\
if(bval != NULL) \
scal = -bval[row]; \
for (ghost_lidx j=0; j<mat->rowLen[row]; ++j) { \
scal += (double)mval[idx] * xval[mat->col[idx]]; \
if(opts.normalize==GHOST_KACZ_NORMALIZE_NO) \
rownorm += mval[idx]*mval[idx]; \
idx += 1; \
} \
if(opts.normalize==GHOST_KACZ_NORMALIZE_NO){ \
scal /= (double)rownorm; \
} \
scal *= omega; \
idx -= mat->rowLen[row]; \
\
_Pragma("simd vectorlength(4)") \
for (ghost_lidx j=0; j<mat->rowLen[row]; j++) { \
xval[mat->col[idx]] = xval[mat->col[idx]] - scal * (double)mval[idx];\
idx += 1; \
} \
} \
int32_t ghost_lidx
Definition: types.h:503
Definition: sparsemat.h:93
#define NVECS   1
#define SHIFT_LOOP (   start,
  end,
  stride 
)

Function Documentation

ghost_error ghost_initialize_kacz_bmc ( ghost_sparsemat mat,
ghost_densemat b,
ghost_kacz_opts  opts 
)
ghost_error ghost_kacz_bmc ( ghost_densemat x,
ghost_sparsemat mat,
ghost_densemat b,
ghost_kacz_opts  opts 
)

Here is the call graph for this function:

ghost_error ghost_kacz_shift_bmc ( ghost_densemat x_real,
ghost_densemat x_imag,
ghost_sparsemat mat,
ghost_densemat b,
double  sigma_r,
double  sigma_i,
ghost_kacz_opts  opts 
)

Here is the call graph for this function: