Changes

Jump to: navigation, search

Dev/null

5,663 bytes added, 17:46, 15 December 2015
Team Members
= /dev/null =
== Team Members ==
# [mailto:yjghitisduque@senecacollege.ca?subject=gpu610 Yehoshua Ghitis], Stuff Text search
# [mailto:bbershadsky@myseneca.ca?subject=gpu610 Boris Bershadsky], Prime generator
# [mailto:oaislam1@myseneca.ca?subject=gpu610 Ozal Islam], Precision of Pi
[mailto:yjghitisduque@senecacollege.ca, oaislam1@myseneca.ca, bbershadsky@myseneca.ca?subject=dps901-gpu610 Email All]
== Progress ==
=== Assignment 1 ===
==== Headline text Precision of Pi ====
Calculation of Pi:[[Image:1003158dede1593d491078454cd2394e.png| File]] The number of miliseconds required to complete the function for computing the precision of Pi takes longer if the number of iterations is increased by 10 exponentially. If GPU was used to compute the function then the number of miliseconds could be drastically reduced with high number of iterations.   Test runs with number of iterations: <pre>oaislam1@matrix:~/Ozal fill /GPU610/a1> time a1 100Compute pi - took - 0 millisecs3.131592903558551910236928961239755153656005859375 real 0m0.137suser 0m0.004ssys 0m0.008soaislam1@matrix:~/Ozal/GPU610/a1> time a1 5000Compute pi - took - 0 millisecs3.14139265359178754266622490831650793552398681640625 real 0m0.145suser 0m0.004ssys 0m0.004soaislam1@matrix:~/Ozal/GPU610/a1> time a1 10000Compute pi - took - 1 millisecs3.141492653590030936783250581356696784496307373046875 real 0m0.143suser 0m0.000ssys 0m0.012soaislam1@matrix:~/Ozal/GPU610/a1> time a1 100000Compute pi - took - 12 millisecs3.14158265358971622305261917063035070896148681640625 real 0m0.141suser 0m0.012ssys 0m0.012soaislam1@matrix:~/Ozal/GPU610/a1> time a1 1000000Compute pi - took - 139 millisecs3.141591653589779209454491137876175343990325927734375 real 0m0.269suser 0m0.140ssys 0m0.008soaislam1@matrix:~/Ozal/GPU610/a1> time a1 1000000000Compute pi - took - 178576 millisecs3.14159265258789854868837210233323276042938232421875 real 2m58.717suser 2m58.315ssys 0m0.040s</pre> Sample GProf profile:<pre>Flat profile: Each sample counts as 0.01 seconds.% cumulative self self totaltime seconds seconds calls Ts/call Ts/call name100.00 10.05 10.05 compute_pi(int)0.00 10.05 0.00 1 0.00 0.00 _GLOBAL__sub_I__Z10compute_pii</pre>  ==== Calculation of prime numbers ==== Prime numbers are essential in the science of cryptography and are a good test of computational capacity of computers. The bigger the number, the more exponentially the hardware must work to calculate the next prime number. Calculation of prime numbers is a very simple objective with a simple double for loop:  for (int i = 2; i<100; i++) for (int j = 2; j*j <= i; j++) { if (i % j == 0) break; else if (j + 1 > sqrt(i)) { std::cout << i << " "; } }  However, this serial processing is extremely inefficient when the numbers become extremely large. For the range of 1-1,000,000 the results are as follows: real 0m4.982suser 0m3.644ssys 0m0.072s    Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls Ts/call Ts/call name 100.00 3.63 3.63 genPrime(unsigned long long, unsigned long long) 0.00 3.63 0.00 1 0.00 0.00 _GLOBAL__sub_I__Z8genPrimeyy   There are 78496 prime numbers in the calculated range. Splitting the for loop between several cores to handle each subrange separately can yield extremely high performance gains. Console output:  \\CPD S4\GPU610\a1\a1Boris\Debug>a1Boris 5000***Team /dev/null GPU610 PRIME NUMBER GENERATOR***No range given (or bad input), using preset valuesGenerating from range (0~5000)-------------------------------------------------------------------------------- 5 7 11 13 17 19 23 29 3137 41 43 47 53 59 61 67 71 7379 83 89 97 101 103 107 109 113 127131 137 139 149 151 157 163 167 173 179181 191 193 197 199 211 223 227 229 233  ==== String search ====A simple program that searches for a string inside a text file and prints every line where it is found.  <pre>./find kari text.txtno half-tones, but using techniques called meri and kari, in which the blowingThe string kari was found in the file text.txt at line 6 and column 52  ./find is text.txtwhich is called a "fipple"—and thus has limited pitch control, the shakuhachiThe string is was found in the file text.txt at line 2 and column 6angle is adjusted to bend the pitch downward and upward, respectively,The string is was found in the file text.txt at line 7 and column 6 ./find is text.txtwhich is called a "fipple"—and thus has limited pitch control, the shakuhachiThe string is was found in the file text.txt at line 2 and column 6angle is adjusted to bend the pitch downward and upward, respectively,The string is was found in the file text.txt at line 7 and column 6yjghitisduque@matrix:~/c++/GPUA1> ./find is text.txt text2.txtwhich is called a "fipple"—and thus has limited pitch control, the shakuhachiThe string is was found in the file text.txt at line 2 and column 6angle is adjusted to bend the pitch downward and upward, respectively,The string is was found in the file text.txt at line 7 and column 6which is called a "fipple"—and thusThe string is was found in the file text2.txt at line 3 and column 6angle is adjusted to bend the pitchThe string is was found in the file text2.txt at line 13 and column 6</pre> The increase intime spent searching is linear and depends on the size of the file or files. This can take much longer when it comes to extremely large files.
=== Assignment 2 ===
 
https://github.com/bbershadsky/GPU610-a2
Still writing code to parallelize the process
 
=== Assignment 3 ===

Navigation menu