#ifndef lint static char vcid[] = "$Id: mpiov.c,v 1.3 1996/01/23 17:16:39 balay Exp balay $"; #endif #include "mpiaij.h" int MatIncreaseOverlap_MPIAIJ(Mat A, int is_max, IS *is, int ov) { Mat_MPIAIJ *a = (Mat_MPIAIJ *) A->data; int **idx, *n, *w1, *w2, *w3, *w4, *rtable, size, rank, m, i, j, ierr ; int row, proc, mct, msz, **outdat, **ptr, *ctr; /* assume overlap = 1 */ if (ismax<1) return 0; size = a->size; rank = a->rank; m = a->M; idx = (int **)PetscMalloc((is_max)*sizeof(int *)); n = (int *)PetscMalloc((is_max)*sizeof(int )); rtable = (int *)PetscMalloc((m+1)*sizeof(int )); /* Hash table for maping row ->proc */ for ( i=0 ; i proc*/ for( i=0, j=0; i< size; ++i) { for (; j rowners[i+1]; ++j) { rtable[j] = i; } } /* evaluate communication - mesg to who, length of mesg, and buffer space required. Based on this, buffers are allocated, and data copied into them*/ w1 = (int *)PetscMalloc((size)*2*sizeof(int )); /* foreach proc mesg size */ w2 = w1 + size; /* if w2[i] marked, then a message to proc i*/ w3 = w2 + size; /* no of IS that needs to be sent to proc i */ w4 = w3 + size; /* temp work space used in determining w1, w2, w3 */ PetscMemzero(w1,(size)*3*sizeof(int)); /* initialise work vector*/ for ( i=0; i