parallel-programming

Making test run in parallel

I have a script execution engine in which the end users write scripts to run their test. Now we want to run about 40 tests in parallel. I was wondering if I should convert all the scripts(in Perl or VBA) to C# code and then parallelism it or try to control the scripting engine from C# to run all those scripts in parallel? Any suggestion ...

.Net 4.0 Parallel Programming - how to write data to concurrent collections?

I have a grid which is defined as: List<List<Cell>>, where "Cell" is a custom class of mine. My program has several threads which access various coordinates on the grid, and change data in the "Cell" class. But I only want one thread writing data to a "Cell" object at a time. I thought using concurrent collections such as ConcurrentBag w...

Scala analogues of QtConcurrent

Hello! What are the analogues of QtConcurrent for Scala (or Java)? Ie simplified implementation of MapReduce, the parallel map and foldl. Thank you ...

Getting back into C++ (tools, debuggers, environments, compilers)?

I'm going to be using a subset of C++ (working within some of the ideas in Elements of Programming), but I haven't used C++ in years. I'm going to be writing a highly parallel algorithm on a 100+ nodes system with shared memory. The nodes are Mac OS X, but I have access to *nix and windows machines, too. Do people have suggestions for e...

Parallel optimization in R

This question came at the right time, as I'm struggling with optimization as well. I am aware of the different "normal" optimization routines in R, and I am aware of parallel packages like snow, snowfall, Rmpi and the likes. Yet, I didn't manage to get an optimization running in parallel on my computer. Some toy code to illustrate : f...

An Exercise on parallel programming and object oriented design

Hi, I am trying to self-study both object oriented design and parallel programming using the following books: "agile software development" by Robert C. Martin Bruce Eckel's "Thinking in Patterns with Java" "The Art of Multiprocessor Programming" Maurice Herlihy "Programming Massively Parallel Processors" by David B. Kirk But to prac...

Am I allowed to throw an exception inside MPI-parallelized code?

These are some general questions I am facing while designing the error handling for an algorithm that is supposed to run in parallel using MPI (in C++): Do Exceptions work inside code that is executed in parallel? Is the behaviour defined? How do they work? Does that differ for different implementations? Is it good practice - or should...

Is there an equivalent to 'continue' in a Parallel.ForEach?

I am porting some code to Parallel.ForEach and got an error with a continue I have in the code. Is there something equivalent I can use in a Parallel.ForEach functionally equivalent to 'continue' in a foreach loop? Parallel.ForEach(items, parallelOptions, item => { if (!isTrue) continue; }); ...

Concurrent acess to EF4 entities (Parallel + EF4)

I'm currently working in a dispatcher service that processes thousands of messages delivered in different channels (email, private message, application message) using EF4 and WCF. To try to speed up message dispatching i'm trying to use Parallels: Parallel.ForEach(currentMessageList, m => { Processors.DispatcherWrapper.Dispatch(m, m.un...

Stopping individual threads

Using the pthread library in C, is it possible to send a SIGSTOP signal to an individual thread? I want to ensure that even though I create N threads in a loop, all should start executing only when all of them have been created. I ask because the man page for pthread_kill() mentions: Signal dispositions are process-wide: if ...

Is there a chance to replace a while loop with the TPL?

Hi there, I've a two while loops, which I will have run parallel with the TPL. My code : public void Initialize() { cts = new CancellationTokenSource(); ParallelOptions options = new ParallelOptions(); options.CancellationToken = cts.Token; options.MaxDegreeOfParallelism = Environment.ProcessorCount; task = Task.Fac...

Optimum number of threads for a highly parallelizable problem

I parallelized a simulation engine in 12 threads to run it on a cluster of 12 nodes(each node running one thread). Since chances of availability of 12 systems is generally less, I also tweaked it for 6 threads(to run on 6 nodes), 4 threads(to run on 4 nodes), 3 threads(to run on 3 nodes), and 2 threads(to run on 2 nodes). I have noticed ...

Parallel Processing in python

Whats a simple code that does parallel processing in python 2.7? All the examples Ive found online are convoluted and include unnecessary codes. how would i do a simple brute force integer factoring program where I can factor 1 integer on each core (4)? my real program probably only needs 2 cores, and need to share information. I know ...

Can message-oriented middleware be used instead of MPI to coordinate distributed computation?

By message-oriented middleware I am referring to technologies such as Advanced Message Queuing Protocol. Obviously AMQP is a different beast than MPI, but I would think distributed-memory computations that operate in a master-slave manner could be trivially implemented using AMQP, letting AMQP handle equitable work distribution to sla...

C++: How to parallelize reading lines from an input file when lines get independently processed?

I just started off with OpenMP using C++. My serial code in C++ looks something like this: #include <iostream> #include <string> #include <sstream> #include <vector> #include <fstream> #include <stdlib.h> int main(int argc, char* argv[]) { string line; std::ifstream inputfile(argv[1]); if(inputfile.is_open()) { whi...

Track progress when using Parallel.ForEach

I am refactoring my program to use Parallel.ForEach. Before, when I was using a regular for loop, I was updating a WPF progress bar using Dispatcher, displaying the % completed by dividing the current array index by the array size. With a parallel foreach loop this does not display properly i.e. % jumps eratically, which is expected. Ho...

How to parallelize this situation with robots

Hello, I'm working on a robotic problem. The situation is something like this: There are N number of robots (generally N>100) initially all at rest. Each robot attracts all other robots which are with in its radius r. I've set of equations with which I can compute acceleration, velocity & hence the position of the robot after time del...

MPI on PBS cluster Hello World

I am using mpiexec to run a couple of hello world executables. They each run, but the number of processes is always 1 where it looks like there should be 4 processes. Does someone understand why? Also I'm not sure why stty is giving me an invalid argument. Thanks! Here is the output: /bin/stty: standard input: invalid argument...

Changing the incremental value of a C# Parallel.For loop

I want to convert a for loop which increments the iterator by 2 every pass into a Parallel For loop using the TPL. The data is not order dependent or constrained in any way, but I only want to process the data in every other element of my source array (which is _Datalist in the code below), hence the need to increment by 2. My For Loop:...

Index out of range exception when using Parallel for loop

I am trying to execute the following code and I keep getting an Index out of range exception when trying to assign array values to the list:- int[] array = new int[1000000]; for (int i = 0; i < array.Length; i++) { array[i] = i; } List<int> list = new List<int>(); Parallel.For...