anuga-community / anuga_core

ANUGA for the simulation of the shallow water equation
https://anuga.anu.edu.au
Other
34 stars 23 forks source link

ANUGA GPU support #35

Open samcom12 opened 1 year ago

samcom12 commented 1 year ago

Hi All,

With recent developments like OpenMP offload support or openacc pragma, Can we port ANUGA to use GPU and accelerate simulations?

Cheers, Samir

stoiver commented 1 year ago

@samcom12 good idea. I have been thinking about this as well. The first step I think is to convert the inner timestepping procedures to cython C and then invoking openmp in the various expensive procedures. Hopefully we could then move over to offloading to the GPU.

samcom12 commented 1 year ago

Thanks @stoiver . I just tried profiling for offloading benefits with sample rectangulartestcase. The results are promising showing almost 4X speedup which can further increase with real datasets we are using.

You can refer the attached report. offload_model.tar.gz

stoiver commented 1 year ago

@samcom12, the results look promising. It is good that the offload advisor just picks up 2 procedures, _compute_fluxes_central and _extrapolate_second_order_edge_sw to look at. I think it also suggests that we should look at just using standard openmp on those two procedures. Does intel have an advisor for studying likely improvement using openmp?

samcom12 commented 1 year ago

Hello @stoiver

There is a tool which converts serial C,C++, and Fortran code to OpenMP based code.

http://rosecompiler.org/

And, with Intel VTune we can do threading analysis to see how effectively threads are being used in the code.

https://www.intel.com/content/www/us/en/develop/documentation/vtune-help/top/analyze-performance/parallelism-analysis-group/threading-analysis.html