HagesLab / OneLayer

One-layer transient PL simulations, but in runnable application form
GNU General Public License v3.0
0 stars 0 forks source link

Use multiple CPU cores for simulations #18

Open cfai2304 opened 3 years ago

cfai2304 commented 3 years ago

When multiple initial state files are selected, TEDs will simulate them in series on a single CPU. There is wasted potential here now that multicore machines are mainstream. My mid-range laptop has eight cores, for example, and I'm pretty sure some of the lab computers have up to 16.

I estimate that a typical use case will have no more than 100 queued simulations at a time. While I don't think the queue size is large enough to justify involving GPUs, it is a good size for multiple CPUs.

It should be relatively straightforward to divide up queued simulations among multiple CPUs and solve in parallel by combining do_Simulate() with the multiprocessing library. We should also add an input box to the Simulate tab for the user to select how many CPUs they want to use.

eistrup commented 3 years ago

In the case of MAPI_Rubrene UpConversion, at least, this will be very applicable for power-dependent simulations - every different power runs a completely independent simulation which can run in parallel.