parallel cartographic modeling

15
Parallel Cartographic Modeling Kiumars Soltani 6th July 2012

Upload: gypsy

Post on 20-Feb-2016

42 views

Category:

Documents


0 download

DESCRIPTION

Parallel Cartographic Modeling. Kiumars Soltani 6th July 2012 . Outline. Rethinking Euclidean distance and direction calculations. The timing method Run the code on Trestles Profiling. Euclidean Direction and Distance. Sequential version was faster than the parallel version. Remember? - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Parallel Cartographic Modeling

Parallel Cartographic Modeling

Kiumars Soltani6th July 2012

Page 2: Parallel Cartographic Modeling

Outline

• Rethinking Euclidean distance and direction calculations.

• The timing method

• Run the code on Trestles

• Profiling

Page 3: Parallel Cartographic Modeling

Euclidean Direction and Distance

• Sequential version was faster than the parallel version. Remember?

• Some calculations are time consumingx_temp = …;

y_temp = …;

out1 = atan(y_temp/x_temp) * 57.2957795;

out2 = sqrt(pow(x_temp,2) + pow(y_temp,2));

x_temp = …;

y_temp = …;

out1 = atan(y_temp/x_temp);

out2 = abs(y_temp / sin(out1));

out1 *= 57.2957795;

Page 4: Parallel Cartographic Modeling

Euclidean Direction and Distance

• There are others expression in the code(particularly Euclidean Distance & Direction calculation function) that can be improved in the same way.

• This can be considered as a general approach during the development of the DSL:o We have to avoid redundant calculationo We have to use the fastest possible method to achieve the

result.

Page 5: Parallel Cartographic Modeling

Change the Timing Method

Using Linux’s own method of timing

struct timeval tv1,tv2;

double diff;

gettimeofday(&tv1,NULL);

// THE SECTION THAT WE WANT TO TIME

gettimeofday(&tv2,NULL);

diff = (tv2.tv_sec - tv1.tv_sec) * 1000.0; // sec to ms

diff += (tv2.tv_usec - tv1.tv_usec) / 1000.0; // us to ms

Page 6: Parallel Cartographic Modeling

It’s all part of the input

Change the way program get the input file and parameters

./model1.out INPUT_FILE #rows #columns #cores

This way we can test the program with different input files and different number of available cores by running one script.

Page 7: Parallel Cartographic Modeling

Running the codes on Trestles

• One node -> 32 cores

• Using Intel C Compiler

REMINDER

Model 1 is solving the loop-carried dependency by defining critical sections.

Model 2 is solving the loop-carried dependency by loop interchanging.

The main part of the Model 2 is now using static scheduling with the chunk size 1.

Page 8: Parallel Cartographic Modeling

Check the Result

Model 1

Model 2

Page 9: Parallel Cartographic Modeling

Running Time

Program/Time Read Euclidean distance + direction

Main computation

Write

Babak’s 7.14 5.13 9500 1.06

Model1 0.184 0.035 245.720 0.379

Model2 0.184 0.033 56.299 0.381

Page 10: Parallel Cartographic Modeling

Profiling – Euclidean Distance & Direction

0 5 10 15 20 25 30 350

5

10

15

20

25

30

35

EUCLIDEAN - MODEL1

Series1

Page 11: Parallel Cartographic Modeling

Profiling – Euclidean Distance & Direction

0 5 10 15 20 25 30 350

5

10

15

20

25

30

35

EUCLIDEAN - MODEL2

Series1

Page 12: Parallel Cartographic Modeling

Profiling – Main Computation Part

0 5 10 15 20 25 30 350

5

10

15

20

25

30

35

Computation - MODEL1

Series1

Page 13: Parallel Cartographic Modeling

Profiling – Main Computation Part

0 5 10 15 20 25 30 350

5

10

15

20

25

30

35

Computation - MODEL2

Series1

Page 14: Parallel Cartographic Modeling

Future improvements

• Improving the profiling approach

• Rethinking the Euclidean distance and direction calculations method.– Summarizing the computations

– Investigating the underlying reason that makes the parallel version not efficient.

• Change the scheduling of the model 1.

Page 15: Parallel Cartographic Modeling

Thank You!Got Question?