<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><p style="font-size:12.8px"></p><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><p style="font-size:12.8px"></p><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>