[petsc-users] VecScatter() causing processes hanging

Mark Adams mfadams at lbl.gov
Sun Dec 8 08:41:33 CST 2024


You want to look at example codes and docs (
https://urldefense.us/v3/__https://petsc.org/release/manualpages/PetscSF/VecScatterCreate/__;!!G_uCfscf7eWS!ZfPM2-JGiNd8Yo2xIkHZlQtcjvcJFjXXbMbQPIZ3C5d-RVC-yfvFjoiEm5yaWLcKxfLTPhKkdLX9BM2atRAJ6eg$ ) but I am
guessing global_vec and local_vec do not have the same communicator.

Mark

On Sat, Dec 7, 2024 at 9:50 PM Qiyue Lu <qiyuelu1 at gmail.com> wrote:

> Hello,
> I am trying to fetch 12 entries from a distributed vector global_vec and
> put them into a local vector on each process.
>
> IS is_source, is_dest;
> ISCreateGeneral(PETSC_COMM_SELF, 12, idx_global, PETSC_COPY_VALUES, &
> is_source);
> ISCreateGeneral(PETSC_COMM_SELF, 12, idx_local, PETSC_COPY_VALUES, &
> is_dest);
> Vec local_vec;
> VecCreate(PETSC_COMM_SELF, &local_vec);
> VecSetSizes(local_vec, PETSC_DECIDE, 12);
> VecSetType(local_vec, VECSEQ);
> VecScatter scat;
> VecScatterCreate(global_vec, is_source, local_vec, is_dest, &scat);
>
>
> I create the local vector as sequential. However, the last two lines which
> create a scatter object, will cause more than half processes to hang and no
> error pops out.
>
> Does the scatter have to be VECMPI to VECMPI and cannot VECMPI to VECSEQ?
>
> Thanks,
> Qiyue Lu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20241208/e5b0b612/attachment.html>


More information about the petsc-users mailing list