Generic Portable Measurement Framework for Multicore CPU and Multi-GPU Systems

Overview Download Publications Code Examples Use Cases Features License Ongoing Work Contact Acknowledgments

Heterogeneous computing systems expose different programming APIs for measuring metrics of interest, such as execution time or energy usage. MeterPU is a C++ template library that provides a simple, uniform measurement API that is both device independent and generic in the metric to be measured. The actual, platform-specific measurement functionality can be specified for each platform by plug-ins.

MeterPU poster


MeterPU is a portable "software-multimeter" library for C++.
Its current implementation supports GPU-based systems.

Main features:

Source Code and Documentation

If you use MeterPU for a publication, you should cite it as here

Current version: MeterPU v0.81

Historical versions



[1] Lu Li, Christoph Kessler. MeterPU: A Generic Measurement Abstraction API Enabling Energy-tuned Skeleton Backend Selection. Journal of Supercomputing, pages 1-16, 2016. [ bib | pdf | ppt ]


[1] Lu Li, Christoph Kessler. MeterPU: A Generic Measurement Abstraction API Enabling Energy-tuned Skeleton Backend Selection. In Proc. International Workshop on Reengineering for Parallelism in Heterogeneous Parallel Platforms (REPARA-2015) at ISPA-2015, volume 3, pages 154-159. IEEE, 2015. [ bib | pdf ]

Code Examples

  1. Measuring CPU Time
    #include <MeterPU.h>
    int main()
    		using namespace MeterPU;
    		Meter<CPU_Time> meter;
    		//Do sth here
    		std::cout<<"Time consumed is: "<<meter.get_value()<<" micro seconds."<<std::endl;
    //Output: Time consumed is: 500100 micro seconds.
  3. Measuring GPU Energy
    #include <MeterPU.h>
    #define GPU_0 0
    int main()
    		using namespace MeterPU;
    		//Initialize a meter with GPU energy of default device id 0
    		Meter< NVML_Energy<GPU_0> > meter;
    		//Do sth here, typically a cuda call, here simplified.
    		std::cout<<"Energy consumed is: "<<meter.get_value()<<" milliJ."<<std::endl;
    //Output: Energy consumed is: 87516.9 milliJ.

Use Cases

MeterPU has been used to make the SkePU skeleton programming library energy-tunable.

The following plots show that, with MeterPU, SkePU can be easily retargeted to energy tuning by automatic backend selection, here for Reduce Skeleton and for LU decomposition.
The integration can provide up to about 12x in time speedup and about 21x in energy reduction on LU decomposition, and the savings will continue to increase as problem size increases beyond the maximum used in our experiments.


MeterPU's overhead is only one extra function call, and nonobservable in our experiments.

Some Features


Software License

MeterPU is licensed under the GNU General Public License as published by the Free Software Foundation (version 3 or later). For more information, please see the license file included in the downloadable source code.

Ongoing work

MeterPU is a work in progress. Future work includes adding support for more metrics, platforms, and plug-ins.

If you would like to contribute, please let us know.


For reporting bugs, please email to "<firstname> DOT <lastname> AT liu DOT se".


This work was partly funded by the EU FP7 project EXCESS and by SeRC project OpCoReS.
We also acknowledge our colleague Erik Hansson for his constructive feedbacks for this work.