x components - mcstasmedia.mcstas.org/dresden-gpu-hackathon-2018/mcstas... · gpu hack 2018 mads...
TRANSCRIPT
![Page 1: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/1.jpg)
GPU Hack 2018 Mads Bertelsen Slide:9/3-2018
McStas / McXtrace instrument simulation
1
X
• Ray tracing through components
Components
![Page 2: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/2.jpg)
GPU Hack 2018 Mads Bertelsen Slide:9/3-2018
McStas / McXtrace instrument simulation
2
X
• Ray tracing through components
• Port heavy part of component to GPU (Shows some potential)
Components
![Page 3: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/3.jpg)
GPU Hack 2018 Mads Bertelsen Slide:9/3-2018
McStas / McXtrace instrument simulation
3
X
• Ray tracing through components
• Port heavy part of component to GPU (Shows some potential)
Components
V1.0
V2.0
![Page 4: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/4.jpg)
GPU Hack 2018 Mads Bertelsen Slide:9/3-2018
McStas / McXtrace instrument simulation
4
X
• Ray tracing through components
• Port heavy part of component to GPU (Shows some potential)
Components
V2.0
![Page 5: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/5.jpg)
GPU Hack 2018 Mads Bertelsen Slide:9/3-2018
McStas / McXtrace instrument simulation
5
X
Components
• Ray tracing through components
• Port heavy part of component to GPU (Shows some potential)
• Port neutron loop to GPULots of codeCode generationCompiles! Speed up today
![Page 6: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/6.jpg)
GPU Hack 2018 Mads Bertelsen Slide:9/3-2018
McStas / McXtrace instrument simulation
6
16.12 s (Single core 56.0 s) 5.43 s
CPU MPI 4 cores (95 % usage) GPU 5% usage
![Page 7: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/7.jpg)
What problems you encountered
• Problems with legacy app structure. Complex, nested loops, static and extern variables, printf
• Issues with algorithm. Not-so-high modularity did not really encourage parallelization
• Tool bugs
• Tool lack of features
• System setup Code-Gen vs. .c instument
![Page 8: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/8.jpg)
Wishlist
• What do you wish existed to make your life easier?
• Tools
• Language standards
• Event More GPU Hackathons!
• Systems
![Page 9: X Components - McStasmedia.mcstas.org/Dresden-GPU-hackathon-2018/McStas... · GPU Hack 2018 Mads Bertelsen 9/3-2018 Slide: McStas/ McXtraceinstrument simulation 3 X • Ray tracing](https://reader033.vdocument.in/reader033/viewer/2022050309/5f71912f3fda744e2e4a2e19/html5/thumbnails/9.jpg)
Was it worth it?
• Was this worth it?• Me
openACC and GPU experience• Your team
openACC experience, some CUDA!• Your app
Parallelization compilation and runtime works for a simple (although full) instrument.• Your domain
The insight gained can be shared with the main McXtrace/McStas development• Your center• Your mentors
Simply amazing supportWill you continue development? Of course!