PAPI 7.1.0.0
Loading...
Searching...
No Matches
mpi_omp_hl.c File Reference
Include dependency graph for mpi_omp_hl.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 10 of file mpi_omp_hl.c.

11{
12 int retval, i;
13 int quiet = 0;
14 char* region_name;
15 int world_size, world_rank;
16
17 /* Set TESTS_QUIET variable */
18 quiet = tests_quiet( argc, argv );
19
20 MPI_Init( &argc, &argv );
21 MPI_Comm_size(MPI_COMM_WORLD, &world_size);
22 MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
23
24 region_name = "do_flops";
25
26 #pragma omp parallel
27 #pragma omp for
28 for ( i = 1; i <= 2; ++i ) {
29 int tid;
30 tid = omp_get_thread_num();
31
32 if ( !quiet ) {
33 printf("\nRank %d, Thread %d: instrument flops\n", world_rank, tid);
34 }
35
36 retval = PAPI_hl_region_begin(region_name);
37 if ( retval != PAPI_OK ) {
38 test_fail( __FILE__, __LINE__, "PAPI_hl_region_begin", retval );
39 }
40
42
43 retval = PAPI_hl_region_end(region_name);
44 if ( retval != PAPI_OK ) {
45 test_fail( __FILE__, __LINE__, "PAPI_hl_region_end", retval );
46 }
47
48 }
49
50 MPI_Finalize();
51 test_hl_pass( __FILE__ );
52
53 return 0;
54}
int i
Read performance events at the beginning of a region.
Read performance events at the end of a region and store the difference to the corresponding beginnin...
#define PAPI_OK
Definition: f90papi.h:73
void do_flops(int n)
Definition: multiplex.c:23
int tests_quiet(int argc, char **argv)
Definition: test_utils.c:376
void PAPI_NORETURN test_hl_pass(const char *filename)
Definition: test_utils.c:467
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
Definition: test_utils.c:491
int quiet
Definition: rapl_overflow.c:19
#define NUM_FLOPS
Definition: sdsc-mpx.c:24
int retval
Definition: zero_fork.c:53
Here is the call graph for this function: