Important: If the pycuda clean-up routines kick in before pysixtracklib elements such as CudaController, CudaArgument, CudaTrackJob are destroyed, the device memory regions will be invalidated.
In order to avoid this, it is suggested to stick to this sequence:
first initialize pycuda
then create any pysixtracklib (i.e. CudaTrackJob, CudaArgument, etc. ) or pycuda elements that you need
then destroy/delete the pysixtracklib elements before
destroying the pycuda elements
This is the sequence implemented in the example file examples/python/pycuda_particle_addr.py
Failing to do things properly may result in all kind of problems resulting from accessing already freed memory but will, positively, result in hitting an assert statement in the C++ CudaController destructor if the library has been compiled in debug mode (i.e. with cmake .. -DCMAKE_BUILD_TYPE=Debug). Watch out for the message
Important: If the pycuda clean-up routines kick in before pysixtracklib elements such as CudaController, CudaArgument, CudaTrackJob are destroyed, the device memory regions will be invalidated.
In order to avoid this, it is suggested to stick to this sequence:
This is the sequence implemented in the example file examples/python/pycuda_particle_addr.py
Failing to do things properly may result in all kind of problems resulting from accessing already freed memory but will, positively, result in hitting an assert statement in the C++ CudaController destructor if the library has been compiled in debug mode (i.e. with cmake .. -DCMAKE_BUILD_TYPE=Debug). Watch out for the message