-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability for users to specify PAPI events in Dr Hook #27
base: develop
Are you sure you want to change the base?
Conversation
That looks all like good improvements. Thanks @Andrew-Beggs-ECMWF for doing the review + modifications of #26 . Ultimately you (or someone else?) that looks at benchmarking IFS should be happy with this feature and sign off that everything works as expected. |
This commit removes all tabs, in favour of two spaces, in files touched by ecmwf-ifs#26 and ecmwf-ifs#27.
That should be all the tabs banished : ) I found that CMake tests aren't quite powerful enough to do the tests that I was envisioning. So I think you're right that it might just be a case of a "works on my machine" guarantee, which should be fine as I've tested it on our hpc2020 machine. |
This new print clarifies what the next set of prints are referring to. It also slightly optimises the subsequent control flow.
This allows user to specify their own PAPI events (up to MAXNPAPICNTRS, defaulting to 4). This is done with the DR_HOOK_PAPI_COUNTERS flag. If the flag is not specified, and PAPI is enabled, then the following defaults will be chosen: PAPI_TOT_CYC PAPI_FP_OPS PAPI_L1_DCA PAPI_L2_DCM If an invalid event is chosen, then DrHook will simply crash will an appropriate error message.
This commit removes all tabs, in favour of two spaces, in files touched by ecmwf-ifs#26 and ecmwf-ifs#27.
Just adding a comment that I intend to do some work to this PR to better align it with how extensions are handled in #28. After that I think it should be good to go : ) |
0cf6b5d
to
b19fdd2
Compare
# Conflicts: # src/fiat/drhook/drhook.c
While PAPI code was behind #ifdefs, opt_papi was only used for toggling the printing of counters. PAPI would still be running as part of DrHook. To be inline with other options, PAPI is now behind both #ifdefs statically and if (opt_papi) dynamically.
The qualifier needed to be removed so that malloc_drhook() could be used from within drhook_papi.c. To try and retain some restricted scoping (albeit no longer enforced by the compiler), malloc_drhook() hasn't been added to a header and extern is needed to use it.
Also fixed some related white spacing
Previously nproc was initialised to 0. This meant that get_mon_out() wouldn't work as expected when not using MPI due to a bad assumption in an if statement.
This reverts commit 8a558aa.
When outputting the value of DR_HOOK_PAPI_COUNTERS, the info prefix was missing.
dr_hook_procinfo() now separates the setting of myproc & nproc from the reporting of initialising MPI. It will now initialise both myproc and nproc to 1 if DrHook is not running with MPI. To report the state of MPI, the new parameter mpi_init will be used.
Tests that any counters over MAXNPAPICNTRS are silently dropped.
Previously set_tests_properties() would fail because it couldn't find fiat_test_drhook_papi_mpi_valid_csv to add properties to. This was because fiat_test_drhook_papi_mpi_valid_csv was behind a condition that required MPI, while set_tests_properties() was not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvements!
Prevents errors of not finding a test when trying to set properties.
Used to ensure type safety between C and Fortran for DR_HOOK_PROCINFO()
Tests were accidentally searching for the wrong string in the regex check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good.
Perhaps this can be rebased on latest develop, and then I'd like @ioanhadade to test this too.
Previously papi.h was needed by drhook_papi.h, even when building without PAPI. Now it is only needed when PAPI is requested as the type is defined locally.
This PR extends #26 by allowing users to specify their own PAPI events (up to MAXNPAPICNTRS, defaulting to 4). This is done with the DR_HOOK_PAPI_COUNTERS flag. If the flag is not specified, and PAPI is enabled, then the following defaults will be chosen:
PAPI_TOT_CYC
PAPI_FP_OPS
PAPI_L1_DCA
PAPI_L2_DCM
If an invalid event is chosen, then DrHook will simply crash will an appropriate error message.
Other commits are also included, which tidy up error messages introduced in #26.
Currently in draft mode to allow for review while adding tests.