/* This is an output routine for Benchmark 8, part b, large sparse matrices. This routine will need to be modified to contain the particular configuration information requested. Parameters: Provided by calling routine: N = Size of A matrices K = Number of A matrices. L = Number of non-zeros in each row and column of each A matrix T = Length of B array -1 D2 = Used to determine partitions of T Z = Probability of best path ZZ = Expected path probability B = Sequences of steps on a maximal path CSET = CPU time required to do the setup WSET = Wall clock time required to do the setup CRUN = CPU time required to do the benchmark WRUN = Wall clock time required to do the benchmark IER = Error flag */ #include #include "bench8sc.h" /* CVS info */ /* $Date: 2005/01/10 21:15:00 $ */ /* $Revision: 1.2 $ */ /* $RCSfile: r8s_upc.c,v $ */ /* $Name: rel_5 $ */ static char cvs_info[] = "BMARKGRP $Date: 2005/01/10 21:15:00 $ $Revision: 1.2 $ $RCSfile: r8s_upc.c,v $ $Name: rel_5 $"; #ifndef _SYS_TIME_H #include #endif void r8s(int n, int k, int l, int t, int d2, double z, double zz, int32 b[DLEN+1], double cset, double wset, double crun, double wrun, int ier) { struct timeval tp; struct timezone tzp; int ret,i,d1,j,jj; char *cret; printf("\n\n\nBenchmark #8 -- Dynamic Program \n Large Sparse Matrices\n"); printf(" UPC \n"); ret = gettimeofday(&tp,&tzp); if (ret) { printf(" getttimeofday returned %d\n",ret); exit(-1); } cret = ctime(&tp.tv_sec); printf("Date: %s\n\n",cret); d1 = t/d2; printf("Matrix Size = %d\n",n); printf("Entries per column = %d\n",l); printf("Number of matrices = %d\n",k); printf("Length of solution = %d\n",t); printf("Partition sizes = %d %d\n\n",d1, d2); printf("Time for set up: \n"); printf("CPU = %12.4f seconds\n",cset); printf("Wall Clock = %12.4f seconds\n",wset); printf("Time to run: \n"); printf("CPU = %12.4f seconds\n",crun); printf("Wall Clock = %12.4f seconds\n\n",wrun); printf("Lg probability of path = %16.4f\n\n",z); printf("A few of the steps are:\n"); printf("Steps 0 through 19\n"); for(i=0;i<10;i++) printf("%8d",b[i]+1); printf("\n"); for(i=10;i<20;i++) printf("%8d",b[i]+1); printf("\n\n"); j = t/2; jj = j+19; printf("Steps %d through %d\n",j,jj); for(i=j;i