Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Gary_L_
Beginner
57 Views

Pipe micsmc output to a c++ app without writing to console

Jump to solution

Hello,

I'm interested in doing some power analysis on the Xeon Phi and I'm trying to pipe the output of the micsmc tool into a c++ application. I have a bash script which calls micsmc -f periodically (approximately every 250ms); as is, the micsmc tool outputs the information to the console. I want to output this information instead to a c++ application (without writing the power and frequency data to the console). The c++ application would then need to collect the data and output it to a file.

I have the following c++ application:

    timer.start()

    while (true)
    {
        // process pipe if new data
        if (getline(cin, input))
        {
            timer.end();
            elapsedTime = timer.getTime();
            timer.start();
            length = input.length();

            printf("Elapsed time: %0.2f\n", elapsedTime);
            //printf("Input: %s\n\n", input.c_str());

            // Store/process data here
        }
    }

I've tried to issue the following command in the shell:

$ ./script | ./pipe

When this runs

Is it possible to pipe the output ONLY to the c++ application and not to both the c++ application and to the console window? Or is there a better method for obtaining this power information from the device? I'm looking to extract power/frequency information approximately once every 250ms and determine whether or not to apply DVFS to the Host system. We would also like to perform DVFS on the Phi device, but my understanding is that is handled ONLY by the underlying OS.

Thank you
Gary

0 Kudos

Accepted Solutions
Sumedh_N_Intel
Employee
57 Views
0 Kudos
3 Replies
Sumedh_N_Intel
Employee
58 Views
0 Kudos
Gary_L_
Beginner
57 Views

Thanks! These are extremely useful. I looked around for info on that file a while ago but picked up diddly. 

Gary

0 Kudos
Sumedh_N_Intel
Employee
57 Views

I am guessing that you are talking about the SysFS file. Here is one more thread that can perhaps help: 

http://software.intel.com/en-us/forums/topic/499748

0 Kudos