Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
a72e5d6e
Commit
a72e5d6e
authored
12 years ago
by
Morris Jette
Browse files
Options
Downloads
Patches
Plain Diff
Document RAPL data structures, mask reserved bits
parent
621f7a9d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c
+35
-2
35 additions, 2 deletions
...plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c
with
35 additions
and
2 deletions
src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c
+
35
−
2
View file @
a72e5d6e
...
@@ -156,7 +156,13 @@ static uint64_t _get_package_energy(int pkg)
...
@@ -156,7 +156,13 @@ static uint64_t _get_package_energy(int pkg)
{
{
uint64_t
result
;
uint64_t
result
;
/* MSR_PKG_ENERGY_STATUS
* Total Energy Consumed - bits 31:0
* Reserved - bits 63:32
* See: Intel 64 and IA-32 Architectures Software Developer's
* Manual, Volume 3 for details */
result
=
_read_msr
(
pkg_fd
[
pkg
],
MSR_PKG_ENERGY_STATUS
);
result
=
_read_msr
(
pkg_fd
[
pkg
],
MSR_PKG_ENERGY_STATUS
);
results
&=
0xffffffff
;
if
(
result
<
package_energy
[
pkg
].
i
.
low
)
if
(
result
<
package_energy
[
pkg
].
i
.
low
)
package_energy
[
pkg
].
i
.
high
++
;
package_energy
[
pkg
].
i
.
high
++
;
package_energy
[
pkg
].
i
.
low
=
result
;
package_energy
[
pkg
].
i
.
low
=
result
;
...
@@ -167,7 +173,13 @@ static uint64_t _get_dram_energy(int pkg)
...
@@ -167,7 +173,13 @@ static uint64_t _get_dram_energy(int pkg)
{
{
uint64_t
result
;
uint64_t
result
;
/* MSR_DRAM_ENERGY_STATUS
* Total Energy Consumed - bits 31:0
* Reserved - bits 63:32
* See: Intel 64 and IA-32 Architectures Software Developer's
* Manual, Volume 3 for details */
result
=
_read_msr
(
pkg_fd
[
pkg
],
MSR_DRAM_ENERGY_STATUS
);
result
=
_read_msr
(
pkg_fd
[
pkg
],
MSR_DRAM_ENERGY_STATUS
);
results
&=
0xffffffff
;
if
(
result
<
dram_energy
[
pkg
].
i
.
low
)
if
(
result
<
dram_energy
[
pkg
].
i
.
low
)
dram_energy
[
pkg
].
i
.
high
++
;
dram_energy
[
pkg
].
i
.
high
++
;
dram_energy
[
pkg
].
i
.
low
=
result
;
dram_energy
[
pkg
].
i
.
low
=
result
;
...
@@ -248,6 +260,12 @@ extern int acct_gather_energy_p_update_node_energy(void)
...
@@ -248,6 +260,12 @@ extern int acct_gather_energy_p_update_node_energy(void)
xassert
(
pkg_fd
[
0
]
!=
-
1
);
xassert
(
pkg_fd
[
0
]
!=
-
1
);
/* MSR_RAPL_POWER_UNIT
* Power Units - bits 3:0
* Energy Status Units - bits 12:8
* Time Units - bits 19:16
* See: Intel 64 and IA-32 Architectures Software Developer's
* Manual, Volume 3 for details */
result
=
_read_msr
(
pkg_fd
[
0
],
MSR_RAPL_POWER_UNIT
);
result
=
_read_msr
(
pkg_fd
[
0
],
MSR_RAPL_POWER_UNIT
);
energy_units
=
pow
(
0
.
5
,(
double
)((
result
>>
8
)
&
0x1f
));
energy_units
=
pow
(
0
.
5
,(
double
)((
result
>>
8
)
&
0x1f
));
result
=
0
;
result
=
0
;
...
@@ -298,16 +316,31 @@ static void _get_joules_task(acct_gather_energy_t *energy)
...
@@ -298,16 +316,31 @@ static void _get_joules_task(acct_gather_energy_t *energy)
xassert
(
pkg_fd
[
0
]
!=
-
1
);
xassert
(
pkg_fd
[
0
]
!=
-
1
);
/* MSR_RAPL_POWER_UNIT
* Power Units - bits 3:0
* Energy Status Units - bits 12:8
* Time Units - bits 19:16
* See: Intel 64 and IA-32 Architectures Software Developer's
* Manual, Volume 3 for details */
result
=
_read_msr
(
pkg_fd
[
0
],
MSR_RAPL_POWER_UNIT
);
result
=
_read_msr
(
pkg_fd
[
0
],
MSR_RAPL_POWER_UNIT
);
power_units
=
pow
(
0
.
5
,
(
double
)(
result
&
0xf
));
power_units
=
pow
(
0
.
5
,
(
double
)(
result
&
0xf
));
energy_units
=
pow
(
0
.
5
,
(
double
)((
result
>>
8
)
&
0x1f
));
energy_units
=
pow
(
0
.
5
,
(
double
)((
result
>>
8
)
&
0x1f
));
if
(
debug_flags
&
DEBUG_FLAG_ENERGY
)
if
(
debug_flags
&
DEBUG_FLAG_ENERGY
)
info
(
"RAPL powercapture_debug Energy units = %.6f, "
info
(
"RAPL powercapture_debug Energy units = %.6f, "
"Power Units = %.6f"
,
energy_units
,
power_units
);
"Power Units = %.6f"
,
energy_units
,
power_units
);
max_power
=
power_units
*
((
_read_msr
(
pkg_fd
[
0
],
MSR_PKG_POWER_INFO
)
>>
32
)
&
0x7fff
);
/* MSR_PKG_POWER_INFO
* Thermal Spec Power - bits 14:0
* Minimum Power - bits 30:16
* Maximum Power - bits 46:32
* Maximum Time Window - bits 53:48
* See: Intel 64 and IA-32 Architectures Software Developer's
* Manual, Volume 3 for details */
result
=
_read_msr
(
pkg_fd
[
0
],
MSR_PKG_POWER_INFO
);
max_power
=
power_units
*
((
results
>>
32
)
&
0x7fff
);
if
(
debug_flags
&
DEBUG_FLAG_ENERGY
)
if
(
debug_flags
&
DEBUG_FLAG_ENERGY
)
info
(
"RAPL Max power = %ld w"
,
max_power
);
info
(
"RAPL Max power = %ld w"
,
max_power
);
result
=
0
;
result
=
0
;
for
(
i
=
0
;
i
<
nb_pkg
;
i
++
)
for
(
i
=
0
;
i
<
nb_pkg
;
i
++
)
result
+=
_get_package_energy
(
i
)
+
_get_dram_energy
(
i
);
result
+=
_get_package_energy
(
i
)
+
_get_dram_energy
(
i
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment