
- WINDOWS PARALLEL PROCESSING SERIAL
- WINDOWS PARALLEL PROCESSING CODE
- WINDOWS PARALLEL PROCESSING SERIES

WINDOWS PARALLEL PROCESSING CODE
There are two main ways in which code can be parallelized, via sockets or via forking. The more complicated parallel situations arise generally in deeper computer science scenarios, for example handling many users of a service. Here we’re going to exclusively discuss the perfectly parallel situation it is where most (though of course not all) statistical situations will land. It may be better to run the first \(k\) in serial, the next \(k\) in serial, etc. In general, if each f* is very fast, running them all parallel may not be the most efficient (due to overhead). Sometimes the dependency occurs at the end of each function so we could start running f1 and f2 in completion, but f2 would pause before finishing while it waits for f1 to finish. In this case, any f* can start at any point and run to completion regardless of the status of any other f*. On the other hand a “perfectly parallel” problem is one in which there is absolutely no dependency between iterations most of the *apply calls or simulations we’ve discussed in this class fall into this category. The equation is not quite as clean (there are other things running on each process overhead in transferring between processors exists etc) but in general we see the same gain.Ī problem can range from “inherently serial” to “perfectly parallel” 1.Īn “inherently serial” problem is one which cannot be parallelized at all - for example, if f2 depended on the output of f1 before it could begin, even if we used multiple computers, we would gain no speed-ups 2. However, modern computers have “multicore” processors and can be equivalent to running multiple computers at a time. In the old days this was how parallel code was run and is still run on larger servers. If however, we have k < n computers we can run our models on, the total running time will n*s/k.

If we have a single computer at our disposal and have to run n models, each taking s seconds, the total running time will be n*s. Parallel processing (in the extreme) means that all the f# processes start simultaneously and run to completion on their own. Once f1 completes, f2 begins, and the process repeats.
WINDOWS PARALLEL PROCESSING SERIAL
Serial processing means that f1 runs first, and until f1 completes, nothing else can run.

WINDOWS PARALLEL PROCESSING SERIES
Let’s be a little more formal.Ĭonsider that we have a series of functions to run, f1, f2, etc. We’ve vaguely discussed this idea in passing, specifically in that *apply functions are faster than for loops (usually).
