<html aria-label="message body"><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div>   I am sorry to hear you are having difficulties. Please send a full reproducer so we can track down the problem using the latest PETSc release. Software changes very rapidly for GPUs so we cannot support or debug PETSc 3.21.1, which is a couple of years old. But if the problem persists in 3.24, we will definitely track it down if you provide a reproducer.<div><br><div><br></div><div>  Barry<br><div><br><blockquote type="cite"><div>On Dec 7, 2025, at 11:03 PM, Wenbo Zhao <zhaowenbo.npic@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="auto"><p style="font-size:12.8px">Hi,</p><p style="font-size:12.8px">we are using petsc's veccuda and found that the data in the host array obtained via VecGetArrayRead is partially updated sometime. </p><p style="font-size:12.8px"><br></p><div style="font-size: 12.8px;"><br class="webkit-block-placeholder"></div><p style="font-size:12.8px">Vec vgpu, vcpu;</p><p style="font-size:12.8px">iterations:</p><p style="font-size:12.8px">     // ksp solve a * vgpu=b</p><p style="font-size:12.8px">     const PetscScalar * agpu;</p><p style="font-size:12.8px">      PetscScalar * acpu;</p><p style="font-size:12.8px">      VecGetArrayRead(vgpu, &agpu);</p><p style="font-size:12.8px">      VecGetArray(vcpu, &acpu);</p><div style="font-size: 12.8px;"><br class="webkit-block-placeholder"></div><p style="font-size:12.8px">      PetscArraycpy (acpu, agpu,size);</p><p style="font-size:12.8px">      // check updating</p><p style="font-size:12.8px">      std::cout << agpu[0] << agpu [size-1]<<std::endl;</p><p style="font-size:12.8px">      //  we found that agpu[0] is last iterations value, agpu[size-1] updated from device value, randomly</p><p style="font-size:12.8px">      // use acpu values to  update matrix a ....</p><p style="font-size:12.8px"><br></p><p style="font-size:12.8px"><br></p><p style="font-size:12.8px"><br></p><p style="font-size:12.8px">Petsc 3.21.1 is used. And manual said,</p><p style="font-size:12.8px">For vectors that may also have array data in GPU memory, for example, VECCUDA, this call ensures the CPU array has the most recent array values by copying the data from the GPU memory if needed.</p><p style="font-size:12.8px"><br></p><p style="font-size:12.8px"><br></p><p style="font-size:12.8px">Best wishes,</p><p style="font-size:12.8px">Wenbo</p><p style="font-size:12.8px"><br></p></div>
</div></blockquote></div><br></div></div></body></html>