Thread: measuring CPU usage

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    269

    measuring CPU usage

    Hi all,

    Is there a way to measure CPU usage from your application's perspective? For example, I have an application that uses MPI and OpenMP that runs on a Xeon Phi. I just want to, using relatively standard Linux tools and available tools, see how much CPU usage each of the processes are using. I am figuring out how different settings will affect CPU utilizations/performance. PAPI seems a bit complicated right now given the time constraint.

    Is this the right place to ask? Should I ask in a Linux forum?

    Thanks

  2. #2
    Registered User
    Join Date
    Jun 2015
    Posts
    1,643
    Does top not give enough info?

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    269
    Top is interesting but I want to collect data over the run and plot it. I'd need something in text form. Basically, top must use something that linux has from /proc, right?

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    269
    I should also say, I'd like to get it on a per-core basis if that's even posssible

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    269
    Something like a textual htop would be perfect haha

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,653
    Sure, there's a whole bunch of stuff underneath each /proc/<pid> directory.
    proc(5) - Linux manual page
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  7. #7
    Registered User
    Join Date
    May 2010
    Posts
    269
    Anything specific out of there I should look for?

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,653
    Just go and read it.
    Or search for say "cpu" if you're that lazy.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Measuring Run Time
    By BIOS in forum C Programming
    Replies: 29
    Last Post: 09-13-2011, 02:07 PM
  2. Measuring size
    By kira_coder in forum Windows Programming
    Replies: 5
    Last Post: 09-13-2010, 10:07 PM
  3. Measuring the length
    By kiros88 in forum C Programming
    Replies: 7
    Last Post: 09-11-2009, 04:32 PM
  4. Measuring memory
    By strickey in forum C++ Programming
    Replies: 1
    Last Post: 04-19-2007, 03:46 AM
  5. Measuring time
    By BruceLeroy in forum C++ Programming
    Replies: 20
    Last Post: 10-07-2004, 02:17 PM

Tags for this Thread