Commit 94304c6d authored by Gaurav Kukreja's avatar Gaurav Kukreja

Changes to Presentation and code by Viktor

 * Changes provided by Viktor have been pushed in gauss1by4 and gauss4by1
Signed-off-by: 's avatarGaurav Kukreja <mailme.gaurav@gmail.com>
parent f8cf7da1
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
#define FALSE 0 #define FALSE 0
#define TRUE 1 #define TRUE 1
#define INTERLEAVING_COUNT 1024 #define INTERLEAVING_COUNT 10
#include "input.h" #include "input.h"
#include "heat.h" #include "heat.h"
#include "timing.h" #include "timing.h"
...@@ -113,6 +114,7 @@ int main( int argc, char *argv[] ) ...@@ -113,6 +114,7 @@ int main( int argc, char *argv[] )
usage(argv[0]); usage(argv[0]);
} }
if (rank==0)
fprintf(stderr, "Resolution: %5u\r", param.act_res); fprintf(stderr, "Resolution: %5u\r", param.act_res);
// full size (param.act_res are only the inner points) // full size (param.act_res are only the inner points)
......
...@@ -74,6 +74,7 @@ void print_params( algoparam_t *param ) ...@@ -74,6 +74,7 @@ void print_params( algoparam_t *param )
{ {
int i; int i;
fprintf(stderr, "Number of Threads: (%d x %d)\n", param->thread_dims[0], param->thread_dims[1]);
fprintf(stderr, "Resolutions : (%u, %u, ... %u)\n", fprintf(stderr, "Resolutions : (%u, %u, ... %u)\n",
param->initial_res, param->initial_res,
param->initial_res + param->res_step_size, param->initial_res + param->res_step_size,
......
...@@ -87,7 +87,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count, ...@@ -87,7 +87,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count,
} }
// Receive border values from bottom block // Request receive border values from bottom block
if (rank_bottom != -1) if (rank_bottom != -1)
{ {
if(k>0) if(k>0)
...@@ -111,7 +111,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count, ...@@ -111,7 +111,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count,
} }
} }
// Receive border values from bottom block // Wait for receive border values from bottom block
if (rank_bottom != -1) if (rank_bottom != -1)
{ {
if (k>0) if (k>0)
...@@ -122,7 +122,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count, ...@@ -122,7 +122,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count,
} }
} }
// do the calculation for the lower right border // calculate the bottom row
i = size_y-2; i = size_y-2;
for( j=1; j<size_x-1; j++ ) for( j=1; j<size_x-1; j++ )
{ {
...@@ -150,7 +150,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count, ...@@ -150,7 +150,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count,
// Receive border values from bottom block // Receive border values from bottom block
if (rank_bottom != -1) if (rank_bottom != -1)
{ {
MPI_Recv(&(param->u[(size_y-1)*size_x+ j]), size_y - 2, MPI_DOUBLE, rank_right, 10, comm2d, &status); MPI_Recv(&(param->u[(size_y-1)*size_x+ 1]), size_x - 2, MPI_DOUBLE, rank_bottom, 10, comm2d, &status);
} }
} }
......
1 16 # x and y dimensions for threads 1 4 # x and y dimensions for threads
1024 # iterations 50 # iterations
256 # initial resolution 256 # initial resolution
4096 # max resolution (spatial resolution) 4096 # max resolution (spatial resolution)
3840 # resolution step size 3840 # resolution step size
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define FALSE 0 #define FALSE 0
#define TRUE 1 #define TRUE 1
#define INTERLEAVING_COUNT 1024 #define INTERLEAVING_COUNT 10
#include "input.h" #include "input.h"
#include "heat.h" #include "heat.h"
...@@ -93,6 +93,10 @@ int main( int argc, char *argv[] ) ...@@ -93,6 +93,10 @@ int main( int argc, char *argv[] )
param.sendbuf_right = 0; param.sendbuf_right = 0;
param.recbuf_left = 0; param.recbuf_left = 0;
param.recbuf_right =0; param.recbuf_right =0;
param.sendbuf_top =0;
param.sendbuf_bottom = 0;
param.recbuf_top = 0;
param.recbuf_bottom =0;
param.act_res = param.initial_res; param.act_res = param.initial_res;
......
...@@ -35,6 +35,7 @@ typedef struct ...@@ -35,6 +35,7 @@ typedef struct
double *u, *uhelp; double *u, *uhelp;
double *sendbuf_left, *recbuf_left, *sendbuf_right, *recbuf_right; double *sendbuf_left, *recbuf_left, *sendbuf_right, *recbuf_right;
double *sendbuf_top, *recbuf_top, *sendbuf_bottom, *recbuf_bottom;
unsigned numsrcs; // number of heat sources unsigned numsrcs; // number of heat sources
heatsrc_t *heatsrcs; heatsrc_t *heatsrcs;
......
...@@ -74,6 +74,7 @@ void print_params( algoparam_t *param ) ...@@ -74,6 +74,7 @@ void print_params( algoparam_t *param )
{ {
int i; int i;
fprintf(stderr, "Number of Threads: (%d x %d)\n", param->thread_dims[0], param->thread_dims[1]);
fprintf(stderr, "Resolutions : (%u, %u, ... %u)\n", fprintf(stderr, "Resolutions : (%u, %u, ... %u)\n",
param->initial_res, param->initial_res,
param->initial_res + param->res_step_size, param->initial_res + param->res_step_size,
......
...@@ -100,7 +100,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count, ...@@ -100,7 +100,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count,
} }
} }
// do the calculation for the left + inner part // do the calculation for the inner part
for( i=1; i < size_y-1; i++ ) for( i=1; i < size_y-1; i++ )
{ {
for( j=2; j<size_x-2; j++ ) for( j=2; j<size_x-2; j++ )
......
16 1 # x and y dimensions for threads 4 1 # x and y dimensions for threads
1024 # iterations 50 # iterations
256 # initial resolution 256 # initial resolution
4096 # max resolution (spatial resolution) 4096 # max resolution (spatial resolution)
3840 # resolution step size 3840 # resolution step size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment