Software Archive
Read-only legacy content
17061 Discussions

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

Gary_L_
Beginner
405 Views

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
1 Solution
Sumedh_N_Intel
Employee
405 Views
0 Kudos
3 Replies
Sumedh_N_Intel
Employee
406 Views

Hi Gary, 

You might find the following threads useful: 

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

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

Hope this helps. 

0 Kudos
Gary_L_
Beginner
405 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
405 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
Reply