Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| formation:astrosim2017gpu4dummies [2017/07/07 11:04] – [Test examples] equemene | formation:astrosim2017gpu4dummies [2017/07/10 16:52] (Version actuelle) – [NBody, a simplistic simulator] equemene | ||
|---|---|---|---|
| Ligne 330: | Ligne 330: | ||
| </ | </ | ||
| + | === Exercice #6 : launch '' | ||
| + | |||
| + | * Which on the CPU implementations is the powerful | ||
| + | * Increase the size of matrix to '' | ||
| + | * Move from simple precision to double precision (SP to DP) and examine the elapsed time on CPU | ||
| + | * Move from simple precision to double precision (SP to DP) and examine the elapsed time on GPU | ||
| ===== Exploration with dummie codes ===== | ===== Exploration with dummie codes ===== | ||
| - | |||
| - | ==== A GPU, a performant matrix multiplier ==== | ||
| ==== Pi Monte Carlo, a Compute Bound Example ==== | ==== Pi Monte Carlo, a Compute Bound Example ==== | ||
| + | The '' | ||
| + | |||
| + | It's available on: | ||
| + | * on file: ''/ | ||
| + | * on website: [[http:// | ||
| + | |||
| + | Copy the '' | ||
| + | mkdir / | ||
| + | cd / | ||
| + | cp / | ||
| + | </ | ||
| + | |||
| + | The documentation is available by the call of ''/ | ||
| + | PiXPU.py -o (Out of Core Metrology) -c (Print Curves) -d < | ||
| + | |||
| + | Informations about devices detected under OpenCL API: | ||
| + | Device #0 from The pocl project of type *PU : pthread-Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz | ||
| + | Device #1 from NVIDIA Corporation of type *PU : GeForce GTX TITAN | ||
| + | Device #2 from Intel(R) Corporation of type *PU : Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz | ||
| + | Device #3 from Advanced Micro Devices, Inc. of type *PU : Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz | ||
| + | |||
| + | Informations about devices detected under CUDA API: | ||
| + | Device #0 of type GPU : GeForce GTX TITAN | ||
| + | </ | ||
| + | |||
| + | The '' | ||
| + | Devices Identification : [0] | ||
| + | GpuStyle used : OpenCL | ||
| + | Iterations : 1000000 | ||
| + | Number of Blocks on begin : 1 | ||
| + | Number of Blocks on end : 1 | ||
| + | Step on Blocks : 1 | ||
| + | Number of Threads on begin : 1 | ||
| + | Number of Threads on end : 1 | ||
| + | Step on Threads : 1 | ||
| + | Number of redo : 1 | ||
| + | Metrology done out of XPU : False | ||
| + | Type of Marsaglia RNG used : MWC | ||
| + | Type of variable : FP32 | ||
| + | Device #0 from The pocl project of type xPU : pthread-Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz | ||
| + | Device #1 from NVIDIA Corporation of type xPU : GeForce GTX 1080 Ti | ||
| + | Device #2 from Intel(R) Corporation of type xPU : Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz | ||
| + | Device #3 from Advanced Micro Devices, Inc. of type xPU : Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz | ||
| + | (' | ||
| + | Pi estimation 3.14192800 | ||
| + | 0.03 0.03 0.00 0.03 0.03 37357749 37357749 0 37357749 37357749 | ||
| + | </ | ||
| + | |||
| + | Two file are created by default: | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | === Exercice #7 : explore '' | ||
| + | |||
| + | * Without any parameters (the default ones) : | ||
| + | * what is the selected device ? How many itops (iterative operations per second) do you reach ? | ||
| + | * With only the device parameter as '' | ||
| + | * What are the different ratios between the devices ? Which one is the most powerful ? | ||
| + | * With the selector of device and increasing the number of iterations and the number of redo : | ||
| + | * What arrive to itops values ? What is the typical variability on results ? | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | === Exercice #8 : explore '' | ||
| + | |||
| + | * With a PR from '' | ||
| + | * How decrease the elapsed time of | ||
| + | * With the selector of device and increasing the number of iterations and the number of redo : | ||
| + | * What arrive to itops values ? What is the typical variability on results ? | ||
| + | |||
| + | < | ||
| + | |||
| + | In this case, we define a gnuplot config file as follow. Adapt to your files and configuration. | ||
| + | < | ||
| + | set xlabel ' | ||
| + | set ylabel ' | ||
| + | plot ' | ||
| + | </ | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | === Exercice #9 : explore '' | ||
| + | |||
| + | * Explore with '' | ||
| + | * For which '' | ||
| + | |||
| + | To explore on this platform the GPU device (device #1) from 2048 to 32768 as parallel rates with a step of 128 and 1000000000 iterations: < | ||
| + | ./PiXPU.py -d 1 -b 2048 -e $((2048*16)) -s 128 -i 10000000000 -r 10 | ||
| + | </ | ||
| + | |||
| + | Output files are: | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | In this case, you can define a gnuplot config file | ||
| + | < | ||
| + | set xlabel ' | ||
| + | set ylabel ' | ||
| + | plot ' | ||
| + | </ | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | === Exercice #10 : explore '' | ||
| + | |||
| + | < | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | In this case, you can define a gnuplot config file | ||
| + | < | ||
| + | set xlabel ' | ||
| + | set ylabel ' | ||
| + | plot ' | ||
| + | </ | ||
| + | |||
| + | {{ : | ||
| ==== NBody, a simplistic simulator ==== | ==== NBody, a simplistic simulator ==== | ||
| + | The '' | ||
| + | |||
| + | It's available on: | ||
| + | * on file: ''/ | ||
| + | * on website: [[http:// | ||
| + | |||
| + | Launch the code with a '' | ||
| + | < | ||
| + | python NBody.py -n 2 -g -i 1000 | ||
| + | </ | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | === Exercice #10 : explore '' | ||
| + | |||
| + | === Exercice #11 : explore '' | ||
| + | |||
| + | === Exercice #12 : explore '' | ||
| ===== Exploration with production codes ===== | ===== Exploration with production codes ===== | ||
| ==== PKDGRAV3 ==== | ==== PKDGRAV3 ==== | ||
| + | |||