Skip to content

Commit

Permalink
chore(build): update build.sbt
Browse files Browse the repository at this point in the history
Improves a comment inside the build.sbt file

chore(README): update README

Adds the missing acknowledgements inside the README
  • Loading branch information
mcolmant committed Jan 22, 2015
1 parent 72996ec commit cb844ca
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 17 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ We all stand on the shoulders of giants and get by with a little help from our f
* [Typesage Config](https://github.com/typesafehub/config) (version 1.2.1 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for reading configuration files.
* [Apache log4j2](http://logging.apache.org/log4j/2.x/) (version 2.1 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for logging outside actors.
* [powerspy.scala](https://github.com/Spirals-Team/powerspy.scala) (version 1.0.1 under [AGPL license](http://www.gnu.org/licenses/agpl-3.0.html)), for using the [PowerSpy powermeter](http://www.alciom.com/en/products/powerspy2-en-gb-2.html).
* [BridJ](https://code.google.com/p/bridj/) (version 0.6.2 under [BSD-2-Clause licence](https://github.com/ochafik/nativelibs4java/blob/master/libraries/BridJ/LICENSE)), for system or C calls.
* [Breeze](https://github.com/scalanlp/breeze) (version 0.10 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for numerical processing.
* [perfmon2](http://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/) (version 4.6.0 under [MIT licence](http://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/COPYING)), for accessing hardware performance counters.

# Licence
This software is licensed under the *GNU Affero General Public License*, quoted below.
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ parallelExecution in Test := false

instrumentSettings

// Use this task for testing the PowerSpy powermeter in the test suite
// Use this task to be able to use the PowerSpy powermeter.
val downloadBluecoveLibs = TaskKey[Seq[File]]("download-bluecove")

downloadBluecoveLibs := {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of PowerAPI.
*
* Copyright (C) 2011-2014 Inria, University of Lille 1.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* PowerAPI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with PowerAPI.
*
* If not, please consult http://www.gnu.org/licenses/agpl-3.0.html.
*/
package org.powerapi.configuration

import org.powerapi.core.Configuration

/**
* Sampling configuration.
*
* @author Maxime Colmant <[email protected]>
*/
trait SamplingConfiguration {
self: Configuration =>

import java.util.concurrent.TimeUnit
import org.powerapi.core.ConfigValue
import scala.concurrent.duration.{DurationDouble, FiniteDuration}

lazy val samplingInterval: FiniteDuration = load { _.getDuration("powerapi.sampling.interval", TimeUnit.MILLISECONDS) } match {
case ConfigValue(value) => value.milliseconds
case _ => 1.seconds
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
package org.powerapi.module.libpfm.cycles

import org.powerapi.configuration.SamplingConfiguration
import org.powerapi.core.{Configuration, MessageBus}
import org.powerapi.module.FormulaComponent
import org.powerapi.module.libpfm.PerformanceCounterChannel.PCReport
Expand All @@ -35,41 +36,34 @@ import org.powerapi.module.libpfm.PerformanceCounterChannel.PCReport
*
* @author Maxime Colmant <[email protected]>
*/
class LibpfmCoreCyclesFormula(eventBus: MessageBus) extends FormulaComponent[PCReport](eventBus) with Configuration {
class LibpfmCoreCyclesFormula(eventBus: MessageBus) extends FormulaComponent[PCReport](eventBus) with SamplingConfiguration with Configuration {
import breeze.numerics.polyval
import com.typesafe.config.Config
import java.util.concurrent.TimeUnit
import org.powerapi.core.ConfigValue
import org.powerapi.module.libpfm.PerformanceCounterChannel.subscribePCReport
import org.powerapi.module.PowerChannel.publishPowerReport
import org.powerapi.module.PowerUnit
import scala.collection.JavaConversions._
import scala.concurrent.duration.{DurationDouble, FiniteDuration}
import scala.concurrent.Future

lazy val cyclesThreadName: String = load { _.getString("powerapi.libpfm.cycles-thread") } match {
lazy val cyclesThreadName: String = load { _.getString("powerapi.libpfm.formulae.cycles-thread") } match {
case ConfigValue(value) => value
case _ => "CPU_CLK_UNHALTED:THREAD_P"
}

lazy val cyclesRefName: String = load { _.getString("powerapi.libpfm.cycles-ref") } match {
lazy val cyclesRefName: String = load { _.getString("powerapi.libpfm.formulae.cycles-ref") } match {
case ConfigValue(value) => value
case _ => "CPU_CLK_UNHALTED:REF_P"
}

lazy val formulae: Map[Double, Array[Double]] = load { conf =>
(for (item: Config <- conf.getConfigList("powerapi.libpfm-cycles-formulae"))
(for (item: Config <- conf.getConfigList("powerapi.libpfm.formulae.cycles"))
yield (item.getDouble("coefficient"), item.getDoubleList("formula").map(_.toDouble).toArray)).toMap
} match {
case ConfigValue(values) => values
case _ => Map()
}

lazy val samplingInterval: FiniteDuration = load { _.getDuration("powerapi.sampling.interval", TimeUnit.MILLISECONDS) } match {
case ConfigValue(value) => value.milliseconds
case _ => 1.seconds
}

def subscribeSensorReport(): Unit = {
subscribePCReport(eventBus)(self)
}
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ include "akka"
include "configuration-suite"
include "dvfs-cpuformula-suite"
include "libpfm-cycles-formula-suite"
include "sampling-suite"
8 changes: 3 additions & 5 deletions src/test/resources/libpfm-cycles-formula-suite.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
powerapi.libpfm.cycles-thread = "CPU_CLK_UNHALTED:THREAD_P"
powerapi.libpfm.formulae.cycles-thread = "CPU_CLK_UNHALTED:THREAD_P"

powerapi.libpfm.cycles-ref = "CPU_CLK_UNHALTED:REF_P"
powerapi.libpfm.formulae.cycles-ref = "CPU_CLK_UNHALTED:REF_P"

powerapi.libpfm-cycles-formulae = [
powerapi.libpfm.formulae.cycles = [
{ coefficient = 12, formula = [85.7545270697,1.10006565433e-08,-2.0341944068e-18] }
{ coefficient = 13, formula = [87.0324917754,9.03486530986e-09,-1.31575869787e-18] }
{ coefficient = 14, formula = [86.3094440375,1.04895773556e-08,-1.61982669617e-18] }
Expand All @@ -15,5 +15,3 @@ powerapi.libpfm-cycles-formulae = [
{ coefficient = 21, formula = [94.4635683042,4.83140424765e-09,4.25218895447e-20] }
{ coefficient = 22, formula = [104.356371072,3.75414807806e-09,6.73289818651e-20] }
]

powerapi.sampling.interval = 1second
1 change: 1 addition & 0 deletions src/test/resources/sampling-suite.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powerapi.sampling.interval = 1second

0 comments on commit cb844ca

Please sign in to comment.