x components - mcstasmedia.mcstas.org/dresden-gpu-hackathon-2018/mcstas... · gpu hack 2018 mads...

9
GPU Hack 2018 Mads Bertelsen Slide: 9/3-2018 McStas / McXtrace instrument simulation 1 X Ray tracing through components Components

Upload: others

Post on 25-Jul-2020

5 views

Category:

Documents


0 download

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

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

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

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

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

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

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

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

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

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!