Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.

Intel PCM Syntax for Linux

Huy_H_
Beginner
1,747 Views

I have been trying to use Intel PCM in Linux for quite a few days

When I run pcm.x the usage is posted out as:

 Intel(r) Performance Counter Monitor V2.6 (2013-11-04 13:43:31 +0100 ID=db05e43)

 Copyright (c) 2009-2013 Intel Corporation

 Usage: pcm <delay>|"external_program parameters"|--help <other options>

 
 Other options:
 -nc or --nocores or /nc => hides core related output
 -ns or --nosockets or /ns => hides socket related output
 -nsys or --nosystem or /nsys => hides system related output
 -csv or /csv => print compact csv format
 Example:  pcm.x 1 -nc -ns

I'm trying to measure the counters values before and after my program run, but I', having difficulty with the syntax to run a program with arguments.

For example I can run ./pcm.x myprog. But I cannot run the program "myprog" with arguments, both ./pcm.x myprog arg1 arg2 and ./pcm.x 1|myprog arg1 arg2|  don't seem to work

And I found no manual for the tool. Can anyone give the correct syntaxes with some examples?

 

0 Kudos
9 Replies
Roman_D_Intel
Employee
1,748 Views

try ./pcm.x "my_prog params" pcm_params

in the next version of PCM we will make the syntax more standard "pcm.x pcm_params -- myprog params"

0 Kudos
Roman_D_Intel
Employee
1,748 Views

./pcm.x "myprog arg1 arg2"

0 Kudos
SB17
Beginner
1,747 Views

Or

./pcm.x `myprog arg1 arg2` 

Such quotes give more freedom for action

0 Kudos
Kumar_C_
Beginner
1,747 Views

Does Intel PCM supports the latest KNL (Atom- Silvermont) based core. Running a simple code using pcm.x says the following:

Error: unsupported processor. Only Intel(R) processors are supported (Atom(R) and microarchitecture codename Nehalem/Nehalem-EP, Atom(tm), Westmere/Clarkdale, Sandy Bridge, Westmere-EP, Sandy Bridge-EP/Jaketown, Nehalem-EX, Westmere-EX, Ivy Bridge, Haswell, Broadwell, Ivy Bridge-EP/EN/EX/Ivytown, Haswell-EP/EN/EX, Broadwell-EP, Broadwell-DE, Skylake). CPU model number: 87 Brand: "Intel(R) Xeon Phi(TM) CPU 7250 @000000 1.40GHz"

The "/proc/cpuinfo" says the following:

processor    : 271

vendor_id    : GenuineIntel

cpu family    : 6

model        : 87

model name    : Intel(R) Xeon Phi(TM) CPU 7250 @000000 1.40GHz

 

How should I run the pcm correctly on Intel KNL?

 

 

 

 

 

 

 

 

0 Kudos
Thomas_W_Intel
Employee
1,747 Views

I'm sorry but Intel PCM does not support Xeon Phi currently. Unfortunately, there are also no plans to add support for Xeon Phi any time soon.

0 Kudos
Kumar_C_
Beginner
1,747 Views

I see.

​Is there a way to measure power/energy readings on KNL (self boot) boxes..?

 

 

0 Kudos
McCalpinJohn
Honored Contributor III
1,747 Views

The RAPL registers are present on the KNL and give reasonable numbers.   I either use the command-line tools from msrtools-1.3 to read these registers or I use a separate program (as root) to open the /dev/cpu/*/msr drivers (which can be done read-only for RAPL) to read and parse the values.   This is particularly useful for RAPL because the definitions of the units used for time, power, and energy are encoded in some rather unusual formats and I don't want to hurt my brain trying to figure them out a second time....

Only PKG and DRAM domains are supported.

I have not seen any documentation on whether the MCDRAM is included in the PKG or DRAM domains (or neither, or both).  It should be possible to determine this via directed testing, but I have not gotten that far yet....

0 Kudos
Aditya_Kumar_Singh
1,747 Views

How to use PCM API inside my program? 

I want to get the energy usage by my program also the energy used by major functions inside my code.

 

Aditya Singh

IIT-Hyderabad

0 Kudos
Thomas_G_4
New Contributor II
1,747 Views

LIKWID supports reading of energy data on Intel Xeon Phi and many other processors.

int main()
{
    int cpuid = 0;
    topology_init();
    int rapl_available = power_init(cpuid);
    if (rapl_available)
    {
        PowerData pkg, dram;
        power_start(&pkg, cpuid, PKG);
        power_start(&dram, cpuid, DRAM);
        // do something like sleep(1);
        power_stop(&pkg, cpuid, DRAM);
        power_stop(&dram, cpuid, PKG);
        printf("PKG %f Joules\n", power_printEnergy(&pkg));
        printf("DRAM %f Joules\n", power_printEnergy(&dram));
    }
    return 0;
}
0 Kudos
Reply