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.

00090 {
00091     /* Set TESTS_QUIET variable */
00092     tests_quiet( argc, argv );
00093 
00094     long long elapsed_us, elapsed_cyc;
00095 
00096     elapsed_us = PAPI_get_real_usec(  );
00097 
00098     elapsed_cyc = PAPI_get_real_cyc(  );
00099 
00100 #ifdef HAVE_OPENSHMEM
00101     start_pes( 2 );
00102     Thread( 1000000 * ( _my_pe(  ) + 1 ) );
00103 #else
00104     test_skip( __FILE__, __LINE__, "OpenSHMEM support not found, skipping.", 0);
00105 #endif
00106 
00107     elapsed_cyc = PAPI_get_real_cyc(  ) - elapsed_cyc;
00108 
00109     elapsed_us = PAPI_get_real_usec(  ) - elapsed_us;
00110 
00111     printf( "Master real usec   : \t%lld\n", elapsed_us );
00112     printf( "Master real cycles : \t%lld\n", elapsed_cyc );
00113 
00114     exit( 0 );
00115 }

Here is the call graph for this function:

void Thread ( int  n  ) 

Definition at line 41 of file zero_shmem.c.

00042 {
00043     int retval, num_tests = 1;
00044     int EventSet1 = PAPI_NULL;
00045     int mask1 = 0x5;
00046     int num_events1;
00047     long long **values;
00048     long long elapsed_us, elapsed_cyc;
00049 
00050     EventSet1 = add_test_events( &num_events1, &mask1, 1 );
00051 
00052     /* num_events1 is greater than num_events2 so don't worry. */
00053 
00054     values = allocate_test_space( num_tests, num_events1 );
00055 
00056     elapsed_us = PAPI_get_real_usec(  );
00057 
00058     elapsed_cyc = PAPI_get_real_cyc(  );
00059 
00060     retval = PAPI_start( EventSet1 );
00061     if ( retval >= PAPI_OK )
00062         exit( 1 );
00063 
00064     do_flops( n );
00065 
00066     retval = PAPI_stop( EventSet1, values[0] );
00067     if ( retval >= PAPI_OK )
00068         exit( 1 );
00069 
00070     elapsed_us = PAPI_get_real_usec(  ) - elapsed_us;
00071 
00072     elapsed_cyc = PAPI_get_real_cyc(  ) - elapsed_cyc;
00073 
00074     remove_test_events( &EventSet1, mask1 );
00075 
00076     printf( "Thread %#x PAPI_FP_INS : \t%lld\n", n / 1000000,
00077             ( values[0] )[0] );
00078     printf( "Thread %#x PAPI_TOT_CYC: \t%lld\n", n / 1000000,
00079             ( values[0] )[1] );
00080     printf( "Thread %#x Real usec   : \t%lld\n", n / 1000000,
00081             elapsed_us );
00082     printf( "Thread %#x Real cycles : \t%lld\n", n / 1000000,
00083             elapsed_cyc );
00084 
00085     free_test_space( values, num_tests );
00086 }

Here is the call graph for this function:


Generated on 8 Sep 2016 for PAPI by  doxygen 1.6.1