A distributed and self-calibrating model-predictive controller for energy and thermal management of high-performance multicores