static const char help[] = "Test embedded sf with one leaf data item connnected to multiple roots\n\n"; #include int main(int argc,char **argv) { PetscSF sf,newsf; PetscInt i,nroots,nleaves,ilocal[2],leafdata,rootdata[2],nselected,selected,errors=0; PetscSFNode iremote[2]; PetscMPIInt myrank,next,nproc; PetscErrorCode ierr; MPI_Info info; ierr = PetscInitialize(&argc,&argv,NULL,help);if (ierr) return ierr; ierr = MPI_Comm_size(PETSC_COMM_WORLD,&nproc);CHKERRQ(ierr); ierr = MPI_Comm_rank(PETSC_COMM_WORLD,&myrank);CHKERRQ(ierr); /* Create an SF that each process has two roots and two leaves. The two leaves are connected to the two roots on next process. The special thing is each process only has one data item in its leaf data buffer. */ nroots = 2; nleaves = 2; ilocal[0] = 0; /* One leaf data item serves two leaves */ ilocal[1] = 0; next = (myrank+1)%nproc; for (i=0; i