/*************************************************************************/ /* */ /* Copyright (c) 1994 Stanford University */ /* */ /* All rights reserved. */ /* */ /* Permission is given to use, copy, and modify this software for any */ /* non-commercial purpose as long as this copyright notice is not */ /* removed. All other uses, including redistribution in whole or in */ /* part, are forbidden without prior written permission. */ /* */ /* This software is provided with absolutely no warranty and no */ /* support. */ /* */ /*************************************************************************/ EXTERN_ENV #include #include #include "decs.h" void subblock() { long i; long j; long k; long xportion; long xextra; long yportion; long yextra; long my_num; /* Determine starting coord and number of points to process in */ /* each direction */ for (i=0;i= xprocs) { gp[i].neighbors[UP] = i-xprocs; } if (i < nprocs-xprocs) { gp[i].neighbors[DOWN] = i+xprocs; } if ((i % xprocs) > 0) { gp[i].neighbors[LEFT] = i-1; } if ((i % xprocs) < (xprocs-1)) { gp[i].neighbors[RIGHT] = i+1; } j = gp[i].neighbors[UP]; if (j != -1) { if ((j % xprocs) > 0) { gp[i].neighbors[UPLEFT] = j-1; } if ((j % xprocs) < (xprocs-1)) { gp[i].neighbors[UPRIGHT] = j+1; } } j = gp[i].neighbors[DOWN]; if (j != -1) { if ((j % xprocs) > 0) { gp[i].neighbors[DOWNLEFT] = j-1; } if ((j % xprocs) < (xprocs-1)) { gp[i].neighbors[DOWNRIGHT] = j+1; } } } for (i=0;i