cuda-memchck work arounds and made the code more robust when n-particles is very low