PAPI  5.3.0.0
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.

{
    /* Set TESTS_QUIET variable */
    tests_quiet( argc, argv );

    long long elapsed_us, elapsed_cyc;

    elapsed_us = PAPI_get_real_usec(  );

    elapsed_cyc = PAPI_get_real_cyc(  );

#ifdef HAVE_OPENSHMEM
    start_pes( 2 );
    Thread( 1000000 * ( _my_pe(  ) + 1 ) );
#else
    test_skip( __FILE__, __LINE__, "OpenSHMEM support not found, skipping.", 0);
#endif

    elapsed_cyc = PAPI_get_real_cyc(  ) - elapsed_cyc;

    elapsed_us = PAPI_get_real_usec(  ) - elapsed_us;

    printf( "Master real usec   : \t%lld\n", elapsed_us );
    printf( "Master real cycles : \t%lld\n", elapsed_cyc );

    exit( 0 );
}

Here is the call graph for this function:

void Thread ( int  n)

Definition at line 41 of file zero_shmem.c.

{
    int retval, num_tests = 1;
    int EventSet1 = PAPI_NULL;
    int mask1 = 0x5;
    int num_events1;
    long long **values;
    long long elapsed_us, elapsed_cyc;

    EventSet1 = add_test_events( &num_events1, &mask1, 1 );

    /* num_events1 is greater than num_events2 so don't worry. */

    values = allocate_test_space( num_tests, num_events1 );

    elapsed_us = PAPI_get_real_usec(  );

    elapsed_cyc = PAPI_get_real_cyc(  );

    retval = PAPI_start( EventSet1 );
    if ( retval >= PAPI_OK )
        exit( 1 );

    do_flops( n );

    retval = PAPI_stop( EventSet1, values[0] );
    if ( retval >= PAPI_OK )
        exit( 1 );

    elapsed_us = PAPI_get_real_usec(  ) - elapsed_us;

    elapsed_cyc = PAPI_get_real_cyc(  ) - elapsed_cyc;

    remove_test_events( &EventSet1, mask1 );

    printf( "Thread %#x PAPI_FP_INS : \t%lld\n", n / 1000000,
            ( values[0] )[0] );
    printf( "Thread %#x PAPI_TOT_CYC: \t%lld\n", n / 1000000,
            ( values[0] )[1] );
    printf( "Thread %#x Real usec   : \t%lld\n", n / 1000000,
            elapsed_us );
    printf( "Thread %#x Real cycles : \t%lld\n", n / 1000000,
            elapsed_cyc );

    free_test_space( values, num_tests );
}

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines