140 likes | 420 Views
Parallel Mandelbrot Set. Gulnara Fayzulina. Mandelbrot Set. Fractal An object that displays self-similarity Defined by quadratic recurrence relation Z n+1 =Z n 2 +C For fixed C, varying Z in complex plane Forms Julie set If Julia set is connected, the point belongs to Mandelbrot set
E N D
Parallel Mandelbrot Set GulnaraFayzulina
Mandelbrot Set • Fractal • An object that displays self-similarity • Defined by quadratic recurrence relation Zn+1=Zn2+C • For fixed C, varying Z in complex plane • Forms Julie set • If Julia set is connected, the point belongs to Mandelbrot set • If recursion for z0=0 remains bounded for some C, then the resulting Julia set
Mandelbrot Set Code • Code cycles through 50 steps first to check for divergence • If |zn|>2 exits loop • After 50 steps begins to check for convergence in addition for divergence • if|zn-1-zn|<0.01 exits loop • Cuts running time down in half • Plotting: • If c converges, set x=RE[c], y=IM[c], z=Iterations • If c diverges, set x=RE[c], y=IM[c], z=count at loop exit
Grid • Creates number of grids equal to the number of threads squared
For Code • Cannot do nested loops in earlier versions of OpenMP • Used #pragma omp for function to parallelize for loops cycling through range and domain of the plot For(i=0;i<steps;i++) Parallel dynamic for(j=0;j<steps;j++) • Compared the performance of Grid Code with For Code • Used average of 10 runs
Times for Individual Processors Static Allocation of Grids Dynamic Allocation of Grids Rank 0: time=3.596115 Rank 3: time=3.596116 Rank 9: time=3.596121 Rank 2: time=3.596115 Rank 8: time=3.596119 Rank 6: time=3.596122 Rank 5: time=3.596122 Rank 7: time=3.596122 Rank 1: time=3.596115 Rank 4: time=3.596120 Rank 0: time=1.884722 Rank 5: time=2.585089 Rank 9: time=2.682963 Rank 8: time=2.752351 Rank 2: time=3.155273 Rank 4: time=3.612007 Rank 7: time=3.732685 Rank 1: time=3.777913 Rank 6: time=3.784145 Rank 3: time=3.857923 Steps 1000 Iterations 2000 Threads 10
Another Grid Algorithm • The grids are created by slitting up the domain into threads*2 parts • The grids are then dynamically allocated among processors • If thread number is 3, the range and domain are partitioned in the following way
Conclusion • Scales up to 10 processors • As processors are increased the time asymptotes around a value determined by resolution