Commit 60edba14 authored by Viktor Bogischef's avatar Viktor Bogischef

Merge branch 'master' of https://code.google.com/p/supercomputer

parents fec5043e 94304c6d
......@@ -10,7 +10,8 @@
#define FALSE 0
#define TRUE 1
#define INTERLEAVING_COUNT 1024
#define INTERLEAVING_COUNT 10
#include "input.h"
#include "heat.h"
#include "timing.h"
......@@ -113,7 +114,8 @@ int main( int argc, char *argv[] )
usage(argv[0]);
}
fprintf(stderr, "Resolution: %5u\r", param.act_res);
if (rank==0)
fprintf(stderr, "Resolution: %5u\r", param.act_res);
// full size (param.act_res are only the inner points)
np = param.act_res + 2;
......
......@@ -74,6 +74,7 @@ void print_params( algoparam_t *param )
{
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",
param->initial_res,
param->initial_res + param->res_step_size,
......
......@@ -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(k>0)
......@@ -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 (k>0)
......@@ -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;
for( j=1; j<size_x-1; j++ )
{
......@@ -150,7 +150,7 @@ double relax_gauss_return_residual( algoparam_t *param, int interleaving_count,
// Receive border values from bottom block
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
1024 # iterations
1 4 # x and y dimensions for threads
50 # iterations
256 # initial resolution
4096 # max resolution (spatial resolution)
3840 # resolution step size
......
......@@ -10,7 +10,7 @@
#define FALSE 0
#define TRUE 1
#define INTERLEAVING_COUNT 1024
#define INTERLEAVING_COUNT 10
#include "input.h"
#include "heat.h"
......@@ -93,6 +93,10 @@ int main( int argc, char *argv[] )
param.sendbuf_right = 0;
param.recbuf_left = 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;
......
......@@ -35,6 +35,7 @@ typedef struct
double *u, *uhelp;
double *sendbuf_left, *recbuf_left, *sendbuf_right, *recbuf_right;
double *sendbuf_top, *recbuf_top, *sendbuf_bottom, *recbuf_bottom;
unsigned numsrcs; // number of heat sources
heatsrc_t *heatsrcs;
......
......@@ -74,6 +74,7 @@ void print_params( algoparam_t *param )
{
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",
param->initial_res,
param->initial_res + param->res_step_size,
......
......@@ -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( j=2; j<size_x-2; j++ )
......
16 1 # x and y dimensions for threads
1024 # iterations
4 1 # x and y dimensions for threads
50 # iterations
256 # initial resolution
4096 # max resolution (spatial resolution)
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