/scratch_na/users/xoserete/qaas_runs/171-318-9587/intel/stream/build/stream/src/stream.c: 213 - 555
--------------------------------------------------------------------------------

213:     {
[...]
223:     printf(HLINE);
224:     printf("STREAM version $Revision: 5.10 $\n");
225:     printf(HLINE);
226:     BytesPerWord = sizeof(STREAM_TYPE);
227:     printf("This system uses %d bytes per array element.\n",
228: 	BytesPerWord);
229: 
230:     printf(HLINE);
[...]
239:     printf("Array size = %llu (elements), Offset = %d (elements)\n" , (unsigned long long) STREAM_ARRAY_SIZE, OFFSET);
240:     printf("Memory per array = %.1f MiB (= %.1f GiB).\n", 
241: 	BytesPerWord * ( (double) STREAM_ARRAY_SIZE / 1024.0/1024.0),
242: 	BytesPerWord * ( (double) STREAM_ARRAY_SIZE / 1024.0/1024.0/1024.0));
243:     printf("Total memory required = %.1f MiB (= %.1f GiB).\n",
244: 	(3.0 * BytesPerWord) * ( (double) STREAM_ARRAY_SIZE / 1024.0/1024.),
245: 	(3.0 * BytesPerWord) * ( (double) STREAM_ARRAY_SIZE / 1024.0/1024./1024.));
246:     printf("Each kernel will be executed %d times.\n", NTIMES);
247:     printf(" The *best* time for each kernel (excluding the first iteration)\n"); 
248:     printf(" will be used to compute the reported bandwidth.\n");
249: 
250: #ifdef _OPENMP
251:     printf(HLINE);
252: #pragma omp parallel 
[...]
263: 	k = 0;
264: #pragma omp parallel
265: #pragma omp atomic 
266: 		k++;
267:     printf ("Number of Threads counted = %i\n",k);
268: #endif
269: 
270:     /* Get initial value for system clock. */
271: #pragma omp parallel for
[...]
278:     printf(HLINE);
279: 
280:     if  ( (quantum = checktick()) >= 1) 
281: 	printf("Your clock granularity/precision appears to be "
282: 	    "%d microseconds.\n", quantum);
283:     else {
284: 	printf("Your clock granularity appears to be "
[...]
290: #pragma omp parallel for
291:     for (j = 0; j < STREAM_ARRAY_SIZE; j++)
292: 		a[j] = 2.0E0 * a[j];
293:     t = 1.0E6 * (mysecond() - t);
294: 
295:     printf("Each test below will take on the order"
296: 	" of %d microseconds.\n", (int) t  );
297:     printf("   (= %d clock ticks)\n", (int) (t/quantum) );
298:     printf("Increase the size of the arrays if this shows that\n");
299:     printf("you are not getting at least 20 clock ticks per test.\n");
300: 
301:     printf(HLINE);
302: 
303:     printf("WARNING -- The above is only a rough guideline.\n");
304:     printf("For best results, please be sure you know the\n");
305:     printf("precision of your system timer.\n");
306:     printf(HLINE);
307:     
308:     /*	--- MAIN LOOP --- repeat test cases NTIMES times --- */
309: 
310:     scalar = 3.0;
311:     for (k=0; k<NTIMES; k++)
[...]
318: #pragma omp parallel for
319: 	for (j=0; j<STREAM_ARRAY_SIZE; j++)
320: 	    c[j] = a[j];
321: #endif
322: #endif
323: 	times[0][k] = mysecond() - times[0][k];
[...]
330: #pragma omp parallel for
331: 	for (j=0; j<STREAM_ARRAY_SIZE; j++)
332: 	    b[j] = scalar*c[j];
333: #endif
334: #endif
335: 	times[1][k] = mysecond() - times[1][k];
[...]
342: #pragma omp parallel for
343: 	for (j=0; j<STREAM_ARRAY_SIZE; j++)
344: 	    c[j] = a[j]+b[j];
345: #endif
346: #endif
347: 	times[2][k] = mysecond() - times[2][k];
[...]
354: #pragma omp parallel for
355: 	for (j=0; j<STREAM_ARRAY_SIZE; j++)
356: 	    a[j] = b[j]+scalar*c[j];
357: #endif
358: #endif
359: 	times[3][k] = mysecond() - times[3][k];
360: 	}
361: 
362:     /*	--- SUMMARY --- */
363: 
364:     for (k=1; k<NTIMES; k++) /* note -- skip first iteration */
365: 	{
366: 	for (j=0; j<4; j++)
367: 	    {
368: 	    avgtime[j] = avgtime[j] + times[j][k];
369: 	    mintime[j] = MIN(mintime[j], times[j][k]);
370: 	    maxtime[j] = MAX(maxtime[j], times[j][k]);
371: 	    }
372: 	}
373:     
374:     printf("Function    Best Rate MB/s  Avg time     Min time     Max time\n");
375:     for (j=0; j<4; j++) {
376: 		avgtime[j] = avgtime[j]/(double)(NTIMES-1);
377: 
378: 		printf("%s%12.1f  %11.6f  %11.6f  %11.6f\n", label[j],
379: 	       1.0E-06 * bytes[j]/mintime[j],
380: 	       avgtime[j],
381: 	       mintime[j],
382: 	       maxtime[j]);
383:     }
384:     printf(HLINE);
[...]
390:     printf(HLINE);
391: 
392:     return 0;
[...]
405:     for (i = 0; i < M; i++) {
406: 	t1 = mysecond();
407: 	while( ((t2=mysecond()) - t1) < 1.0E-6 )
408: 	    ;
409: 	timesfound[i] = t1 = t2;
[...]
419:     for (i = 1; i < M; i++) {
420: 	Delta = (int)( 1.0E6 * (timesfound[i]-timesfound[i-1]));
421: 	minDelta = MIN(minDelta, MAX(Delta,0));
[...]
440:         i = gettimeofday(&tp,&tzp);
441:         return ( (double) tp.tv_sec + (double) tp.tv_usec * 1.e-6 );
[...]
464: 	for (k=0; k<NTIMES; k++)
465:         {
466:             cj = aj;
467:             bj = scalar*cj;
468:             cj = aj+bj;
469:             aj = bj+scalar*cj;
[...]
476: 	for (j=0; j<STREAM_ARRAY_SIZE; j++) {
477: 		aSumErr += abs(a[j] - aj);
478: 		bSumErr += abs(b[j] - bj);
479: 		cSumErr += abs(c[j] - cj);
480: 		// if (j == 417) printf("Index 417: c[j]: %f, cj: %f\n",c[j],cj);	// MCCALPIN
481: 	}
482: 	aAvgErr = aSumErr / (STREAM_TYPE) STREAM_ARRAY_SIZE;
483: 	bAvgErr = bSumErr / (STREAM_TYPE) STREAM_ARRAY_SIZE;
484: 	cAvgErr = cSumErr / (STREAM_TYPE) STREAM_ARRAY_SIZE;
[...]
498: 	if (abs(aAvgErr/aj) > epsilon) {
499: 		err++;
500: 		printf ("Failed Validation on array a[], AvgRelAbsErr > epsilon (%e)\n",epsilon);
501: 		printf ("     Expected Value: %e, AvgAbsErr: %e, AvgRelAbsErr: %e\n",aj,aAvgErr,abs(aAvgErr)/aj);
502: 		ierr = 0;
503: 		for (j=0; j<STREAM_ARRAY_SIZE; j++) {
504: 			if (abs(a[j]/aj-1.0) > epsilon) {
[...]
514: 		printf("     For array a[], %d errors were found.\n",ierr);
515: 	}
516: 	if (abs(bAvgErr/bj) > epsilon) {
517: 		err++;
518: 		printf ("Failed Validation on array b[], AvgRelAbsErr > epsilon (%e)\n",epsilon);
519: 		printf ("     Expected Value: %e, AvgAbsErr: %e, AvgRelAbsErr: %e\n",bj,bAvgErr,abs(bAvgErr)/bj);
520: 		printf ("     AvgRelAbsErr > Epsilon (%e)\n",epsilon);
521: 		ierr = 0;
522: 		for (j=0; j<STREAM_ARRAY_SIZE; j++) {
523: 			if (abs(b[j]/bj-1.0) > epsilon) {
[...]
533: 		printf("     For array b[], %d errors were found.\n",ierr);
534: 	}
535: 	if (abs(cAvgErr/cj) > epsilon) {
536: 		err++;
537: 		printf ("Failed Validation on array c[], AvgRelAbsErr > epsilon (%e)\n",epsilon);
538: 		printf ("     Expected Value: %e, AvgAbsErr: %e, AvgRelAbsErr: %e\n",cj,cAvgErr,abs(cAvgErr)/cj);
539: 		printf ("     AvgRelAbsErr > Epsilon (%e)\n",epsilon);
540: 		ierr = 0;
541: 		for (j=0; j<STREAM_ARRAY_SIZE; j++) {
542: 			if (abs(c[j]/cj-1.0) > epsilon) {
[...]
552: 		printf("     For array c[], %d errors were found.\n",ierr);
553: 	}
554: 	if (err == 0) {
555: 		printf ("Solution Validates: avg error less than %e on all three arrays\n",epsilon);
