Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVELD] improving parallel programming of my system?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
caaarlos
Apprentice
Apprentice


Joined: 27 Apr 2012
Posts: 155

PostPosted: Wed Jan 02, 2013 3:03 pm    Post subject: [SOLVELD] improving parallel programming of my system? Reply with quote

Hello,
I want to improve my system's parallel programming. How you can see on this picture, my system is too innefective, because my system is 3 cores and 2 cpu's works on low rate and 1 works high rate.
Here you can see my system working "https://www.dropbox.com/s/9f7ak765s16c5zx/Captura_de_tela.png"
Thanks.


Last edited by caaarlos on Sun Jan 06, 2013 9:23 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Wed Jan 02, 2013 3:40 pm    Post subject: Reply with quote

What are you asking your computer to do? What are you running?

You'll really need to know how to write software to take advantage of multiple threads. If the software isn't written to take advantage of multiple cores, it will use one core.

Some software just cannot be parallelized. Hence the race to faster CPUs that don't need threading...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
caaarlos
Apprentice
Apprentice


Joined: 27 Apr 2012
Posts: 155

PostPosted: Wed Jan 02, 2013 6:02 pm    Post subject: Reply with quote

Hello,
I used this command "emerge -a dev-db/mysql-workbench".
So the real reason is not my system but is some softwares that does not use parallel programming?
Thanks.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Wed Jan 02, 2013 6:19 pm    Post subject: Reply with quote

Ah...now this is more clear. What you're trying to run is an emerge, or actually compiling a program.
Compiling uses the subprogram "make" which knows how to schedule in parallel.

What you want is to add in your /etc/make.conf

MAKEOPTS='-j4'

This will tell 'make' to run up to 4 tasks at once when it can. This will minimize amount of unused cycles when it's trying to fetch the next thing to build - by running on your 3 processors and a fourth one to fill any gaps.

This will only affect 'make' that's run under portage/emerge. If you have other programs that are singlethreaded you'll need to configure them separately.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
caaarlos
Apprentice
Apprentice


Joined: 27 Apr 2012
Posts: 155

PostPosted: Thu Jan 03, 2013 3:28 pm    Post subject: Reply with quote

Thanks, but I already use MAKEOPTS='-j4' . Is easy to configure on program singlethreaded?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Thu Jan 03, 2013 3:31 pm    Post subject: Reply with quote

If you want to make programs in general multithreaded, then you need to rewrite them to use threads.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Thu Jan 03, 2013 11:00 pm    Post subject: Reply with quote

Some ebuilds have upstream tarballs that contain poorly written makefiles, and thus cannot clearly tell what can and cannot be parallellized. It's possible this was the case for some ebuild you have, and to make sure it compiles correctly each time, it was forced singlethread to build properly.
But that's right... the main reason why multithreading isn't prevalent is because nobody wants to rewrite programs to be multithreaded - it's not easy and there are a lot of pitfalls.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
caaarlos
Apprentice
Apprentice


Joined: 27 Apr 2012
Posts: 155

PostPosted: Sun Jan 06, 2013 9:23 am    Post subject: Reply with quote

Now I'm understand it!
Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum