/************************************************************************** * * R11 is the output routine for Benchmark 11. * * This will need to be modified to contain the particular * configuration information requested. * * Parameters: * Provided by calling routine: * C = Product matrix * MODULUS = Modulus for the arithmetic * N = Size of matrices * NUMSIZE = Number of words used to hold an MP integer * ERR = Error flag * CSET = CPU time required to generate the data * WSET = Wallclock time required to generate the data * CRUN = CPU time required to do the benchmark * WRUN = Wallclock time required to do the benchmark * CCHECK = CPU time required to check the results * WCHECK = Wallclock time required to check the results * **************************************************************************/ #include "bench11.h" /* CVS info */ /* $Date: 2005/01/10 20:57:47 $ */ /* $Revision: 1.2 $ */ /* $RCSfile: r11.c,v $ */ /* $Name: rel_5 $ */ static char cvs_info[] = "BMARKGRP $Date: 2005/01/10 20:57:47 $ $Revision: 1.2 $ $RCSfile: r11.c,v $ $Name: rel_5 $"; /* use macros to address 3-dim arrays with variable dimension */ #define c(I,J,K) c[ (K) + numsize * ( (J) + n * (I) ) ] void r11 ( mplong c[], mplong modulus[], int n, int numsize, int err, double cset, double wset, double crun, double wrun, double ccheck, double wcheck ) { int i, j, k; mplong tempc [ maxnumsize ]; char datestg[26]; char * date(); printf ("Benchmark #11 -- Multiprecision Arithmetic\n"); printf("Date: %s", date()); printf ( "Size of matrices = %d \n", n ); printf ( "Modulus: \n" ); fflush(stdout); mpwrite(modulus); printf ("\n"); printf ( "Time for set up: \n" ); printf ( "time: Setup CPU = %f seconds \n", cset ); printf ( "time: Setup Wall = %f seconds \n\n", wset ); printf ( "Time to run: \n" ); printf ( "time: Run CPU = %f seconds \n", crun ); printf ( "time: Run Wall = %f seconds \n\n", wrun ); printf ( "Time to check results: \n" ); printf ( "time: Check CPU = %f seconds \n", ccheck ); printf ( "time: Check Wall = %f seconds \n\n", wcheck ); /* status returned by check routine */ if (err == 0) printf ( "No errors found \n" ); if (err < 0) { printf ( "The results for given input parameters are unknown. \n" ); printf ( "No checking is possible. \n" ); } if (err == 1) printf ( "ERROR: Results do not agree with previous results. \n" ); /* finished first half of output -- now print out selected results */ /* selected entries */ for ( i = 0; i < n; i += n/3 ) for ( j = 0; j < n; j += n/4 ) { printf ( "C(%4d,%4d ) =:\n", i+1, j+1 ); fflush(stdout); mpwrite( &c(i,j,0) ); } /* C(N,N) */ printf ( "C(%4d,%4d ) =:\n", n, n ); fflush(stdout); mpwrite( &c(n-1,n-1,0 )); printf ( "\n" ); }