-
Notifications
You must be signed in to change notification settings - Fork 67
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
Integration with HPCToolkit #476
Comments
@daboehme, is there any tutorial on how to add a service? I've looked at the following pages, and so far all have been too abstract or just a list of APIs rather than a tutorial to actually aid in implementing a service: http://software.llnl.gov/Caliper/CaliperBasics.html#third-party-tool-support-nvidia-nsight-intel-vtune |
The hpctoolkit interface is really simple: hpctoolkit_sampling_start(); Basically, I'm looking to add a service that will work with region filtering so that hpctoolkit will only profile the regions I care about. http://software.llnl.gov/Caliper/RegionFiltering.html Even if you could point me to a service that I could start from, that would be helpful. There's just so many and they don't all implement the same interface, so it's hard to know where to start from. |
Hi @adayton1, I don't have a good tutorial here, but for this type of service you can look at the nvtx, roctx, and vtune services. Essentially you'll derive from the |
@daboehme, I'll give that a try. Thanks! |
@daboehme, can you explain the difference between a properly nested attribute and a non-nested attribute? https://github.com/LLNL/Caliper/blob/master/src/services/nvtx/Nvtx.cpp#L122 |
Hi @adayton1 , the nested attributes form the "main" region hierarchy. The regions created by the Caliper annotation macros all fall into this category. You can create additional non-nested attributes that can overlap the main hierarchy, but it's a relatively rarely used feature. By default the AnnotationBinding class only forwards nested attributes. |
Is a service class a singleton? Do I have to worry about thread safety in on_begin and on_end? |
Also, is any error checking done behind the scenes (e.g. CALI_MARK_END("meh") where there was no CALI_MARK_BEGIN("meh"))? |
Hi @adayton1, the service class gets one object for each Caliper channel where it's active, but there is typically only one. In fact it doesn't make sense to have a binding service active multiple times. The on_begin/on_end functions can be invoked from multiple threads depending on how the target code is instrumented, so yes a good implementation should make sure to be thread safe. And yes, Caliper does check if the regions match with the CALI_MARK_BEGIN/END macros and error out if they don't. |
I'm not sure the AnnotationBinding class is going to work. NVTX and RocTX have a stack like API. HPCToolkit does not - it just has start and stop. So on an exclude region, I would need to call stop on the begin marker and potentially start on the end marker if an outer level is supposed to be timed. But if I understand correctly, on_begin and on_end for my service won't even be called for an excluded region. Or am I misunderstanding something? |
Correct, on_begin and on_end won't be called for excluded regions. But you're right, you'd have to make sure to just start/stop once at the correct stack level. |
Are there bindings to export Caliper annotations to HPCToolkit? If not, it would be very helpful to have (and my guess is that it would be fairly simple to add).
The text was updated successfully, but these errors were encountered: