Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-10-2014, 02:04 AM   #1
nipun arora
LQ Newbie
Registered: May 2014
Posts: 1

Rep: Reputation: Disabled
how to use 100% cpu for running parallel codes

I am using open mpi to run a parallel code. I am using an 8 core AMD processor. The code that i have made has a limitation that it can be run only on odd no. of processors. So when i run the code on 7 processors, all the cores show 100% usage (i.e. total cpu usage=87.5%). But when i run 2 codes using 5 and 3 cores respectively, the performance falls to 50% of 6 of the cores i.e. (total cpu usage =63.5%). Can someone suggest how to improve the performance of the cores?
Old 05-10-2014, 11:12 AM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,289

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
It's difficult to help without knowing more about your code. It's impossible to use 100% of all 8 cores as the operating system does need a little bit of CPU for things like interrupt handling, background procesees, and the like. Have you run any timing benchmarks of your code to see that performance is really worse than expected in the 5+3 case? Are you sure that the code wasn't just doing heavy I/O (which would drive down CPU usage) when you looked? Running two instances of the program could cause a much heavier I/O load which will slow down overall performance.

It's possible that your application is simply highly sensitive to OS jitter or is heavily I/O dependent (so having two copies running will stress your machine's I/O system beyond its capabilities). In that case, you need to find the bottleneck, and it may be difficult to have two instances of your program running at once without working around said bottleneck.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] CPU of my Wheezy is running up to 100% after restart cccc Debian 10 06-07-2013 04:18 PM
OpenOffice/LibreOffice writer uses 100% CPU time, 100% memory, workaround someone? jlinkels Linux - Software 11 08-30-2012 02:50 PM
CPU running at 100% usage while no applications are running mike_morley Linux - Desktop 14 05-17-2007 10:39 PM
Red Alert running slow in Wine, uses 100% CPU tomas412 Linux - Games 2 06-17-2005 03:07 AM
redhat 8 running slow - CPU usage 100% jonnycarlos Linux - General 4 09-10-2003 05:33 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration