PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
zero_shmem.c File Reference
Include dependency graph for zero_shmem.c:

Go to the source code of this file.

Functions

void Thread (int n)
 
int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 89 of file zero_shmem.c.

90 {
91  /* Set TESTS_QUIET variable */
92  tests_quiet( argc, argv );
93 
94  long long elapsed_us, elapsed_cyc;
95 
96  elapsed_us = PAPI_get_real_usec( );
97 
98  elapsed_cyc = PAPI_get_real_cyc( );
99 
100 #ifdef HAVE_OPENSHMEM
101  start_pes( 2 );
102  Thread( 1000000 * ( _my_pe( ) + 1 ) );
103 #else
104  test_skip( __FILE__, __LINE__, "OpenSHMEM support not found, skipping.", 0);
105 #endif
106 
107  elapsed_cyc = PAPI_get_real_cyc( ) - elapsed_cyc;
108 
109  elapsed_us = PAPI_get_real_usec( ) - elapsed_us;
110 
111  printf( "Master real usec : \t%lld\n", elapsed_us );
112  printf( "Master real cycles : \t%lld\n", elapsed_cyc );
113 
114  exit( 0 );
115 }
void test_skip(char *file, int line, char *call, int retval)
Definition: test_utils.c:614
tests_quiet(argc, argv)
#define printf
Definition: papi_test.h:125
int int argc
Definition: iozone.c:1609
char ** argv
Definition: iozone.c:1610
long long elapsed_cyc
Definition: zero_fork.c:43
void * Thread(void *arg)
long long PAPI_get_real_usec(void)
Definition: papi.c:6138
long long PAPI_get_real_cyc(void)
Definition: papi.c:6091
long long elapsed_us
Definition: zero_fork.c:43
void exit()

Here is the call graph for this function:

void Thread ( int  n)

Definition at line 41 of file zero_shmem.c.

42 {
43  int retval, num_tests = 1;
44  int EventSet1 = PAPI_NULL;
45  int mask1 = 0x5;
46  int num_events1;
47  long long **values;
48  long long elapsed_us, elapsed_cyc;
49 
50  EventSet1 = add_test_events( &num_events1, &mask1, 1 );
51 
52  /* num_events1 is greater than num_events2 so don't worry. */
53 
54  values = allocate_test_space( num_tests, num_events1 );
55 
56  elapsed_us = PAPI_get_real_usec( );
57 
58  elapsed_cyc = PAPI_get_real_cyc( );
59 
60  retval = PAPI_start( EventSet1 );
61  if ( retval >= PAPI_OK )
62  exit( 1 );
63 
64  do_flops( n );
65 
66  retval = PAPI_stop( EventSet1, values[0] );
67  if ( retval >= PAPI_OK )
68  exit( 1 );
69 
70  elapsed_us = PAPI_get_real_usec( ) - elapsed_us;
71 
72  elapsed_cyc = PAPI_get_real_cyc( ) - elapsed_cyc;
73 
74  remove_test_events( &EventSet1, mask1 );
75 
76  printf( "Thread %#x PAPI_FP_INS : \t%lld\n", n / 1000000,
77  ( values[0] )[0] );
78  printf( "Thread %#x PAPI_TOT_CYC: \t%lld\n", n / 1000000,
79  ( values[0] )[1] );
80  printf( "Thread %#x Real usec : \t%lld\n", n / 1000000,
81  elapsed_us );
82  printf( "Thread %#x Real cycles : \t%lld\n", n / 1000000,
83  elapsed_cyc );
84 
85  free_test_space( values, num_tests );
86 }
int PAPI_stop(int EventSet, long long *values)
Definition: papi.c:2232
int mask1
Definition: zero_fork.c:41
#define PAPI_NULL
Definition: fpapi.h:13
int num_events1
Definition: zero_fork.c:42
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
long long elapsed_cyc
Definition: zero_fork.c:43
void free_test_space(long long **values, int num_tests)
Definition: test_utils.c:131
int num_tests
Definition: zero_fork.c:46
void do_flops(int n)
Definition: multiplex.c:23
long long PAPI_get_real_usec(void)
Definition: papi.c:6138
long long PAPI_get_real_cyc(void)
Definition: papi.c:6091
int PAPI_start(int EventSet)
Definition: papi.c:2026
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
ssize_t retval
Definition: libasync.c:338
long long elapsed_us
Definition: zero_fork.c:43
long long ** allocate_test_space(int num_tests, int num_events)
Definition: test_utils.c:107
void exit()
int remove_test_events(int *EventSet, int mask)
Definition: test_utils.c:277
int add_test_events(int *number, int *mask, int allow_derived)
Definition: test_utils.c:213
int EventSet1
Definition: zero_fork.c:40
int n
Definition: mendes-alt.c:164

Here is the call graph for this function: