Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Macros | Functions | Variables
mg.c File Reference
#include <hitmap.h>
#include <math.h>
#include <time.h>
#include "c_randi8.h"
Include dependency graph for mg.c:

Go to the source code of this file.

Macros

#define OPT_ZU
 
#define OPT_OPERATOR_A
 
#define OPT_OPERATOR_S
 
#define OPT_RESID_BUFFER
 
#define OPT_PSINV_BUFFER
 
#define OPT_RPRJ3_BUFFER
 
#define OPT_INTERP_BUFFER
 
#define S   'S'
 
#define A   'A'
 
#define B   'B'
 
#define C   'C'
 
#define D   'D'
 
#define E   'E'
 
#define CLASS   S
 
#define k_num   5
 
#define iterations   4
 
#define k_num   8
 
#define iterations   4
 
#define k_num   8
 
#define iterations   20
 
#define k_num   9
 
#define iterations   20
 
#define k_num   10
 
#define iterations   50
 
#define k_num   11
 
#define iterations   50
 
#define k_max   (k_num-1)
 
#define epsilon   1e-8
 
#define mm   10
 
#define swap(a, b, c)
 
#define tag(dir)   (100 * (dir + 10*dim))
 
#define printfRootInternal(...)   { if( hit_Rank == 0 ) { printf(__VA_ARGS__); fflush(stdout); }}
 
#define printfRoot(...)   printfRootInternal(__VA_ARGS__)
 
#define printfAllDebug(...)
 
#define printfRootDebug(...)
 
#define printfDebug(...)
 
#define m(a, b, c)   hit_tileElemAtNoStride3(matrix,a,b,c)
 
#define A0   pow(5.0,13)
 
#define x   314159265.e0
 
#define u(a, b, c)   hit_tileElemAtNoStride3(m_u,a,b,c)
 
#define v(a, b, c)   hit_tileElemAtNoStride3(m_v,a,b,c)
 
#define r(a, b, c)   hit_tileElemAtNoStride3(m_r,a,b,c)
 
#define zu   u
 
#define x(a, b, c)   hit_tileElemAtNoStride3(m_x,a,b,c)
 
#define y(a, b, c)   hit_tileElemAtNoStride3(m_y,a,b,c)
 
#define ro(a, b, c)   hit_tileElemAtNoStride3(m_ro,a,b,c)
 
#define r(a, b, c)   hit_tileElemAtNoStride3(m_r,a,b,c)
 
#define zo(a, b, c)   hit_tileElemAtNoStride3(m_zo,a,b,c)
 
#define z(a, b, c)   hit_tileElemAtNoStride3(m_z,a,b,c)
 
#define z(a, b, c)   hit_tileElemAtNoStride3(m_z,a,b,c)
 
#define r(a, b, c)   hit_tileElemAtNoStride3(m_r,a,b,c)
 
#define r(a, b, c)   hit_tileElemAtNoStride3(m_r,a,b,c)
 

Functions

 hit_tileNewType (double)
 
void setup ()
 
void warming_up ()
 
void zero3 (HitTile_double tile)
 
void zran3 (HitTile_double matrix)
 
double power (double a, int n)
 
void bubble (double ten[mm][2], int ten_index[mm][2][3], int ind)
 
void resid (HitTile_double m_u, HitTile_double m_v, HitTile_double m_r, int k)
 
void apply_correction (HitTile_double u, HitTile_double r, int k)
 
void v_cycle (HitTile_double r, HitTile_double z, int k)
 
void rprj3 (HitTile_double m_ro, HitTile_double m_r, int k)
 
void interp (HitTile_double m_zo, HitTile_double m_z, int k)
 
void psinv (HitTile_double m_z, HitTile_double m_r, int k)
 
double norm2u3 (HitTile_double m_r, int k)
 
void free_resources ()
 
void add (HitTile_double m_x, HitTile_double m_y)
 
int main (int argc, char **argv)
 

Variables

int problem_size [3] = {32,32,32}
 
double verify_value = 0.5307707005734e-04
 
double operatorA [4] = {-8.0/3.0, 0.0, 1.0/6.0, 1.0/12.0}
 
double operatorP [4] = {1.0/2.0, 1.0/4.0, 1.0/8.0, 1.0/16.0}
 
double operatorS [4] = {-3.0/8.0, 1.0/32.0, -1.0/64.0, 0.0}
 
double operatorQ [4] = {1.0, 1.0/2.0, 1.0/4.0, 1.0/8.0}
 
HitTopology topology
 
HitLayout layout [k_num]
 
HitShape block [k_num]
 
HitShape grid [k_num]
 
HitTile_double block_u
 
HitTile_double block_v
 
HitTile_double block_z [k_num]
 
HitTile_double block_r [k_num]
 
HitPattern pattern_v
 
HitPattern pattern_r [k_num]
 
HitPattern pattern_z [k_num]
 
HitPattern pattern_z_ex [k_num]
 
HitOp op_max
 
HitOp op_min
 
HitOp op_sum
 
HitClock setupClk
 
HitClock initClk
 
HitClock processClk
 

Macro Definition Documentation

#define A   'A'

Definition at line 64 of file mg.c.

#define A0   pow(5.0,13)
#define B   'B'

Definition at line 65 of file mg.c.

#define C   'C'

Definition at line 66 of file mg.c.

#define CLASS   S

Definition at line 72 of file mg.c.

#define D   'D'

Definition at line 67 of file mg.c.

#define E   'E'

Definition at line 68 of file mg.c.

#define epsilon   1e-8

Definition at line 128 of file mg.c.

#define iterations   4

Definition at line 119 of file mg.c.

#define iterations   4

Definition at line 119 of file mg.c.

#define iterations   20

Definition at line 119 of file mg.c.

#define iterations   20

Definition at line 119 of file mg.c.

#define iterations   50

Definition at line 119 of file mg.c.

#define iterations   50

Definition at line 119 of file mg.c.

#define k_max   (k_num-1)

MAX LEVEL

Definition at line 125 of file mg.c.

#define k_num   5

PROBLEM DATA

  • k_mun: Number of levels
  • iterations: Iterations number
  • problem_size: Problem size
  • verify_value: Norm L2 value

Definition at line 118 of file mg.c.

#define k_num   8

PROBLEM DATA

  • k_mun: Number of levels
  • iterations: Iterations number
  • problem_size: Problem size
  • verify_value: Norm L2 value

Definition at line 118 of file mg.c.

#define k_num   8

PROBLEM DATA

  • k_mun: Number of levels
  • iterations: Iterations number
  • problem_size: Problem size
  • verify_value: Norm L2 value

Definition at line 118 of file mg.c.

#define k_num   9

PROBLEM DATA

  • k_mun: Number of levels
  • iterations: Iterations number
  • problem_size: Problem size
  • verify_value: Norm L2 value

Definition at line 118 of file mg.c.

#define k_num   10

PROBLEM DATA

  • k_mun: Number of levels
  • iterations: Iterations number
  • problem_size: Problem size
  • verify_value: Norm L2 value

Definition at line 118 of file mg.c.

#define k_num   11

PROBLEM DATA

  • k_mun: Number of levels
  • iterations: Iterations number
  • problem_size: Problem size
  • verify_value: Norm L2 value

Definition at line 118 of file mg.c.

#define m (   a,
  b,
 
)    hit_tileElemAtNoStride3(matrix,a,b,c)
#define mm   10

Definition at line 146 of file mg.c.

#define OPT_INTERP_BUFFER

Definition at line 56 of file mg.c.

#define OPT_OPERATOR_A

Definition at line 51 of file mg.c.

#define OPT_OPERATOR_S

Definition at line 52 of file mg.c.

#define OPT_PSINV_BUFFER

Definition at line 54 of file mg.c.

#define OPT_RESID_BUFFER

Definition at line 53 of file mg.c.

#define OPT_RPRJ3_BUFFER

Definition at line 55 of file mg.c.

#define OPT_ZU

MG Hitmap

NAS Multigrid Benchmark implemented using Hitmap library.

Version
1.0
Date
Jun 2010
Author
Javier Fresno Bausela

Definition at line 50 of file mg.c.

#define printfAllDebug (   ...)

Definition at line 240 of file mg.c.

#define printfDebug (   ...)

Definition at line 242 of file mg.c.

#define printfRoot (   ...)    printfRootInternal(__VA_ARGS__)

Definition at line 231 of file mg.c.

#define printfRootDebug (   ...)

Definition at line 241 of file mg.c.

#define printfRootInternal (   ...)    { if( hit_Rank == 0 ) { printf(__VA_ARGS__); fflush(stdout); }}

Definition at line 230 of file mg.c.

#define r (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_r,a,b,c)
#define r (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_r,a,b,c)
#define r (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_r,a,b,c)
#define r (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_r,a,b,c)
#define ro (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_ro,a,b,c)
#define S   'S'

Definition at line 63 of file mg.c.

#define swap (   a,
  b,
 
)
Value:
{ \
(c) = (a); \
(a) = (b); \
(b) = (c); \
}

Macro to swap two numbers

Definition at line 184 of file mg.c.

#define tag (   dir)    (100 * (dir + 10*dim))

Macro to calculate the tag for the communications

Definition at line 191 of file mg.c.

#define u (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_u,a,b,c)
#define v (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_v,a,b,c)
#define x   314159265.e0
#define x (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_x,a,b,c)
#define y (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_y,a,b,c)
#define z (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_z,a,b,c)
#define z (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_z,a,b,c)
#define zo (   a,
  b,
 
)    hit_tileElemAtNoStride3(m_zo,a,b,c)
#define zu   u

Function Documentation

void add ( HitTile_double  m_x,
HitTile_double  m_y 
)

Definition at line 1025 of file mg.c.

Here is the caller graph for this function:

void apply_correction ( HitTile_double  u,
HitTile_double  r,
int  k 
)

Definition at line 982 of file mg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void bubble ( double  ten[mm][2],
int  ten_index[mm][2][3],
int  ind 
)

Definition at line 846 of file mg.c.

Here is the caller graph for this function:

void free_resources ( )

Definition at line 1624 of file mg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

hit_tileNewType ( double  )
void interp ( HitTile_double  m_zo,
HitTile_double  m_z,
int  k 
)

Definition at line 1219 of file mg.c.

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Main function

Definition at line 249 of file mg.c.

Here is the call graph for this function:

double norm2u3 ( HitTile_double  m_r,
int  k 
)

Definition at line 1561 of file mg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

double power ( double  a,
int  n 
)

raises an integer, disguised as a double precision real, to an integer power

Used by zran3 to speed up pseudo-random block generator

Definition at line 821 of file mg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void psinv ( HitTile_double  m_z,
HitTile_double  m_r,
int  k 
)

Definition at line 1475 of file mg.c.

Here is the caller graph for this function:

void resid ( HitTile_double  m_u,
HitTile_double  m_v,
HitTile_double  m_r,
int  k 
)

Residual r = v - A u

Definition at line 886 of file mg.c.

Here is the caller graph for this function:

void rprj3 ( HitTile_double  m_ro,
HitTile_double  m_r,
int  k 
)

Definition at line 1071 of file mg.c.

Here is the caller graph for this function:

void setup ( )

Setup function

Definition at line 343 of file mg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void v_cycle ( HitTile_double  r,
HitTile_double  z,
int  k 
)

Definition at line 1043 of file mg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void warming_up ( )

Warming up iteration for start up.

Definition at line 1615 of file mg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void zero3 ( HitTile_double  tile)

Cleans all the given Tile to zero.

Parameters
tileThe tile to clean.

Definition at line 619 of file mg.c.

Here is the caller graph for this function:

void zran3 ( HitTile_double  matrix)

Definition at line 630 of file mg.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

HitShape block[k_num]

Definition at line 156 of file mg.c.

HitTile_double block_r[k_num]

Definition at line 165 of file mg.c.

HitTile_double block_u

Definition at line 162 of file mg.c.

HitTile_double block_v

Definition at line 163 of file mg.c.

HitTile_double block_z[k_num]

Definition at line 164 of file mg.c.

HitShape grid[k_num]

Definition at line 159 of file mg.c.

HitClock initClk

Definition at line 180 of file mg.c.

HitLayout layout[k_num]

Definition at line 150 of file mg.c.

HitOp op_max

Definition at line 174 of file mg.c.

HitOp op_min

Definition at line 175 of file mg.c.

HitOp op_sum

Definition at line 176 of file mg.c.

double operatorA[4] = {-8.0/3.0, 0.0, 1.0/6.0, 1.0/12.0}

Laplace operator

Definition at line 132 of file mg.c.

double operatorP[4] = {1.0/2.0, 1.0/4.0, 1.0/8.0, 1.0/16.0}

Restrict operator

Definition at line 134 of file mg.c.

double operatorQ[4] = {1.0, 1.0/2.0, 1.0/4.0, 1.0/8.0}

Prolongate operator

Definition at line 143 of file mg.c.

double operatorS[4] = {-3.0/8.0, 1.0/32.0, -1.0/64.0, 0.0}

Smoother operator (for class S and A)

Definition at line 137 of file mg.c.

HitPattern pattern_r[k_num]

Definition at line 169 of file mg.c.

HitPattern pattern_v

Definition at line 168 of file mg.c.

HitPattern pattern_z[k_num]

Definition at line 170 of file mg.c.

HitPattern pattern_z_ex[k_num]

Definition at line 171 of file mg.c.

int problem_size = {32,32,32}

Definition at line 85 of file mg.c.

HitClock processClk

Definition at line 181 of file mg.c.

HitClock setupClk

Definition at line 179 of file mg.c.

HitTopology topology

Definition at line 149 of file mg.c.

double verify_value = 0.5307707005734e-04

Definition at line 86 of file mg.c.