I'm passing a memory pointer created by Python (numpy array) to a asynchronous stream write ( stream.write(python_ptr, "async") ) and it is causing segfault, while the same write in synchronous mode is not causing a seg fault. Therefore, I assume there are restrictions on destination memory pointers for asynchronous writes. Anybody know what they are?
Thanks for you reply. On digging deeper, I uncovered a curiousity:
(I'm working in Python, so forgive the pseudo code)
s1 = Stream(dimensions)
s2 = Stream(dimensions)
The second call to s2.write in async mode reveals the dimensions of s2 are rank=0. If I call s1.finish() before the s2.write call, everything is fine.
The cause of my previous segfault was that I was not checking matching dimensions. Perhaps I was reading the dimensions array which should have no elements if rank=0.
But still, there is something problematic here.
The same happens for:
again, the dimensions of s2. are revealed to be rank=0. If I call s1.finish() before the s2.read call, everything is fine.
This contradicts the documentation in 2.13.2 in the Stream User's guide, where an example is given of the same flavor as what I am doing above. From what I observe, that example should not work.
Originally posted by: gaurav.garg Using rank=0 is definitely invalid. You can not have a stream that has no size.
Indeed. So my question is: Is it intended behaviour that an asynchronous stream write causes other streams to have rank=0 until it finishes? That is the behaviour I am observing.
I observed the same behavior: seg fault with 2 succesive asynchronous stream.write; or a kernel call directly following an async stream.write (obviously on independent streams)
To me the stream.write(x, "async") only allows concurrent work on the cpu side, not on the gpu.