Wpis ten przeleżał zdecydowanie za długo jako szkic…

Albo, by być w zgodzie z technikaliami, ośmioprocesowość. Otóż symuluję sobie działanie sieci peer-to-peer. Algorytmy sterujące zrobiły się trochę zasobożerne, więc już przy 100 maszynach w rzeczonej sieci czas w symulacji płynie wolniej niż na zegarze ściennym. Mając sporo godzinnych symulacji do zrobienia, niespodzianka, uruchamiam je równolegle. Przy okazji zyskałem możliwość pochwalenia się, co potrafi 8 wątków sprzętowych w i7 zainstalowanym w MacBook Pro.

Ośmiowątkowość

Nie będę się rozpisywał o tym, jak działają owe wątki sprzętowe. Ważna jest informacja, że procesor zawiera cztery równorzędne rdzenie. Każdy rdzeń zaś zawiera zdublowany pipeline (jak to właściwie powiedzieć po Polsku?), jednak tylko z jedną kompletną ALU. W efekcie w danym momencie wykonywana jest tylko jedna operacja. Zysk pojawia się, gdy potrzebny jest dostęp do pamięci, kiedy to jedna operacja czeka i można wykonywać drugą. Więcej poczytać można na Wikipedii. Tutaj zaprezentuję szybkie spojrzenie na to, jak to działa w moim przypadku.

Mam więc program który potrafi rozdzielać robotę między pulę procesów. Działania programu nie będę teraz opisywał, poza dwoma ważnymi szczegółami. Po pierwsze, procesy pracują zupełnie niezależnie, łączenie wyników ich działań następuje w masterze po zakończeniu obliczeń. Po drugie, można kontrolować ich liczbę z linii poleceń.

Bez owijania w bawełnę, oto wyniki:

$ echo yes | time ./streaming/script/run_series.py \
	streaming/config/prime.py out -C -p 1 -l 100000

Removing out, continue? 
./streaming/script/run_series.py 
streaming/config/prime.py out -C -p 1 -l  
178.37s user 0.22s system 100% cpu 2:58.52 total

$ echo yes | time ./streaming/script/run_series.py \
	streaming/config/prime.py out -C -p 4 -l 100000

Removing out, continue? 
./streaming/script/run_series.py 
streaming/config/prime.py out -C -p 4 -l  
200.00s user 0.31s system 357% cpu 56.065 total

$ echo yes | time ./streaming/script/run_series.py \
	streaming/config/prime.py out -C -p 8 -l 100000

Removing out, continue? 
./streaming/script/run_series.py 
streaming/config/prime.py out -C -p 8 -l  
338.27s user 0.57s system 684% cpu 49.516 total

Dodałem trochę białych znaków dla czytelności…

Jak widać HT działa. W tym konkretnym przypadku obliczenia wykorzystując HT idą 11.68% czasu krócej niż po prostu używając wszystkich rdzeni. Czysty efekt HT oceniałbym jednak trochę wyżej, z dwóch powodów. Po pierwsze, test wykonałem na laptopie, na którym działo się kilka innych rzeczy. Po drugie, z wyników można się domyślać, że każdy proces ma overhead. Odejmując czas procesora dla jednego procesu od czasu dla czterech procesów i dzieląc przez te trzy dodatkowe procesy, widzimy że wychodzi 7 dodatkowych sekund na proces. Gdyby odjąć te 7 sekund od ostatecznego czasu HT, wyszłoby nam około 25% zysku z użycia HT. Czyli z grubsza tyle, ile sugeruje Intel.

Komentarze

  • Caladan (2012-07-19 10:26:37): Pipeline w procesorze to potok. To ciekawe, może i ja zrobię test czasu wykonywania obliczeń przez mój soft w wersji n i 2*n wątkowej na i7-920 i i5-25xx?
  • Remigiusz ‘lRem’ Modrzejewski (2012-07-19 10:27:00): i5 chyba nie ma HT?
  • Caladan (2012-07-19 10:27:58): MacBook Air 13' z 2011 ma core i5 i ma HT.
  • Caladan (2012-07-19 10:29:39): O taki: http://ark.intel.com/products/54620
  • Zal (2012-07-19 11:09:20): W naszym projekcie, który realizuje intensywne obliczenia na strumieniach audio-wideo przyrost wydajności z tytułu HT nigdy nie przekroczył 10%. Ale i tak lepiej mieć te 10%, niż ich nie mieć.
  • Caladan (2012-07-19 11:10:32): @Zal: pewnie dlatego, że robicie obliczeń dużo, a skoro jest tylko jedno ALU (a więc pewnie i jedna jednostka MMX/SSE), to czego się spodziewać? A co dokładnie robicie z tymi danymi AV?
  • Zal (2012-07-19 11:16:54): @Caladan: Kodowanie i dekodowania audio-wideo plus wszelkiego rodzaju analiza poszczególnych klatek pod kątem interesujących nas elementów. Przy czym staramy się oddzielić węzły obsługujące kodeki od węzłów dokonujących analizy. Musiałbym poszukać raportów z testów wydajnościowych, ale w ogólności, w naszym przypadku sporą rolę odgrywa również właściwe wykorzystanie cache i pamięci operacyjnej. Szczególnie jednak cache.
  • lrem (2012-07-19 12:10:19): No to jednak spora różnica wynika z problemu. Ja tutaj mam przede wszystkim masę dostępów do pamięci, prawie zerowa lokalność…
  • sprae (2012-07-19 17:26:34): Ja nie wiem czy można dziś mówić o potokach. Są 3 dekodery instrukcji, a jednostek wykonawczych jest 5 (2x ALU, FPU, LOAD, STORE). Wydaje mi się że dużo większą rolę gra w HT wyższa abstrakcja mapowania rejestrów. :-)
  • rozie (2012-07-19 22:51:56): Nawet i3 ma HT…
  • tee shirts online australia (2014-05-18 13:07:28): I really like what yoou guys are usually up too. Thhis type of clever work and coverage! Keep up the amazing works guys I’ve included you guyus tto my blogroll.
  • Koishop (2014-08-29 13:27:29): Howdy I am so excited I founnd your blog, I really found you by mistake, while I was looking on Aol for something else, Nonetheless I am here now and would just like to say thank you for a fantastic post andd a alll round thrilling blog (I also love tthe theme/design), I don’t have time to browse it all at the minute but I have saved it and alxo added your RSS feeds, so when I have time I will be back to read more, Please doo kep up the excellent work.
  • Stegplatten kaufen (2014-08-29 14:08:19): I got this web site from my buddy who told me about this website annd at the moment this time I amm visiting this sie and reading very informative content here.
  • LKW Transport (2014-09-20 20:12:47): Wonderful beat ! I wish to apprentice while you amend your website, how can i subscribe for a weblog website? The account aided me a applicable deal. I were a little bit familiar of this your broadcast offered vivid clear concept
  • maxi skirt (2014-11-03 02:02:07): The pattern firms have made it pretty easy for starting sewers.
  • m88 (2014-11-10 18:27:49): Howdy! Someone in my Myspace group shared this site with us so I came to take a look. I’m definitely loving the information. I’m book-marking and will be tweeting this to my followers! Excellent blog and terrific design and style.
  • dragon city hack tool (2014-11-10 21:33:00): In playing the video game you will certainly be breeding dragons.
  • rencontre (2014-11-12 23:36:37): First of all I would like to say awesome blog! I had a quick question that I’d like to ask if you don’t mind. I was interested to find out how you center yourself and clear your thoughts before writing. I have had a tough time clearing my thoughts in getting my thoughts out. I do enjoy writing however it just seems like the first 10 to 15 minutes are lost just trying to figure out how to begin. Any suggestions or tips? Thanks!
  • http://clubpenguincodefree.com (2014-11-22 10:51:17): You’re actually still wearing the items you place on previously when you’re viaing this. They’re presented as Shadow Ninja things only for you.
  • How Can I Get Fifa 14 Coins (2014-11-23 21:55:19): Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is totally off topic but I had to tell someone!
  • Cheat Tool (2014-12-18 17:19:36): Woah! I’m really loving the template/theme of this site. It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between usability and visual appeal. I must say that you’ve done a great job with this.<br /> In addition, the blog loads super quick for me on Opera. Excellent Blog!
  • Cheat Tool (2014-12-18 17:19:47): Woah! I’m really loving the template/theme of this site. It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between usability and visual appeal. I must say that you’ve done a great job with this.
  • hack facebook accounts (2014-12-21 23:23:07): A boyfriend or girlfriend might want to see exactly what their counterpart is doing behind their back.
  • boom beach hack no download (2014-12-23 10:26:32): All the questions are simple as well as take just around 1-2 minutes to finish. So If you actually wish to be the most effective, then attacked the button to download and install. I’m very sure numerous of you will post below why we’ve submitted the hack cheat by quiz?
  • Daily Deal Websites (2014-12-30 08:09:33): The company also follows the sustainable practices they expect from their vendors by utilizing recycled packaging material, recycled and unbleached paper, encourage deliveries over the usps, etc. Touuching to the maiin goal of the dailly deal aggregator website, be thhe one stop shop for all daily deals, a primary goal that yyou can have iss tto continually make a geo-targeted listing of prospects interested to listen forr abojt the dels featured on your internet site. The daily dea sites charges the vendors a hefty commission (typically) when deals arre sold.
  • Jasmine (2015-01-09 05:08:48): Hello there! This is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a extraordinary job!
  • get the facts (2015-01-14 17:59:32): You’re so cool! I don’t think I’ve read anything like that before. So good to find someone with some original thoughts on this issue. Really.. many thanks for starting this up. This website is one thing that is needed on the web, someone with a little originality!
  • fur Coats (2015-01-17 23:54:52): Can Ӏ simply just say what a rеlief to fin an individual who rеally knows what they are discussing on the web.
  • google apps fresno state (2015-01-20 07:16:33): It is in reality a great and useful piece of info. I’m happy that you simply shared this useful info with us. Please stay us informed like this. Thanks for sharing.
  • hack a facebook account online (2015-01-28 11:28:04): If you have returned for your online messenger, you find that you aren’t access to your webmail.
  • paid for online surveys (2015-02-05 15:33:34): Your mode of telling the whole thing in this post is genuinely nice, all be capable of easily understand it, Thanks a lot.
  • cash paid surveys (2015-02-06 12:45:06): Your style is really unique compared to other folks Ihave read stuff from. Many thanks for posting when you have the opportunity, Guess I will just book mark this page.
  • מנעולן פורץ (2015-02-12 16:36:05): Excellent site. Plenty of useful info here. I’m sending it to some buddies ans additionally sharing in delicious. And naturally, thanks on your sweat!
  • מנעולן גבעתיים והסביבה יצאת צדיק (2015-02-17 10:33:05): Yes! Finally something about locksmith.
  • צילינדר באזור הוד השרון (2015-02-17 10:50:14): You have made some good points there. I checked on the internet for more information about the issue and found most people will go along with your views on this web site.
  • small business internet marketing (2015-02-18 11:19:15): My brother suggested I might like this blog. He was entirely right. This submit truly made my day. You can not believe simply how so much time I had spent for this info! Thanks!
  • professional microphones for singing liv (2015-02-18 17:04:25): The signal path is the path that the audio takes from the microphone to get into the computer, and what occurs along the way.
  • generic cialis in canada (2015-02-18 22:52:07): Hi there it’s me, I am also visiting this website daily, this site is really nice and the visitors are actually sharing nice thoughts.
  • Wellington Workout (2015-02-19 07:13:43): Highly energetіc post, I enjoyed tɦat a lot. Wіll tɦеre be a pqrt 2?
  • קורס מנעולנים גבעת-שמואל (2015-02-20 04:21:55): Appreciating the persistence you put into your blog and in depth information you provide. It’s nice to come across a blog every once in a while that isn’t the same old rehashed information. Fantastic read! I’ve saved your site and I’m including your RSS feeds to my Google account.
  • CASINO (2015-02-20 04:28:47): This post presents clear idea in favor of the new people of blogging, that actually how to do running a blog.
  • clash of clans cheat (2015-02-20 22:54:46): It’s a shame you don’t have a donate button! I’d certainly donate to this brilliant blog! I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account. I look forward to brand new updates and will share this website with my Facebook group. Talk soon!
  • hotel discount codes holiday inn express (2015-02-22 08:46:55): If it does, be sure that the breakfast is good enough in any other case you’ll find yourself paying for the breakfast and never consuming it too.
  • model train sets walmart (2015-02-23 03:43:55): In this series of free pastime videos, you’ll learn to create your individual mannequin path village.
  • timmyejgc.wordpress.com (2015-02-27 04:28:18): What i do not realize is in truth how you are not really much more neatly-appreciated than you might be now. You’re very intelligent. You realize thus significantly on the subject of this topic, produced me in my view imagine it from a lot <br /> of various angles. Its like men and women don’t seem to be interested unless it’s something to do with Girl gaga! Your own stuffs nice. Always take care of it up!
  • you could try these out (2015-02-27 07:35:39): I’m truly enjoying the design and layout of your website. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a designer to create your theme? Superb work!
  • Wagnermbcx.Wordpress.Com (2015-02-27 09:40:20): What’s up to all, how is the whole thing, I think every one is getting more from this website, and your views are pleasant for new visitors.
  • m88 (2015-02-27 22:30:06): Heya i am for the first time here. I came across this board and I to find It truly useful & it helped me out much. I am hoping to give one thing back and aid others uch as you aired me.
  • momporn (2015-02-28 07:51:50): Link exchange is nothing else except it is simply placing the other person’s website link on your page at suitable place and other person will also do similar for you.
  • click here for more (2015-02-28 19:31:14): if you want free cheat and codes of brave frontier get hack here.
  • brave frontier (2015-02-28 19:32:35): i am always there for you and i would feel nice by helping you for gems and coins of the game.
  • sample cialis (2015-03-02 11:04:41): I’m extremely pleased to uncover this site. I want to to thank you for ones time due to this wonderful read!! I definitely appreciated every part of it and i also have you bookmarked to look at new stuff on your web site.
  • borrow money till payday (2015-03-03 05:13:53): Spot on with this write-up, I truly think this website needs a lot more attention. I’ll probably be back again to see more, thanks for the advice!
  • m88 (2015-03-03 05:51:24): I’m not that much off a internet reader to bbe honest but your blogs really nice, keep it up! I’ll go ajead and bookmark your site to come back in tthe future. Many thanks
  • ninja saga hack cheat engine 6.3 2015 (2015-03-06 04:06:25): Woah! I’m really enjoying the template/theme of this blog. It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between usability and visual appearance. I must say you’ve done a very good <br /> job with this. Also, the blog loads very fast for me on Firefox. Excellent Blog!
  • thermal dynamics plasma cutter rebelmous (2015-03-08 15:18:34): This is accomplished by starting with a super solid, fully welded base. The online retailer recently uploaded a picture of the bundle (which has now been taken down). During plasma cutting operations do not move the work clamp.
  • canadian viagra (2015-03-12 13:15:06): Excellent goods from you, man. I’ve understand your stuff previous to and you’re just extremely wonderful. I actually like what you’ve acquired here, really like what you’re saying and the way in which you say it. You make it enjoyable and you still care for to keep it smart. I can’t wait to read much more from you. This is really a tremendous site.
  • Firoz Patel (2015-03-20 08:19:09): I’ve been exploring for a bit for any high quality articles or weblog posts in this sort of area . Exploring in Yahoo I eventually stumbled upon this web site. Studying this info So i am glad to exhibit that I have an incredibly excellent uncanny feeling I came upon just what I needed. I most no doubt will make sure to do not fail to remember this site and give it a glance regularly.
  • organic skin care (2015-03-21 08:58:15): Admiring the persistence you put into your blog and in epth information you present. It’sgood to come acrss a blog every once iin a while thgat isn’t the same out of date rehashed information. Fantastic read! I’ve saved your site and I’m injcluding your RSS feeds to my Google account.
  • e-cigarette (2015-03-21 18:18:37): Hello there! This post could not be written any better! Looking through thiis post reminds me of my previous roommate! He constantly kept preaching about this. I’ll forward this post to him. Fairly certain he will have a great read.<br /> Thanks for sharing!
  • wiki.cubenation.tv (2015-03-22 10:42:07): It’s actually a great and useful piece of info. I’m satisfied that you simply shared this helpful information with us. Please stay us up to date like this. Thanks for sharing.
  • windows 7 genuine activator (2015-03-24 09:27:20): Really no matter if someone doesn’t be aware of afterward its up to other people that they will assist, so here it occurs.
  • Firoz Patel (2015-03-26 15:57:18): I’m curious to find out what blog system you have been utilizing? I’m experiencing some small security problems with my latest website and I would like to find something more secure. Do you have any recommendations?
  • Master Agen Betting Terpercaya | Winenlo (2015-03-26 22:10:53): Quality articles or reviews is the secret to interest the viewers to pay a visit the website, that’s what this website is providing.
  • Ken Fisher (2015-03-27 06:37:30): Hello friends, fastidious post and nice urging commented here, I am truly enjoying by these.
  • cellulite (2015-03-27 07:01:35): Greetings! Very useful advice within this article! It’s the little changes which will make the most significant changes. Thanks a lot for sharing!
  • artlist.tw (2015-03-30 00:14:44): Ik wil sowieso even reageren. Een betoog over de stoel lift.
  • Sanford (2015-03-30 21:24:05): I have read so many articles or reviews about the blogger lovers but this post is truly a nice post, keep it up.
  • painter tampa fl (2015-04-03 03:32:44): You could definitely see your skills in the article you write. The arena hopes for even more passionate writers like you who are not afraid to mention how they believe. Always go after your heart.
  • <a href="https://vn.answers.yahoo.com/qu (2015-04-09 05:12:26): You are participating in club penguin game and want to become a member? We offer you a free code so you can is Membership, you will easily Access all features in Club Penguin apps, Play more mini-game levels and earn rare quest Prizes, Collect clothing, items, and adopt up to 75 pets and Unlimited access to new content every month. You will be arbitrarily selected as a member free 1 Month, 6 Month and 12 months. <a href=“https://vn.answers.yahoo.com/q uestion/index?qid=20150408195402AAEiyTz”>Free Club Penguin Membership Codes</a>
  • Reefs2Go (2015-04-11 15:54:46): Thanks for a marvelous posting! I actually enjoyed reading it, you could be a great author.I will always bookmark your blog and may come back later in life. I want to encourage you to continue your great work, have a nice afternoon!
  • car title loans (2015-04-12 20:01:58): We encourage responsible borrowing website traffic loans carry a fast payoff schedule. Make sure you are clear as to the method that you will get them the pink slip and whether or otherwise not they wish to physically see the vehicle.
  • title loans san antonio texas (2015-04-13 18:42:33): Generally loan amounts and interest levels are determined about the basis of market value with the car and past driving history. If you answer “no” to at least one in the questions, it will be better to postpone obtaining car loans.
  • ft lauderdale CPAs (2015-05-01 16:19:06): Сorporate Taxes: All business structures pay taxes on the income made in that particular business. If you havе received IRS taҳ notice, you need not tо be panic. This method pts are crսcial inside working with a defined talent management strategy.
  • займы онлайн (2015-05-16 09:22:16): Работая со всеми в обращениимир финансово сильные удары ,идея надлежит только о всех, чтобы оценить темпычеловека и смотреть их , таких , как ястреб.
  • online prescription (2015-05-29 23:18:22): I take pleasure in, lead to I found just what I was looking for. You’ve ended my 4 day long hunt! God Bles you man. Have a great day. Bye
  • epsetkd.dr.beta.ekt.gr (2015-06-19 10:46:32): Set up Outlook to deliver and receive emails and customize it.
  • wonder clicks reviews (2015-07-08 12:17:19): When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several e-mails with the same comment.<br /> Is there any way you can remove me from that service? Thanks a lot!
  • nufinity skin cream trial (2015-07-21 08:07:21): What’s up Dear, are you genuinely visiting this website on a regular basis, if so then you will without doubt take fastidious know-how.
  • free amazon gift card (2015-07-22 09:48:59): I really loved reading your blog Thanks for searing it.
  • free amazon gift card (2015-07-22 09:51:08): It was very well authored and easy to understand.