Makes the GrayScott algorithm run concurrently if setParallelized is set to true. Primary purpose of this class is to handle breaking the algorithm up into concurrent worker threads. Here are some parallelism results using my Core2Duo 6400 (and later i7 2600k) using fixed size. Without parallelism 8.62 fps With parallelism (but not borders) 10.16 fps With parallelism (and borders in sep thread) 10.36 fps After more tuning 18 fps (num steps per frame = 10) Using offscreen rendering slowed things by about 10% These numbers are with Hyperthreading off. The difference compared to hyperthreading off is barely 10%. pr/ns pr/sync npr/ns npr/synch ------- ------- ------- ------- parallel calc | 23.8 21.1 20.9 20.5 n-par calc | 19.0 17.1 17.0 n-par calc/offscreen| 12.8 12.9 par calc/offscreen | 17.2 14.2 14.3 14.1 pr/ns : parallel rendering/ no synchronized npr/ns : no parallel rendering no synchronization. Parallel rendering without synchronization is fast, but has bad rendering artifacts. Made some more improvements - upgraded to ci7 2600k with 4 cores and 8 threads (hyper-threaded). - fixed a bug in Model.commit where I was using arrayCopy instead of just a pointer swap. - Modified parallel rendering code so that I compute images and write them quickly rather than drawing individual points which needed to be synchronized (set color, then draw point) Notes - The difference between onscreen and offscreen rendering seems negligible. - Getting really great CPU utilization of cores - somewhere around 85%. - The temperature of the CPU really heats up. Saw max temp of 76C. par rend non-par rendering ------------ -------------- parallel calc | 180 fps 78 fps n-par calc | 102 fps 66 fps For larger rectangle than fixed the performance increases seem even better par rend non-par rendering ------------ -------------- parallel calc | 19.5 fps 8.1 fps n-par calc | 13.2 fps 6.8 fps
@author Barry Becker
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.