source: CIVL/examples/omp/nas-dc/common/c_print_results.c@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*****************************************************************/
2/****** C _ P R I N T _ R E S U L T S ******/
3/*****************************************************************/
4#include <stdlib.h>
5#include <stdio.h>
6#ifdef _OPENMP
7#include <omp.h>
8#endif
9
10void c_print_results( char *name,
11 char class,
12 int n1,
13 int n2,
14 int n3,
15 int niter,
16 double t,
17 double mops,
18 char *optype,
19 int passed_verification,
20 char *npbversion,
21 char *compiletime,
22 char *cc,
23 char *clink,
24 char *c_lib,
25 char *c_inc,
26 char *cflags,
27 char *clinkflags )
28{
29 int num_threads, max_threads;
30
31
32 max_threads = 1;
33 num_threads = 1;
34
35/* figure out number of threads used */
36#ifdef _OPENMP
37 max_threads = omp_get_max_threads();
38#pragma omp parallel shared(num_threads)
39{
40 #pragma omp master
41 num_threads = omp_get_num_threads();
42}
43#endif
44
45
46 printf( "\n\n %s Benchmark Completed\n", name );
47
48 printf( " Class = %c\n", class );
49
50 if( n3 == 0 ) {
51 long nn = n1;
52 if ( n2 != 0 ) nn *= n2;
53 printf( " Size = %12ld\n", nn ); /* as in IS */
54 }
55 else
56 printf( " Size = %4dx%4dx%4d\n", n1,n2,n3 );
57
58 printf( " Iterations = %12d\n", niter );
59
60 printf( " Time in seconds = %12.2f\n", t );
61
62 printf( " Total threads = %12d\n", num_threads);
63
64 printf( " Avail threads = %12d\n", max_threads);
65
66 if (num_threads != max_threads)
67 printf( " Warning: Threads used differ from threads available\n");
68
69 printf( " Mop/s total = %12.2f\n", mops );
70
71 printf( " Mop/s/thread = %12.2f\n",
72 mops/(double)num_threads );
73
74 printf( " Operation type = %24s\n", optype);
75
76 if( passed_verification < 0 )
77 printf( " Verification = NOT PERFORMED\n" );
78 else if( passed_verification )
79 printf( " Verification = SUCCESSFUL\n" );
80 else
81 printf( " Verification = UNSUCCESSFUL\n" );
82
83 printf( " Version = %12s\n", npbversion );
84
85 printf( " Compile date = %12s\n", compiletime );
86
87 printf( "\n Compile options:\n" );
88
89 printf( " CC = %s\n", cc );
90
91 printf( " CLINK = %s\n", clink );
92
93 printf( " C_LIB = %s\n", c_lib );
94
95 printf( " C_INC = %s\n", c_inc );
96
97 printf( " CFLAGS = %s\n", cflags );
98
99 printf( " CLINKFLAGS = %s\n", clinkflags );
100
101 printf( "\n\n" );
102 printf( " Please send all errors/feedbacks to:\n\n" );
103 printf( " NPB Development Team\n" );
104 printf( " npb@nas.nasa.gov\n\n\n" );
105/* printf( " Please send the results of this run to:\n\n" );
106 printf( " NPB Development Team\n" );
107 printf( " Internet: npb@nas.nasa.gov\n \n" );
108 printf( " If email is not available, send this to:\n\n" );
109 printf( " MS T27A-1\n" );
110 printf( " NASA Ames Research Center\n" );
111 printf( " Moffett Field, CA 94035-1000\n\n" );
112 printf( " Fax: 650-604-3957\n\n" ); */
113}
114
Note: See TracBrowser for help on using the repository browser.