PAPI 5.1.1 OpenMP: EventSet currently counting

Open discussion of PAPI.

PAPI 5.1.1 OpenMP: EventSet currently counting

Postby exastr » Thu Aug 15, 2013 2:46 pm

I'm trying to profile some OpenMP code in C with PAPI 5.1.1 as follows on Intel Xeon, Ubuntu 12.04.2:

Outside the parallel region, init PAPI and PAPI_thread_init(), allocate arrays int *EventSets of length num_threads, and long long **values of dimensions num_threads x num_events. Initialize each EventSet to PAPI_NULL.

Then in the parallel region, each thread calls

PAPI_start(EventSets[thread_id]);
do_flops();
PAPI_stop(EventSets[thread_id],values[thread_id]);

This results in the following error if num_threads > 1, some of the time for some threads: "EventSet is currently counting." Sometimes all threads are able to start their respective EventSet and count properly. But most of the time one or more will fail (but never all of the threads fail to count). Each thread reports a unique thread ID, as well as a unique EventSet handle.

Any ideas on why this sometimes occurs, and sometimes not? Thanks
exastr
 
Posts: 2
Joined: Thu Aug 15, 2013 12:41 pm

Re: PAPI 5.1.1 OpenMP: EventSet currently counting

Postby exastr » Thu Aug 15, 2013 4:54 pm

I found out how to fix this:

PAPI_create_eventset needs to be called inside the parallel region by each thread for its respective EventSet rather than having thread 0 create the EventSet for each thread serially outside the parallel block. I am not sure why, exactly, I suspect it has to do with components with which I admit I am completely unfamiliar with as I have only recently begun using PAPI.

If anyone could explain what is going on, it'd be appreciated. Thanks
exastr
 
Posts: 2
Joined: Thu Aug 15, 2013 12:41 pm

Re: PAPI 5.1.1 OpenMP: EventSet currently counting

Postby solsys12 » Wed Feb 12, 2014 5:32 am

This may be because PAPI works for per thread, hence the eventset that you first created for thread 0 will monitor that thread only.
Try setting the ganularity level to per process and then try it.
solsys12
 
Posts: 5
Joined: Wed Feb 12, 2014 5:00 am

Re: PAPI 5.1.1 OpenMP: EventSet currently counting

Postby solsys12 » Wed Feb 12, 2014 5:35 am

This may be because , PAPI works for per thread by default and hence in former case will monitr only thread 0.
Try changing the granularity level to per process and then trying your previous approac.
solsys12
 
Posts: 5
Joined: Wed Feb 12, 2014 5:00 am


Return to General discussion

Who is online

Users browsing this forum: No registered users and 3 guests