parallel

c# migrate a single threaded app to multi-threaded, parallel execution, monte carlo simulation

I've been tasked with taking an existing single threaded monte carlo simulation and optimising it. This is a c# console app, no db access it loads data once from a csv file and writes it out at the end, so it's pretty much just CPU bound, also only uses about 50mb of memory. I've run it through Jetbrains dotTrace profiler. Of total exec...

What functional language implementations allow threads to run in parallel?

The OCaml GC imposes a global lock that prevents mutators (threads) from running in parallel although they can run concurrently (interleaved). I believe the same is true of SML/NJ and MLton but not PolyML, GHC, F#, Clojure and Scala. What other functional language implementations allow threads to run in parallel? ...

Lucene.NET parallel indexing. i need a custom solution. Can anybody help?

Hi all, I'm using Lucene .NET I've got 2 threads, each one doing indexing of some different content (using a different algorithm, although they might try to index the same document). They are both writing to the same index (using a single IndexWriter instance). Also, I've got a web application that also needs to write to the index occ...

Do all of the assigned workflow tasks need to be complete in order for the workflow to continue working?

I have built a workflow in SharePoint Designer and put two "collect data from user" actions as parallel actions in the same step. Do both of the users need to complete their tasks in order for the workflow to continue to its next step? If both of them are needed, how can I build the workflow so that both users have tasks but only one o...

GCC Atomic Builtins instead of pthread?

I've found following article: Use GCC-provided atomic lock operations to replace pthread_mutex_lock functions It refers to GCC Atomic Builtins. What the article suggest, is to use GCC atomic builtins instead of pthread synchronization tools. Is this a good idea? PS. The mysql post is obviously misleading. Atomic Builtins can't replac...

Parallel SSH in Python

Hi, I wonder what is the best way to handle parallel SSH connections in python. I need to open several SSH connections to keep in background and to feed commands in interactive or timed batch way. Is this possible to do it with the paramiko libraries? It would be nice not to spawn a different SSH process for each connection. Thanks. ...

Synchronizing access to variable

I need to provide synchronization to some members of a structure. If the structure is something like this struct SharedStruct { int Value1; int Value2; } and I have a global variable SharedStruct obj; I want that the write from a processor obj.Value1 = 5; // Processor B to be immediately visible to the other proce...

How do you break out of parallel loops? ParallelBreak

Hi, in the following snippet, if you replace Do by ParallelDo, it will evaluate by a factor of 3 SLOWER, because now the loop will be broken in only ONE of the two kernels. ParallelEvaluate[NN = 10070]; SetSharedVariable[res] Module[{a, b, c}, Do[ c = NN - a - b; If[a a + b b == c c, res = a b c; Break[]] , {a, 1, NN}, {b, ...

How well does Xgrid work with Xcode for parallel compiling?

I'm intrigued by the idea of using Xgrid to speed up my Xcode compiling across multiple machines... but it seems very difficult to find any information on people's experiences with it, any gotchas, etc. I don't have multiple Macs that I can test it with right now, so I'm curious. Have you tried it? How well has it worked for you? What k...

How can I identify the Selenium Grid host running my test from within the test?

I am using Selenium Grid with TestNG to run my tests in parallel. I have certain tests that require a user to be logged in, so I have a user account configured for testing. I have been careful to ensure that any tests involving logging in as my test user are run on separate virtual machines so that sessions are not interrupted, however ...

.NET MPI implementation?

What is the most mature .NET MPI implementation? A quick google search turned up the two below, but I'm not familiar with either of them. I believe the first item (mpi.net) is based on Microsoft MPI. Any thoughts? http://www.osl.iu.edu/research/mpi.net/ http://www.purempi.net/ ...

How can you profile a parallelized Python script?

Suppose I have a python script called my_parallel_script.py that involves using multiprocessing to parallelize several things and I run it with the following command: python -m cProfile my_parallel_script.py This generates profiling output for the parent process only. Calls made in child processes are not recorded at all. Is it possib...

Parallel server-side processing of Sharepoint Web Parts

Here's the scenario. I have a number of Sharepoint Web Parts which display data to the user in a grid format. They all connect to a navigation web part which the user can use to select parameters for each of the data grids. On the back end, the grid web part calls a DI container to get an "IDataProvider," which queries some SoR and retur...

How can I use foreach with snow, to allow multicore on windows XP (in R).

could you please give an example on how that might be done using the doSNOW ? (I asked the same question here: http://blog.revolution-computing.com/2009/08/parallel-programming-with-foreach-and-snow.html And got only a partial reply) Tal ...

How to predict the behavior of a system based on previous behavior

I am looking for an algorithm that, based on the previous behavior of a system, predicts the future behavior. I'm building a parallel memory allocator that has a public list of empty blocks. Each thread, when it needs, can take blocks from this list and allocate from them. The blocks are grouped in bins, depending on the allocation si...

MATLAB: function makes 4 recursive calls. I have a 4-core processor. Can I parallelize?

Hi, I have a 4-core processor and have a recursive Matlab function which makes four recursive calls: function J = do_stuff(I) if some_condition(I) J = blah_blah(I); else [I1,I2,I3,I4] = split4(I); J1 = do_stuff(I1); J2 = do_stuff(I2); J3 = do_stuff(I3); J4 = do_stuff(I4); J = join4(J1,J2,J3,J4); end Is t...

Problem with own Spinlock implementation

I made a very simple spinlock using the Interlocked functions in Windows and tested it on a dual-core CPU (two threads that increment a variable); The program seems to work OK (it gives the same result every time, which is not the case when no synchronization is used), but Intel Parallel Inspector says that there is a race condition at...

Parallel pipelining

(fileNameToCharStream "bigfile" |>> fuse [length; splitBy (fun x -> x = ' ' || x = '\n') removeEmpty |>> length; splitBy (fun x -> x = '\n') keepEmpty |>> length; ]) (*fuse "fuses" the three functions to run concurrently*) |> run 2 (*forces to run in parallel on two threads*) |> (fun [num_chars; num...

Intel Fortran Compiler "-parallel" Not Working

Dear Collegues; I have a serial Fortran code that works fine. Once I compile the same code using ifort -parallel and run it, it gives wrong results and overflow. I would expect that with "-parallel" flag, the Intel compiler is capable of selecting the loops that are safe to parallelize and I should get the exact same results as for the ...

What am I doing wrong in this F# code?

let parallelTest n = Color(Color.DeepPink, Triangles(sphere n));; Parallel.For(0,10,new Action(parallelTest));; Error message : error FS0001: Type mismatch. Expecting a int -> unit but given a int -> scene. The type 'unit' does not match the type 'scene' I'll glad if some body help me. ...