parallel cartographic modeling
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 PresentationTRANSCRIPT
Parallel Cartographic Modeling
Kiumars Soltani6th 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?
• 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;
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.
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
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.
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.
Check the Result
Model 1
Model 2
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
Profiling – Euclidean Distance & Direction
0 5 10 15 20 25 30 350
5
10
15
20
25
30
35
EUCLIDEAN - MODEL1
Series1
Profiling – Euclidean Distance & Direction
0 5 10 15 20 25 30 350
5
10
15
20
25
30
35
EUCLIDEAN - MODEL2
Series1
Profiling – Main Computation Part
0 5 10 15 20 25 30 350
5
10
15
20
25
30
35
Computation - MODEL1
Series1
Profiling – Main Computation Part
0 5 10 15 20 25 30 350
5
10
15
20
25
30
35
Computation - MODEL2
Series1
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.
Thank You!Got Question?