Lab 7. Prime Number Fractals.


Task 1.  Generate PNF sets

-           Get organised. (create the folder lab07 + a subfolder PNF fractal).

-           Copy in this folder the files PrimeFractal.c and Makefile.

-           Compile and run the program for several values of n and size.

-           Change the number of colors used in the program.

-           Observe the execution times.


Task 2.  Compare various types of scheduling

-           Observe the execution times for p=1,2,4,6 and 8 for the uniform block scheduling.

-           Note these execution times into a spread sheet.

-           Change the scheduling to a cyclic one and observe/note the new execution times.

-           Derive the formulas for bounds of the balanced workload block scheduling use w(i) = sqrt(i).

-          For the Balanced Workload Block (Recursive Bisection) scheduling try to find the lower and upper bounds

o   The workload of isPrime (i) is.

o   The overall workload is  

o   The average workload per processor is 

o   Calculate the upper bound using .

o    So that we can use the loop

§  for(i=n*pow(1.*rank/size,1.5)+1;i<= n*pow(1.*(rank+1)/size,1.5);i++) …

-          Put these execution times on a table e.g. size=1, 2, 4, 6.

-          Calculate the speedup for each strategy

-          Draw each speedup and observe which scheduling is better.