/* 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 static char cvs_info[] = "BMARKGRP \$Date: 2005/01/10 21:04:37 \$ \$Revision: 1.2 \$ \$RCSfile: c8sc.c,v \$ \$Name: rel_5 \$"; void c8s(int n, int k, int l, int t, double *aa, int32 ia[NONZERO][MATRIXSIZE], int32 b[DLEN+1], long d[DLEN], double z, double *zz, int *ier, int mype, int npes) { double a[NMATRICES][NONZERO][MATRIXSIZE]; int i,j,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; for(i = 0;i DELTA) { *ier = 2; return; } /* Path Probability ok */ return; }