Strict load balancing of multiple .NET processes

I have a multiprocess scientific simulation. NET (F #) running on Windows Server 2008 SE and 64 processors. Each time step of the simulation ranges from 1.5 seconds to 2 seconds. Since each process must wait for other processes, the total speed is the speed of the slowest process (2 s * number of iterations). Therefore, I need to minimize process fluctuations as little as possible.

Is there a way to make a set of processes have the same “computational time” that is available for computing them?

+7
source share
3 answers

I'm not sure I understand 100% what you want to do. But to synchronize between processes, you can use the name EventWaitHandle or Semaphore .

Update per comment

You can use ProcessorAffinity to restrict processes on specific processors.

0
source

Is it possible for you to paralyze a 2-second series so that you have several "branches" of parallel modeling?

Example: Assume this is 1 simulation with 4 processes. Process 1 takes 2 seconds, so you cannot finish until process 1 is complete.

 process1---------------------------------------------- (2 sec) process2-------- (0.5 sec) process3---- (0.25 sec) process4---------------------------- (1 sec)
process1---------------------------------------------- (2 sec) process2-------- (0.5 sec) process3---- (0.25 sec) process4---------------------------- (1 sec) 

You have a lot of free time where most processes wait for process 1.
For the work you are trying to do, is it possible to have more than one of these sets at the same time? If so, then you can use your unoccupied kernels while working on other simulators while they wait for the completion of your longer process.

+1
source

I don’t know how you can ask the OS to try to plan your processes more equitably, but I know that there is a lot of research on methods that avoid the architecture that you use precisely because this effect with the lowest common denominator is the main bottleneck in practice .

My favorite article on this topic is the difficulty of caching multi-threaded caches of forgotten algorithms from Frigo and Strumpen. They describe exciting methods such as the space-time division that turn parallel computing, such as the one you describe, into an arbitrarily fine-grained asynchronous calculation that simplifies load balancing.

+1
source

All Articles