From 1f94db8f11d6565b1a55a35d2b48263fab81332f Mon Sep 17 00:00:00 2001
From: Yiannis Georgiou <yiannis.georgiou@bull.net>
Date: Wed, 5 Dec 2012 12:34:08 -0800
Subject: [PATCH] energy/rapl documenation updates

1) updated man pages to better explain how the acct_gather_energy plugins give accurate results only in case of exclusive job allocations

2) remove unnecessary defines
---
 doc/man/man1/sacct.1                                  |  2 ++
 doc/man/man1/sstat.1                                  |  2 ++
 doc/man/man5/slurm.conf.5                             |  7 ++++++-
 .../acct_gather_energy/rapl/acct_gather_energy_rapl.h | 11 -----------
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/doc/man/man1/sacct.1 b/doc/man/man1/sacct.1
index e128ff3b600..102d7d22f36 100644
--- a/doc/man/man1/sacct.1
+++ b/doc/man/man1/sacct.1
@@ -441,6 +441,8 @@ specialized \f3sjobexitmod\fP command.
 .TP
 \f3ConsumedEnergy\fP
 Total energy consumed by all tasks in job, in joules.
+Note: Only in case of exclusive job allocation this value 
+reflects the jobs' real energy consumption.
 
 .TP
 \f3cputime\fP
diff --git a/doc/man/man1/sstat.1 b/doc/man/man1/sstat.1
index 53ae8ec9f60..52c1abde439 100644
--- a/doc/man/man1/sstat.1
+++ b/doc/man/man1/sstat.1
@@ -131,6 +131,8 @@ Average Virtual Memory size of all tasks in job.
 .TP
 \f3ConsumedEnergy\fP
 Total energy consumed by all tasks in job, in joules.
+Note: Only in case of exclusive job allocation this value 
+reflects the jobs' real energy consumption. 
 
 .TP
 \f3JobID\fP
diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5
index 78458ffb712..605f1a0401f 100644
--- a/doc/man/man5/slurm.conf.5
+++ b/doc/man/man5/slurm.conf.5
@@ -160,7 +160,12 @@ determined by the value of \fBJobAcctGatherFrequency\fR.
 \fBAcctGatherEnergyType\fR
 Identifies the plugin to be used for energy consumption accounting.
 The jobacct_gather plugin and slurmd daemon call this plugin to collect
-energy consumption data for jobs and nodes.
+energy consumption data for jobs and nodes. The collection of energy 
+consumption data takes place on node level, hence only in case of exclusive 
+job allocation the energy consumption measurements will reflect the jobs 
+real consumption. In case of node sharing between jobs the reported consumed 
+energy per job (through sstat or sacct) will not reflect the real energy 
+consumed by the jobs. 
 
 Configurable values at present are:
 .RS
diff --git a/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.h b/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.h
index 85f59ae790c..c269be519fb 100644
--- a/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.h
+++ b/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.h
@@ -41,17 +41,6 @@
 #ifndef _ENERGY_GATHER_RAPL_H_
 #define _ENERGY_GATHER_RAPL_H_
 
-#define EC_PACKAGE_ENERGY	1
-#define EC_DRAM_ENERGY 		2
-#define EC_TOTAL_ENERGY 	3
-#define EC_PACKAGE_POWER 	4
-#define EC_DRAM_POWER		5
-#define EC_TOTAL_POWER		6
-#define EC_ENERGY_UNITS		7
-
-#define EC_ALL_PACKAGES	        -2
-#define EC_CURRENT_CPU	        -1
-
 #define MAX_PKGS        256
 
 #define MSR_RAPL_POWER_UNIT             0x606
-- 
GitLab