[ cyb / tech / λ / layer ] [ zzz / drg / lit / diy / art ] [ w / rpg / r ] [ q ] [ / ] [ popular / ???? / rules / radio / $$ / news ] [ volafile / uboa / sushi / LainTV / lewd ]

diy - DIY & Electronics

Name
Email
Subject
Comment
File
Password (For file deletion.)

BUY LAINCHAN STICKERS HERE

STREAM » LainTV « STREAM
Ok, who did it?

[Return][Go to bottom]

File: 1414240922706.gif (11.48 KB, 700x400, 63635_wl_91710v00_po_fig2_….gif) ImgOps iqdb

 No.95

I'm thinking of creating a cluster computer out of my three raspberry PI's. Eventually my PC's too, if it works out well. Or parallell computing. Pros/cons for small/large systems?

Question: Is there any specific way to calculate it's speed? Do you simply add the speed of the computers together minus the programs actions?


Thank you.
>>

 No.96

…i don't understand what you are trying to do here, how do you want to do that

and to your question, CPUs are hugely complicated black boxes that do lots of complicated shit, and you can definitely never ever calculate any program runtime by counting the assembly operations or something like that

let me give you a quick overview: c program gets compiled to assembly, gets compiled to machine code.
on execution, it gets loaded into your ram. your cpu's program pointer register gets pointed to where the program is in the RAM so it can start fetching things. between the RAM and the CPU's registers you have two levels of cache because compared to your CPU the RAM is extremely slow. the second level cache is basically just a small, but very fast RAM chip somewhere on your mobo, and the first level cache is built into your actual CPU chip using the same technology (CMOS).
so normally, your CPU's registers will try to primarily interact with your first-level cache when performing an operation, because otherwise it will spend ages waiting on the RAM and whatnot.
then, inside the CPU itself, you do not only have multiple CPU cores, but inside the CPU core you have multiple ALUs and multiple units for calculating stuff and so on, and all those work in parallel. the incoming machine code commands get translated to yet another lower level of micro machine code or something that are then distributed across the different parts inside a CPU part as good as possible.
now the way the CPU is doing that is not perfect, it's using some black magic called branch prediction to determine in advance how conditional jump commands are going to evaluate before they actually get evaluated.
for example:

//this is fast because the condition will first evaluate to false 50 times and then evalutate to true 50 times
array = [ 1, 2, 3, …. 100]
for (x=0, x<100; x++) {
if (array[x]>50) { do something}
}

//this is slow because the branch prediction doesnt work with random behaviour
array = [ 33, 8, 23, 67 ….]// random values between 0 and 100
for (x=0, x<100; x++) {
if (array[x]>50) { do something}
}

>>

 No.97

>>96
PS: basically, you can think of the CPU to get "Interruped" everytime the branch prediction fails, because that's what is happening in the interal CPU pipeline: parts of the CPU core idle because they have to wait for other parts of the same CPU core to finish a microcode computation before they can know what to do next

>>

 No.98

i once had a cluster of mac pro's. shit was cash.

>>

 No.102

>>98
so how did it werk

>>

 No.104

I have a question; how would you physically connect the CPUs to each other?

>>

 No.105

>>104
Network cables?

>>

 No.111

>>95
Why not run a small Erlang VM on each machine?

>>

 No.112

>>111
this sir is right, erlang was designed for that kind of thing

>>

 No.859

>>95
>. Pros/cons for small/large systems?
Parallel computing is very, very difficult to actually take advantage of because of race conditions in programs.
Good, safe, SIMPLE implementations have to be atomic,i.e. MapReduce. Nowaday what big companies are doing is using horizontal scaling to cut down costs on server and to provide high availability at pretty much no cost. Like, if you want "computing" power for cheap, consider using a distributed file (HDFS-Hadoop stack) system and manipulating the data using MapReduce or writing soykaf for YARN.

http://static.googleusercontent.com/media/research.google.com/es-419//archive/mapreduce-osdi04.pdf

http://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html

>>

 No.870

File: 1437136269302.png (44.16 KB, 648x486, 648px-AmdahlsLaw.svg.png) ImgOps iqdb

>Do you simply add the speed of the computers together
That will give you the absolute maximum, the actual performance will be significantly less.
Also raspberry pis aren't really ideal because they only have 100m networking and can't even saturate that.
>minus the programs actions?
not sure what you mean by that.

>>

 No.871

>>859
>>870
mhm based lains are based

>>111
yeah i'd see it as an opportunity to test out erlang/elixir too



Delete Post [ ]
[ cyb / tech / λ / layer ] [ zzz / drg / lit / diy / art ] [ w / rpg / r ] [ q ] [ / ] [ popular / ???? / rules / radio / $$ / news ] [ volafile / uboa / sushi / LainTV / lewd ]