Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: aminer Newsgroups: comp.programming.threads,comp.programming Subject: Re: Here is again my Proof Date: Thu, 10 Oct 2013 11:51:28 -0700 Organization: albasani.net Lines: 94 Message-ID: <5256F730.1010009@toto.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net kDgbFgdnzAOGKz/6hHhmZO4H2dwissky9dop5Rl/DrzcIFUKWZlqEdqhZAt+Mm1FtcFIlKOTDFK4ioEFTw0qWt7vM5noOpsDGFAhk2o6GEZrpRoNs16ul/diydAox1Eh NNTP-Posting-Date: Thu, 10 Oct 2013 15:51:27 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="p8RRW8kkm4GFLhXKMki+2auR7D2Xz4Q1C89r5TRq4DqUr1p7kt9wRhmp/mA8/UZWkx8jQ1O0S0yesGlhu/H9B2DmfAcvO5Kdt6vMUmT1aFqCbkTXYAc99DCOLpyMQX5s"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 To: Robert Wessel In-Reply-To: Cancel-Lock: sha1:MOAeZnrClMhWJBFiOP6oDhiI9ZM= Xref: csiph.com comp.programming.threads:1887 comp.programming:3899 Hello, I think i know what is my mistake: the serial part in the Amdahl's law is not the critical section, you must not confuse the two. Amine Moulay Ramdane. On 10/9/2013 10:03 PM, Robert Wessel wrote: > On Wed, 09 Oct 2013 20:26:18 -0700, aminer wrote: > >> >> Hello, >> >> I have noticed that Robert Wessel didn't understood my ideas.. >> >> So i will prove it to you right now , so follow with me carefully please... >> >> Let say we have 4 threads, and 4 cores, and let say that each >> thread is running the same parallel code, and let say we have also a >> serial code inside some critical section, and let say that the parallel >> part is >> 0.1% and the serial part is 0.9%, so let say that the serial part >> takes 1 second(it means 0.1%) and the parallel part takes 9 seconds(it >> means 0.9%), what i have tried to explain to you is that the Amadhl's >> law or equation is not a correct law and it doesn't give a correct results, >> here is why: so if the 4 threads are all looping and looping again >> for a number of times running the same parallel code and the same serial >> code and let say that they are contending at the same time >> for the critical section, this is why i have called an ideal contention >> scenario, so if they are contending AT THE SAME TIME for the critical >> section(the serial part) they will run 4 serial parts in 4 seconds in >> one loop and they will run 4 parallel parts in 9 seconds in one loop, >> hence it will take 13 seconds in one loop , but if you run the parallel >> part and the serial part serially they will take 40 seconds, so the >> scalability will equal 40 seconds divide by 13 seconds = 3.07X, this is >> the result that gives us the Amdahl's law, it's 1 /(0.1 + 0.9/4) = >> 3.07X, but this is not the end of the story , so follow now carefully >> with me, so let divide the parallel part into 9 small parts each equal to >> 1 seconds, and the serial part is equal to 1 second, so if the threads >> are looping and not contending at the same time for the critical section >> and let say that when the threads are looping the first thread will be >> on the first small part equal to 1 seconds of the 9 small parts of the 9 >> seconds of the parallel part , the second thread will be on the second >> small part equal to 1 seconds of the 9 parts of the 9 seconds of the >> parallel part, and the third threads will be on the third small part >> equal to 1 second of the 9 parts of the 9 seconds of the parallel part , >> and the fourth thread will be on the third small part equal to 1 second >> of the 9 parts of the 9 seconds of the parallel part , so imagine the 4 >> threads >> looping again and again and not changing there places like that , so >> there will be no serial part at all, cause when each thread will be on >> the 1 second of the serial part the other threads will not be on the the >> same serial part, so this is a none contention scenario , so since >> there is no serial part so the scalability will be perfect and >> equal to 4X , so as you have noticed the Amdahl equation gives >> the scalability of the ideal contention scenario all the threads >> are contending at the same time so the scalability will equal 3.07X, but >> if they are not contending at all the scalability will be perfect >> and equal to 4X, and if you have less contention this will scale >> better than 3.07X, so now i have proved to you that the Amdahl's law >> doesn't give you a correct result. >> >> >> >> Hope you have understood my arguments and my ideas against the >> Amdahl's law. > > > You've redefined the serial work as parallel work, leading to an > absurd result. > > If you have a bit of work, with serial (Sn) and parallel (Pn) parts, > but you run multiple instances of that, so the S1, S2, S3... are > serial with respect to themselves and their respective parallel parts, > but parallel with each other (IOW, S1, S2, S3... can run at the same > time), S1, S2, S3... as a group are not serial. > > Assuming for the sake of brevity that each Sn is the same size, the > actual unit of serial work in the system is *one* of the Sn units, not > all of them. Thus if you had 100 iterations (each with .1 S and .9 P > work), Amdahl's law would imply that the maximum theoretical speedup > is about *1000*, since all 100 Sn's can run in parallel. > > Amdahl's law is just fine. > > And please stop misusing the percent sign. Your writing is convoluted > enough when half your numbers are not off two orders of magnitude. >