Hopefully someone can help me with this. I am trying to allocated and deallocate arrays in my code. In some cases it works fine, but not always. Here is a excerpt:
Call timing_start(time_bucket_start) Call Bounds(x_d,Bound_d,nTotal,nCell_d,hsml_d) Call BuildCellIndex<<<grid,tBlock>>>(x_d,hsml_d,nTotal,CellIndex_d,Bound_d,nCell_d) maxIndex = nCell_d(1)*nCell_d(2)*nCell_d(3) Allocate(CellList_d(maxIndex,NumCLRows),NodesInCell_d(maxIndex)) NodesInCell_d = 0 Call BuildCellList<<<grid,tBlock>>>(nTotal,CellIndex_d,CellList_d,maxIndex,NodesInCell_d) Call GPUtimeStart(startEvent1) Call BucketSearch<<<grid,tBlock>>>& (x_d,hsml_d,CellList_d,nCell_d,CellIndex_d,NodesInCell_d,Neib_d,NeibCount_d,w_d,dwdx_d,nTotal,maxIndex) Call GPUtime(startEvent1,stopEvent1,t_bucket) If (Allocated(NodesInCell_d)) Deallocate(NodesInCell_d) If (Allocated(CellList_d)) Deallocate(CellList_d) Call timing_end(time_bucket_start,time_bucket)
The general idea is to lay a cell grid out and bin particles into the cells. I want to be able to accommodate growing and shrinking domains by dynamically allocating and deallocating.
I have been successfully running the code for a few simple test problems. But I just found a case that caused the program to exit with an error message:
0: Deallocate: Unspecified launch failure
I am using PVF 13.10.
Thanks for any help,