/* This is a check routine for Benchmark #8, part b, large sparse matrices. It will verify that the Lg Path Probability is correct for the path given in B. Parameters: Provided by the calling routine: N = The size of the A matrices K = The number of A matrices L = Number of non-zeros in each row and column of each A matrix T = The length of D, and one less than the length of B A = K long array of N by N matrices, packed into N by L arrays. IA = N by L array of indices for the packing of A B = T+1 long array containing the best path D = T long array of integers between 1 and K used to select the appropriate A matrix. Z = The probability of this path ZZ = Expected probability of path Returned by this routine: IER = Error code */ #include "bench8sc.h" #include #define index(N) ((N%mynum)*THREADS + N/mynum) /* CVS info */ /* \$Date: 2005/01/10 21:14:59 \$ */ /* \$Revision: 1.2 \$ */ /* \$RCSfile: c8s_upc.c,v \$ */ /* \$Name: rel_5 \$ */ static char cvs_info[] = "BMARKGRP \$Date: 2005/01/10 21:14:59 \$ \$Revision: 1.2 \$ \$RCSfile: c8s_upc.c,v \$ \$Name: rel_5 \$"; void c8s(int n, int k, int l, int t, double aa[NMATRICES][NONZERO][MATRIXSIZE/THREADS], /* pointer to the local part of a */ int32 ia[NONZERO][MATRIXSIZE], int32 b[DLEN+1], long d[DLEN], double z, double *zz, int *ier, int mype, int npes) { /*shared double a[NMATRICES][NONZERO][MATRIXSIZE];*/ extern shared double ARRAY[NMATRICES][NONZERO][MATRIXSIZE]; int i,ii,iii,j,kk,mynum,e_code; double fabs(); #define DELTA .00002 /* An allowable difference in score */ *ier = 0; /* We must gather the a matrix from all of the sites */ mynum = n/npes; /* First check the score */ *zz = 0; for (i=0;i DELTA) { *ier = 2; return; } /* Path Probability ok */ return; }