No matching regions

4 views
Skip to first unread message

mst...@mpi-sws.org

unread,
Jul 15, 2024, 2:43:36 PM7/15/24
to ptools-...@icl.utk.edu
I am trying to do a fairly straightforward and simple measurement using PAPI. There is a function that I want to profile and I use the high-level API to start and end the region that I want to profile, but after my program ends no output file is generated and I get the error “PAPI-HL Warning: Cannot generate output due to not matching regions.”

This is the code I am using to profile

void handle_error (int retval)
{
printf("PAPI error %d: %s\n", retval, PAPI_strerror(retval));
exit(1);
}


int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
{
// ...
int retval = PAPI_hl_region_begin("computation");
if ( retval != PAPI_OK )
handle_error(retval);
/* Do some computation here */
int ret = __epoll_wait(epfd, events, maxevents, timeout);
retval = PAPI_hl_region_end("computation");
if ( retval != PAPI_OK )
handle_error(retval);
// ...
}

The epoll_wait function gets called multiple times. I don’t know if it’s an issue when using PAPI to call PAPI_hl_region_begin(“computation”) and PAPI_hl_region_end(“computation”) multiple times. I thought that might be an issue because when I add an exit(0) call immediately after PAPI_hl_region_end the output is generated properly. How can I use the PAPI API to have multiple regions (each used to profile a different function), where each function may be called multiple times?












Frank Winkler

unread,
Jul 16, 2024, 3:00:53 AM7/16/24
to mst...@mpi-sws.org, ptools-...@icl.utk.edu
Hi,

The high-level API should actually work as you describe. Perhaps a sub-function terminates the program prematurely?

You could use the following environment variables:

export PAPI_HL_VERBOSE=1
export PAPI_DEBUG=HIGHLEVEL

This could provide information about where there is a mismatch.

Best,
Frank

--
You received this message because you are subscribed to the Google Groups "ptools-perfapi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ptools-perfap...@icl.utk.edu.
To view this discussion on the web visit https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/5D56396F-B952-444A-9D7F-7E03B4E517C4%40mpi-sws.org.

Treece Burgess

unread,
Jul 16, 2024, 6:31:52 AM7/16/24
to mst...@mpi-sws.org, ptools-...@icl.utk.edu
Hello,

I have created a similar workflow to the one you have described in the second paragraph and have attached it to this email. From this workflow, I do not run into any issue with calling PAPI_hl_region_begin("computation") and PAPI_hl_region_end("computation") multiple times. The directory is generated and when I look at the .json file, I see three entries which correspond to the number of iterations in the for loop I declared.

With the source file I attached, I am able to recreate the error PAPI-HL Warning: Cannot generate output due to not matching regions only when I call PAPI_hl_region_begin("computation"), but never make it to the call PAPI_hl_region_end("computation"). Therefore based on the code snippet that you provided, I believe an error might occur in __epoll_wait() which does not allow you to make it to the call of PAPI_hl_region_end("computation").

Best wishes,

Treece


test_workflow_hl.c
Reply all
Reply to author
Forward
0 new messages