Changes

Jump to: navigation, search

GPU610/SSD

2,543 bytes added, 15:35, 19 April 2013
Closest Pair
- The Project is on [https://github.com/sezar-gantous/GPU610-CERN Github](with the modified make file and c converted code)
The profile with the C converted code
% cumulative self self total
time seconds seconds calls ms/call ms/call name
3938.98 75 2619.68 47 2619.68 524 50.92 50.92 ordres_ 37.42 51.65 24.97 47 314400 0.08 06 0.08 06 zfunr_ 1230.69 04 6034.12 856 15.09 524 28.80 28.47 80 ordres_ 314400 9.83 039.03 50 04.03 cfft_94 f__cabs
As you can see there aren't any real difference/improvements just yet...
System specifications:
RAM: 1GB DDR2
GPU: nVIDIA GEFORCE GT 620
 
== Closest Pair ==
 
'''Unfortunately we had to abandon the project since it was not really compatible with CUDA(there is no time to look more into it as the semester is almost over...). Team TudyBert, who are also working on the same project, have found that CUDA uses dynamic libraries where Dirve_God_Lin uses static libraries and there isn’t much to be done about that. As a result, we will be using Stephanie’s closet pair program.'''
 
 
The closest pair problem can be explained simply by imagining a random set of points spread in a [http://en.wikipedia.org/wiki/Metric_space metric space]. Now the process of finding two points with the smallest distance between them is called the closest pair problem.
 
 
One of the more common algorithms used to find the closest pair is the Brute-force algorithm; which is calculating the distances of all the points ( O(n^2) notation):
 
n=total number of points
n(n-1)/2
 
 
then simply look for the pair of points that has the smallest distance between each other. However, this algorithm was evident to be slow.
This is the function used in the closestPair.c program that Stephanie used for her assignment 1:
 
double brute_force(point* pts, int max_n, point *a, point *b)
{
int i, j;
double d, min_d = MAXDOUBLE;
for (i = 0; i < max_n; i++) {
for (j = i + 1; j < max_n; j++) {
d = dist(pts[i], pts[j]);
if (d >= min_d ) continue;
*a = pts[i];
*b = pts[j];
min_d = d;
}
}
return min_d;
}
 
This is the profile:
 
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
99.78 41.58 41.58 16384 2.54 2.54 brute_force
0.14 41.64 0.06 closest
0.05 41.66 0.02 cmp_x
0.02 41.67 0.01 cmp_y
 
 
System specifications:
 
OS: Ubuntu 12.04 32-bit
CPU: Intel(R) Core 2 Duo(R) CPU E4600 @ 2.40GHz x 2
RAM: 2GB DDR2
GPU: nVIDIA GEFORCE GT 620
 
 
As a consequence, we presume that by making the brute force function parallel using CUDA technology will speed up the process significantly.
 
Github link [https://github.com/sezar-gantous/GPU610-ClosestPair here]
=== Assignment 3 ===
1
edit

Navigation menu