This code provides a wrapper for C++ of the Score-P plugin interface. The wrapper hides most of the low-level C details, such as memory handling, object lifetimes, etc., from the plugin developer. To do so, the plugin developer only has to write a class, which inherits from the plugin base class.
The wrapper should support all possible combinations of plugins, which the original Score-P plugin interface supports.
To compile this wrapper and thus your plugin, you need:
- a C++14 compiler
- Score-P
The whole wrapper makes heavily use of C++14 features, so you'll need a compliant compiler.
If you are using CMake, just add this folder with the add_subdirectory() command and link your target against the Scorep::scorep-plugin-cxx library:
add_subdirectory(scorep)
target_link_library(MyMetricPlugin PRIVATE Scorep::scorep-plugin-cxx)
In order to write a simple plugin with the wrapper, you have to:
#include <scorep/plugin/plugin.hpp>
Then you create a class, e.g., my_first_plugin
, which inherits from the base class
scorep::plugin::base
. The base class needs several template arguments. The first argument is your
plugin class itself. The following template arguments are the used policies.
class my_first_plugin
: public scorep::plugin::base<my_first_plugin, Policies...>
Then you have to define the - for your set of policies required - member functions in your plugin class.
Finally, you insert the following macro at the bottom of your file. The first argument is again
your plugin class and the second argument is the plugin name. The name should match the name of
the .so
library for your plugin, e.g., libmy_first_plugin.so
matches to my_first
.
SCOREP_METRIC_PLUGIN_CLASS(my_first_plugin, "my_first")
The plugin name determines the output added, when a message is logged, and the prefix for environment variables.
The detailed documentation for this wrapper can be found in the Wiki.
- Check whether the plugin library can be loaded from the
LD_LIBRARY_PATH
. - Check, whether the include path is set corretly and you are building with
-std=c++14
. - Open an issue.