ForestClaw / forestclaw

Quadtree/octree adaptive PDE solver based based on p4est.
http://www.forestclaw.org
BSD 2-Clause "Simplified" License
58 stars 22 forks source link

CudaClaw : Convert fc2d_cudaclaw5_wrap.f to C #131

Closed donnaaboise closed 6 years ago

donnaaboise commented 6 years ago

This should be fairly straightforward, and will allow us to call the step2 as a CUDA C kernel.

See : fc2d_cudaclaw5_step2_wrap.f

Currently, the code has allocation for a large work array (which is commented out). But I think we may want to use this array and allocate it on the GPU. In this case, we may also want to keep the indices into this array.

donnaaboise commented 6 years ago

I written a preliminary version of this code, which compiles and runs. However, the results are rather suspect (read : blowing up). I've wrote a fortran version of update_q, just to be sure the problem is not with the CUDA code. Doesn't help. Probably a simple issue that can be cleaned up by looking carefully at the argument lists.

donnaaboise commented 6 years ago

I changed to using a fixed time step (see cuda.ini) and it looks like the fortran version of the code is at least working and compares identically with the non-CUDA version.

donnaaboise commented 6 years ago

We now have a good start of a wrap function in C. Should work for now.