我有一个多过程的网络(F#)科学模拟,在Windows 2008 SE和64个处理器上运行。 模拟的每次时间从1.5秒到2秒。 由于每个进程都必须等待其他进程,总体速度是进程最缓慢的速度(2个附件* 频率)。 因此,我需要尽可能减少这一进程的冲击。
是否有办法强制实施一套程序,使之与计算所用“计算时间”完全相同?
我有一个多过程的网络(F#)科学模拟,在Windows 2008 SE和64个处理器上运行。 模拟的每次时间从1.5秒到2秒。 由于每个进程都必须等待其他进程,总体速度是进程最缓慢的速度(2个附件* 频率)。 因此,我需要尽可能减少这一进程的冲击。
是否有办法强制实施一套程序,使之与计算所用“计算时间”完全相同?
I m not sure I understand 100% what you want to do. But for inter-process synchronization you can use a named EventWaitHandle
or Semaphore
.
您可使用ProcessorAffinity
,以限制特定加工商的程序。
Is it possible for you to paralelize the 2 second series, so that you have multiple "branches" of the simulation occuring in parallel?
Example: Suppose that this is 1 simulation with 4 processes. Process 1 takes 2 seconds, so you cannot finish until process 1 completes.
process1---------------------------------------------- (2 sec)
process2-------- (0.5 sec)
process3---- (0.25 sec)
process4---------------------------- (1 sec)
You have a lot of idle time in there where most of your processes are waiting on process 1.
For the work you are trying to do, is it feasible to have more than 1 of these sets running at the same time? If so, then you could utilize your idle cores by working on other simulations while they are waiting for your longer running process to finish.
I do not know how you can ask the OS to try to schedule your processes more fairly but I do know that there is a lot of research on techniques that avoid the architecture you are using precisely because this lowest-common-denominator effect is a major bottleneck in practice.
http://www.fftw.org/~athena/papers/tocs08.pdf Frigo和Stumpen的多管切切切切切 algorithm法()的复杂程度。 它们描述了一些焚化技术,例如空间时分层,这些技术将批量子的计算变成一种任意的细量细微的单同步计算,使负荷无法平衡。
As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....
I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...
I ve got some code which sets up a datacontext. Often enough, the datacontext should be set to some underlying data collection, such as an ObservableCollection - but occasionally I d like to set it ...
I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...
NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...