PAPI 7.1.0.0
Loading...
Searching...
No Matches
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

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 70 of file zero_shmem.c.

71{
72 int quiet;
73 long long elapsed_us, elapsed_cyc;
74
75 /* Set TESTS_QUIET variable */
76 quiet=tests_quiet( argc, argv );
77
79
81
82#ifdef HAVE_OPENSHMEM
83 /* Start 2 processing elements (SHMEM call) */
84 start_pes( 2 );
85 Thread( 1000000 * ( _my_pe( ) + 1 ) );
86#else
87 if (!quiet) {
88 printf("No OpenSHMEM support\n");
89 }
90 test_skip( __FILE__, __LINE__, "OpenSHMEM support not found, skipping.", 0);
91#endif
92
94
96
97 printf( "Master real usec : \t%lld\n", elapsed_us );
98 printf( "Master real cycles : \t%lld\n", elapsed_cyc );
99
100 return 0;
101}
get real time counter value in clock cycles Returns the total real time passed since some arbitrary s...
get real time counter value in microseconds
int tests_quiet(int argc, char **argv)
Definition: test_utils.c:376
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
Definition: test_utils.c:584
int quiet
Definition: rapl_overflow.c:19
long long elapsed_cyc
Definition: zero_fork.c:50
long long elapsed_us
Definition: zero_fork.c:50
void Thread(int n)
Definition: zero_shmem.c:20
Here is the call graph for this function:

◆ Thread()

void Thread ( int  n)

Definition at line 20 of file zero_shmem.c.

21{
22 int retval, num_tests = 1;
23 int EventSet1 = PAPI_NULL;
24 int mask1 = 0x5;
25 int num_events1;
26 long long **values;
27 long long elapsed_us, elapsed_cyc;
28
30
31 /* num_events1 is greater than num_events2 so don't worry. */
32
34
36
38
40
41 /* we should indicate failure somehow, not just exit */
42 if ( retval != PAPI_OK )
43 exit( 1 );
44
45 do_flops( n );
46
48 if ( retval != PAPI_OK )
49 exit( 1 );
50
52
54
56
57 printf( "Thread %#x PAPI_FP_INS : \t%lld\n", n / 1000000,
58 ( values[0] )[0] );
59 printf( "Thread %#x PAPI_TOT_CYC: \t%lld\n", n / 1000000,
60 ( values[0] )[1] );
61 printf( "Thread %#x Real usec : \t%lld\n", n / 1000000,
62 elapsed_us );
63 printf( "Thread %#x Real cycles : \t%lld\n", n / 1000000,
65
67}
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_NULL
Definition: f90papi.h:78
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
void do_flops(int n)
Definition: multiplex.c:23
int add_test_events(int *number, int *mask, int allow_derived)
Definition: test_utils.c:152
void free_test_space(long long **values, int num_tests)
Definition: test_utils.c:70
long long ** allocate_test_space(int num_tests, int num_events)
Definition: test_utils.c:46
int remove_test_events(int *EventSet, int mask)
Definition: test_utils.c:201
int EventSet1
Definition: zero_fork.c:47
int num_events1
Definition: zero_fork.c:49
int mask1
Definition: zero_fork.c:48
int num_tests
Definition: zero_fork.c:53
int retval
Definition: zero_fork.c:53
Here is the call graph for this function:
Here is the caller graph for this function: