BrainMeta'   Connectomics'  

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Parallel Programming, Introduction
TorusZL
post Nov 03, 2008, 07:54 PM
Post #1


Newbie
*

Group: Basic Member
Posts: 6
Joined: Oct 25, 2008
Member No.: 31671



Glancing through the forums I didn't notice much about parallel programming so here we go...

Parallel programming is all about performing many computations simultaneously. This sounds simple, however it is a difficult subject. The point to parallel programming is not to go crazy doing as many computations as possible, but it is about doing as many computations as possible while always producing the correct answer.

To illustrate, imagine that we wanted to run the following two lines of code (the ones followed by //) using one processor for each:
int x = 0
int y = 2
//x = y + 1
//y = x - 2

What should the result be after program execution? x == 3 and y == 1. BUT, it would also be possible to end with x == -1 and y == -2. Can anyone figure out the other possibility? (Hint: an instruction such as x = y + 1 cannot be accomplished in an instant, there are multiple steps to it)

Each processor is independent of the other; this causes a race condition because the result of one line is dependent on the arbitrary speed of the other. Parallel programming is all about squeezing every drop of speed out of a program using multiple processors while getting desirable (i.e. not insane) results smile.gif

What does this have to do with brains? Well as most everyone here probably knows, animal brains are massively parallel. That is, reams of computations are carried out all at once all over the brain from individual neurons to clusters of neurons to brain regions. It would not be practical to program a powerful artificial brain without a good knowledge of parallel programming.

As a side note, some people might want to take a look at a few interesting languages which are built for parallel programming: Haskell, ZPL, and Jade. Haskell is a functional programming language which lends well to parallel programming. ZPL is based off arrays, and Jade is more of a C++ styled language which uses special types of declarations to "suggest" to the compiler how to build the code and take advantage of any parallelism.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
trojan_libido
post Nov 04, 2008, 12:07 AM
Post #2


God
******

Group: Basic Member
Posts: 1351
Joined: Sep 19, 2006
From: UK
Member No.: 5681



Interesting. I thought the concept was integrated with our computers already, what with multiple processors and the possibility of threading a program so it can run in bits split across different processes.

We use ZPL here, but its 'Zebra Programming Language' for the barcode printers. I'm assuming its not what you mean. smile.gif

I'm not sure we can say what we'll need to create an artificial brain. We don't really understand it ~ and we are it! Of course, cracking all these technologies will undoubtedly put us in better stead for developing an AI brain.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
TorusZL
post Nov 04, 2008, 04:20 PM
Post #3


Newbie
*

Group: Basic Member
Posts: 6
Joined: Oct 25, 2008
Member No.: 31671



QUOTE(trojan_libido @ Nov 04, 2008, 03:07 AM) *

Interesting. I thought the concept was integrated with our computers already, what with multiple processors and the possibility of threading a program so it can run in bits split across different processes.

We use ZPL here, but its 'Zebra Programming Language' for the barcode printers. I'm assuming its not what you mean. smile.gif

I'm not sure we can say what we'll need to create an artificial brain. We don't really understand it ~ and we are it! Of course, cracking all these technologies will undoubtedly put us in better stead for developing an AI brain.


Modern OS's themselves are programmed to use multiple threads, but most programs running on top of them are not. So there is sometimes no gain except with OS performance when using multiple cores. There are further problems than simply saying "voila, now I start a new thread!". Say you want to start 100 new threads but you only have 8 processors. How do you divvy up the work? If you do it wrong, you waste all your time because less than 8 processors will be able to work on the task. In general, since one of the main facets of the brain is massively parallel computation, we need to learn how to do parallel computation well.

My point is that you can't just split up a program arbitrarily across different threads. That would cause chaos and your program would behave very strangely. That's what I was talking about by the different arbitrary results that result even from a simple 2 line program that is carelessly split up across a couple of threads. Imagine splitting a million line program up into a useful amount of parallelism. Utter insanity if done wrong ohmy.gif

Currently there is a lot of work being done on reverse engineering the brain. Even a quick google search of "brain reverse engineering" brings up tons. Take the Blue Brain Project. Reverse engineering is a key issue to understanding the human brain (well and mammalian brains in general). If we don't work on understanding it, there is a limit we can do to improve our human minds. We could only go as far as improving our general biology through genetic engineering, and that has a limit.

And I was talking about the Z-level Programming Language. Check it out it's pretty interesting.

(Sorry I can't post URLs for reference until I've made more posts *shrug*)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
trojan_libido
post Nov 05, 2008, 01:06 AM
Post #4


God
******

Group: Basic Member
Posts: 1351
Joined: Sep 19, 2006
From: UK
Member No.: 5681



QUOTE
Imagine splitting a million line program up into a useful amount of parallelism. Utter insanity if done wrong
I understand the implications, only the host program knows what each thread is upto etc. It has to be selectively used, if done by a programmer, but I think the clever bit will come when it can be selectively used by the program by it sensing the context of the code. Thats almost at the point of a computer understanding actual language, which is still sci-fi at this point.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Yocttar
post Nov 20, 2008, 01:35 PM
Post #5


Newbie
*

Group: Basic Member
Posts: 30
Joined: Nov 06, 2008
Member No.: 31717



If you realy want parallel programming, the heavy stuff, look through VHDL and ALTERA \ XILINX (I preffer altera because I'm more used to it).

It is more electronics related, in electronics, everything is parallel.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 22nd November 2017 - 01:24 AM


Home     |     About     |    Research     |    Forum     |    Feedback  


Copyright BrainMeta. All rights reserved.
Terms of Use  |  Last Modified Tue Jan 17 2006 12:39 am

Consciousness Expansion · Brain Mapping · Neural Circuits · Connectomics  ·  Neuroscience Forum  ·  Brain Maps Blog
 · Connectomics · Connectomics  ·  shawn mikula  ·  shawn mikula  ·  articles