parallel-processing

OpenMP for nested for loops?

Hi, I am attempting to use OpenMP in my project that contains N agents in a simulation. Every agent has a position vector. Inside my program, I do something like the following: for(int i=0;i<agents.size();i++){ for(int j=0;j<agents.size();j++){ if(i==j) continue; if(distance_between(i,j)<10){ //do a lot of calculations for ...

pattern for .NET parallelism beyond a single computer

I suspect that I will soon exhaust the speed improving possibilities of threading on multiple cores in a single computer. What does this .NET desktop programmer need to learn to move a parallel-feasible problem onto multiple computers? My preference is to minimize the total lifecycle programming effort so it would be preferred if the...

OpenCL Events and Command Queues

I'm working on translating a CUDA application (this if you must know) to OpenCL. The original application uses the C-style CUDA API, with a single stream just to avoid the automatic busy-wait when reading the results. Now I notice that OpenCL command queues look a lot like CUDA streams. But in the device read command, and likewise in ...

Help running Python multiprocessing program under SGE

I have a Python program that runs multiple threads using the multiprocessing module. The program runs fine when executed on a stand-alone machine with multiple cores, using all cores, or on a cluster when executing from the shell directly. However, when trying to run it through SGE (Sun Grid Engine), either through a job script or usin...

C# Parallel Vs. Threaded code performance

I've been testing the performance of System.Threading.Parallel vs a Threading and I'm surprised to see Parallel taking longer to finish tasks than threading. I'm sure it's due to my limited knowledge of Parallel, which I just started reading up on. I thought i'll share few snippets and if anyone can point out to me paralle code is runni...

Python and OpenMP C Extensions

I have a C extension in which I'd like to use OpenMP. When I import my module, though, I get an import error: ImportError: /home/.../_entropysplit.so: undefined symbol: GOMP_parallel_end I've compiled the module with -fopenmp and -lgomp. Is this because my Python installation wasn't compiled with the -fopenmp flag? Will I have to bui...

OpenMP and File I/O

I'm doing some time trials on my code, and logically it seems really easy to parallelize with OpenMP as each trial is independent of the others. As it stands, my code looks something like this: for(int size = 30; size < 50; ++size) { #pragma omp parallel for for(int trial = 0; trial < 8; ++trial) { time_t start, end; ...

If MPI is Message Passing Interface, then what is MPICH ?

Can anyone defines clearly what is MPICH ? For what it is used ? Its relation with MPI. Why do we need MPICH ? ...

How can I parallel-ize an algorithm on a machine with multiple processors?

Intel Core2Duo, for example is supposed to have a single die but two cores. So, it should be possible to control what is processed on which core, which means that it is possible to instruct my algorithm to use the two cores in parallel. The question is how? Do I need to go down at the kernel level to do this, or is there a simpler wa...

Passing properties as parameters

I want to create a generalized helper method for LoadFromXML loading and validation. If the XML I'm loading from is incomplete, I do want it to fail completely without throwing an exception. Currently, my code looks like this (more or less) public override bool Load(XElement source) { return new List<Func<XElement, bool>> { ...

Is there any programmable parallel programming environment\framework for C# developers?

So what I want is simple - control over processes that are ran on different connected (at least via ethernet) group\grid\cluster of PCs... something like "Parallel C#" but in form of array of .net libs and programs. Is there any programmable parallel programming environment\framework for C# developers? ...

Parallel Shuffle in C# 4?

Hi all, As noticed in this question: http://stackoverflow.com/questions/273313/randomize-a-listt-in-c you can implement a shuffle method on a list; like one of the answers mentions: using System.Security.Cryptography; ... public static void Shuffle<T>(this IList<T> list) { RNGCryptoServiceProvider provider = new RNGCryptoServicePro...

Parallelize resolution of differential equation in Python

hi, i am solving a system of ordinary differential equations using the odeint function. Is it possible (and if yes how) to parallelize easily this kind of problem? ...

What is the "m-bridge technique" for partitioning binary trees for parallel processing?

How does it work? Please explain in enough detail in English or pseudocode so that I can implement in any language. It is mentioned and briefly described in this paper: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.4.3643&amp;rep=rep1&amp;type=pdf but there isn't enough detail there to implement myself. (the weights in Fig...

How can I ensure that my Fortran FORALL construct is being parallelized?

I've been given a 2D matrix representing temperature points on the surface of a metal plate. The edges of the matrix (plate) are held constant at 20 degrees C and there is a constant heat source of 100 degrees C at one pre-defined point. All other grid points are initially set to 50 degrees C. My goal is to take all interior grid points...

Natural distributed computing using .NET TPL

I am developing an application that has the potential for massive parallel processing. Currently, I am using a single PC with 8 cores, but I need to support distributed computing. TPL Constructs such as PLINQ and Parallel.ForEach could be used to naturally distribute work load between different threads. How could they be made to distrib...

Is it possible to change parallelOptions.MaxDegreeOfParallelism during execution of a Parallel.ForEach

I am running a multi-threaded loop: protected ParallelOptions parallelOptions = new ParallelOptions(); parallelOptions.MaxDegreeOfParallelism = 2; Parallel.ForEach(items, parallelOptions, item => { // Loop code here }); I want to change the parallelOptions.MaxDegreeOfParallelism during the execution of the parallel loop to reduce or ...

Concurrency, 4 CUDA Applications competing to get GPU resources

What would happen if there are four concurrent CUDA Applications competing for resources in one single GPU so they can offload the work to the graphic card?. The Cuda Programming Guide 3.1 mentions that there are certain methods which are asynchronous: Kernel launches Device device memory copies Host device memory copies of a memory...

Parallel.For as opposed to for loop

I am experimenting with parallel programming. I have a normal loop: for (int i = 0; i < 100000; i++) { Console.WriteLine("Thread ID: {0} and i is " + i + " Time Elapsed: " + sw.Elapsed, Thread.CurrentThread.ManagedThreadId); } This loops just increments numbers to 100000 Can I use this for loop and turn it into a Parallel...

Partitioner class usage

After looking to this interesting movie http://channel9.msdn.com/posts/philpenn/Speeding-up-ParallelFor-using-the-Range-Partitioner/ I was wondering how I can change the code below when the collection is a LinkedList not an array: int size = 300000000; int[] data = new int[size]; Parallel.ForEach(Partitioner.Create(0, size), (Tuple<int...