LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 12-17-2010, 09:35 AM   #1
Ronayn
Member
 
Registered: Jan 2006
Posts: 55

Rep: Reputation: 0
How does software know how to use Multiple CPU and Cores


I am writing a program that is computationally intensive. I have a serial version which runs on one machine, and a parallelized version that can run across several machines (reducing the processing time).

Does the OS handle (intelligently) splitting my application between CPU's and Cores -- or is that something I have to program into my code?

Are there any books explaining how apps are handled on multiple CPU/Core systems?


This is the info for the machine(s) I am working on:
HP Proliant DL380 G5. 2 Dual Core Intel Xeon Processors (3.00 GHz / 1333MHz, 4MB L2 Cache) with 8GB memory, Fedora Core 6 Operating System, running Linux Kernel 2.6.20-1.2948.fc6.
 
Old 12-17-2010, 10:24 AM   #2
bpogi
LQ Newbie
 
Registered: May 2009
Location: Georgia, USA
Distribution: Ubuntu, Debian, Gentoo
Posts: 15

Rep: Reputation: 1
You have to write threaded applications, basically. I don't know the specifics of what your program does or even what language it's in, but if you write it with the appropriate threading routines and libraries and, if you have enough threads, the OS (if it is multi-core capable) will make use of all the available processor cores.
 
1 members found this post helpful.
Old 12-17-2010, 10:31 AM   #3
hyperfluid
Member
 
Registered: Aug 2010
Location: /ger/nrw/ac
Distribution: Ubuntu 12.04
Posts: 34

Rep: Reputation: Disabled
When you say you have got a parallelized version, it sounds like you already use methods like multi-threading (e.g. via pthread) or MPI. If you do so, the OS will do the rest.

Last edited by hyperfluid; 12-17-2010 at 10:34 AM.
 
1 members found this post helpful.
Old 12-20-2010, 06:12 AM   #4
Ronayn
Member
 
Registered: Jan 2006
Posts: 55

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by hyperfluid View Post
When you say you have got a parallelized version, it sounds like you already use methods like multi-threading (e.g. via pthread) or MPI. If you do so, the OS will do the rest.
Yes, I am using C/C++, threads, and MPI. It's just that I was using all that before multi-core/multi-cpu systems came out -- and I thought that there had to be something the programmer had to do in order to take advantage of that tech. But hey, if the OS does it, I am good with that! It means no source code changes for me! YaY!
 
Old 12-20-2010, 06:36 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,500

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Multi-threaded code that isn't designed to be multi-processor safe isn't.
Lots of appalling code runs just fine on one processor - because concurrency and race conditions don't come into play. Parallelism (on different machines) doesn't necessarily change this.

Last edited by syg00; 12-20-2010 at 07:17 AM. Reason: typo
 
1 members found this post helpful.
  


Reply


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] Allocation of CPU Cores on RHEV-H shivakumargone Linux - Virtualization and Cloud 4 10-12-2010 06:05 AM
Disable CPU cores in RHEL3 ElectroLinux Linux - Server 1 03-31-2008 06:34 PM
LXer: Take advantage of multiple CPU cores during file compression LXer Syndicated Linux News 0 02-13-2008 09:40 PM
Software and CPU Cores DIGITAL39 Linux - Software 8 10-10-2007 03:47 AM
how to find number of cores in CPU narensr Linux - Hardware 5 08-24-2006 02:09 PM


All times are GMT -5. The time now is 10:20 AM.

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