ianhinder / Kranc

A Mathematica package for generating code for solving time dependent partial differential equations
http://kranccode.org
GNU General Public License v2.0
28 stars 10 forks source link

Switch CaKernel code from template gpu_cuda/3dblock to gpu_cuda_dc/3dblock2. #114

Open dmkoppelman opened 9 years ago

dmkoppelman commented 9 years ago

In this issue have Kranc generate non-boundary CaKernel code using template gpu_cuda_dc/3dblock2 (it currently uses gpu_cuda/3dblock) and make associated changes. This template is the template that is actively being developed it performs dynamic compilation by default (which increases startup time) but that can be turned off using the parameter:

CaCUDALib::dynamic_compilation = no

This issue will also fix two problems that have occurred in SimpleWave. The CaKernel.ccl file can have a wrong value for STENCIL and EXTERIOR. The STENCIL can be wrong because CalculationStencilSize is used on calculations which are not in the right form (the differencing operators have not been sufficiently expanded). The EXTERIOR is set based on the Where value, which is a Kranc input. A possible value is Automatic, which the code does not try to resolve. Both of those problems will be fixed by using the values for Where and stencil size that are computed in CreateCalculationFunction. The reference functionality added in Issue 113 will be used to move those values up to KrancThorn.m without extensive refactoring.

So far, these changes fix problems with SimpleWave. That is, it appears to generate correct results. I've ran Kranc on ML_BSSN, but I haven't tried building it on Cactus.