The problem is that in some cases the CudaStream object is destroyed before the CudaAlignerBatch object. Keeping a reference to the stream object should resolve this issue since python does reference counting, but through tracking reference counts it appears that the reference is getting lost somewhere. The issue is resolve by explicitly increasing and decreasing the ref count for stream within the cudaaligner and cudapoa batch objects.
The problem is that in some cases the
CudaStream
object is destroyed before theCudaAlignerBatch
object. Keeping a reference to the stream object should resolve this issue since python does reference counting, but through tracking reference counts it appears that the reference is getting lost somewhere. The issue is resolve by explicitly increasing and decreasing the ref count for stream within the cudaaligner and cudapoa batch objects.It's a more permanent fix, but still not sure why the python ref counting mechanism appears to be broken. Tracking this in https://github.com/clara-parabricks/GenomeWorks/issues/476