Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which parallel programming APIs do you use? [closed]

Trying to get a grip on how people are actually writing parallel code currently, considering the immense importance of multicore and multiprocessing hardware these days. To me, it looks like the dominant paradigm is pthreads (POSIX threads), which is native on Linux and available on Windows. HPC people tend to use OpenMP or MPI, but there are not many of these here on StackOverflow it seems. Or do you rely on Java threading, Windows threading APIs, etc. rather than the portable standards? What is the recommended way, in your opinion, to do parallel programming?

Or are you using more exotic things like Erlang, CUDA, RapidMind, CodePlay, Oz, or even dear old Occam?

Clarification: I am looking for solutions that are quite portable and applicable to platforms such as Linux, various unixes, on various host architectures. Windows is a rare case that is nice to support. So C# and .net are really too narrow here, the CLR is a cool piece of technology but could they PLEASE release it for Linux host so that it would be as prevalent as say the JVM, Python, Erlang, or any other portable language.

C++ or JVM-based: probably C++, since JVMs tend to hide performance.

MPI: I would agree that even the HPC people see it as a hard to use tool -- but for running on 128000 processors, it is the only scalable solution for the problems where map/reduce do not apply. Message-passing has great elegance, though, as it is the only programming style that seems to scale really well to local memory/AMP, shared memory/SMP, distributed run-time environments.

An interesting new contender is the MCAPI. but I do not think anyone has had time to have any practical experience with that yet.

So overall, the situation seems to be that there are a lot of interesting Microsoft projects that I did not know about, and that Windows API or pthreads are the most common implementations in practice.

like image 806
jakobengblom2 Avatar asked Oct 03 '08 13:10

jakobengblom2


People also ask

What are the four types of parallel computing?

There are several different forms of parallel computing: bit-level, instruction-level, data, and task parallelism.

What are the different approaches for parallel programming?

1.3 Approaches to Parallel Programming Techniques for programming parallel computers can be divided into three rough categories: parallelizing compilers, parallel programming languages, and parallel libraries.

Which programming language is best for parallel processing?

I suggest to use C (or C++) as high level language, and MPI and OpenMP as parallel libraries. These languages are standard and portable, and these parallel libraries allow to apply parallel and distributed computing in a wide range of parallel systems (from a single-node multi-core processor to a cluster of many nodes.

When should you use parallel programming?

You can use parallel programming when you want to quickly process large amounts of data. It's easy, and it can help you complete projects much more quickly and efficiently. Data processing doesn't have to be difficult, and with the help of parallel programming, you can take your to-do list to the next level.


1 Answers

MPI isn't as hard as most make it seem. Nowadays I think a multi-paradigm approach is best suited for parallel and distributed applications. Use MPI for your node to node communication and synchronization and either OpenMP or PThreads for your more granular parallelization. Think MPI for each machine, and OpenMP or PThreads for each core. This would seem to scale a little bit better than spawning a new MPI Proc for each core for the near future.

Perhaps for dual or quad core right now, spawning a proc for each core on a machine won't have that much overhead, but as we approach more and more cores per machine where the cache and on die memory aren't scaling as much, it would be more appropriate to use a shared memory model.

like image 99
Nicholas Mancuso Avatar answered Sep 30 '22 19:09

Nicholas Mancuso