guillaumetousignant / NDG_cuda

MIT License
1 stars 0 forks source link

Large number of elements don't work. #4

Closed guillaumetousignant closed 3 years ago

guillaumetousignant commented 3 years ago

N = 64 works fine, N = 128 is basically impossible to make work at any CFL, making weird curves appear.

guillaumetousignant commented 3 years ago

Possibly related to #1

guillaumetousignant commented 3 years ago

Is not caused by interpolation, tested by outputting phi directly.

guillaumetousignant commented 3 years ago

This doesn't work with the wave equation and Burger's.

guillaumetousignant commented 3 years ago

Works fine with the CPU implementation.

guillaumetousignant commented 3 years ago

Removing rk3 and timestepping directly seems to fix it. I suspect it has something to do with the element intermediate_ array. Maybe I should zero it out, as it is now as soon as there is a nan it will break for subsequent iterations.

guillaumetousignant commented 3 years ago

Storing stuff in intermediate_ doesn't work...?

guillaumetousignant commented 3 years ago

This is caused by calling new in the element constructor. I think the memory overlaps at some points. Allocating all the memory using the cpu with cudamalloc and then passing the pointers as arguments works. The total runtime then becomes about 4 times slower, and I think it will make adaptivity harder.

guillaumetousignant commented 3 years ago

It was a move issue, pointers suck, I didn't follow the rule of five (my bad), I should find out how to use vectors on the gpu.