#include #include #include /* UPC Header file */ #include #define N 30 /* ----------------------------------------------------------------- */ /* Complete the grids declarations to be shared and blocked as the biggest chunk of rows */ shared [(N+2)*(N+2)/THREADS] double grid[N+2][N+2], new_grid[N+2][N+2]; /* add a new shared array, in which each thread will maintain its local execution time */ shared double runtimes[THREADS]; /* now declare dTmax_local, array of THREADS elements, as shared. This variable is used to reduce dTmax across THREADS */ shared double dTmax_local[THREADS]; /* ----------------------------------------------------------------- */ void initialize(void) { int j; for( j=1; j