Lines Matching refs:nleaves
30 PetscErrorCode PetscSFSetGraphLayout(PetscSF sf, PetscLayout layout, PetscInt nleaves, PetscInt ilo… in PetscSFSetGraphLayout() argument
40 if (nleaves > 0 && ilocal) PetscAssertPointer(ilocal, 4); in PetscSFSetGraphLayout()
41 if (nleaves > 0) PetscAssertPointer(gremote, 6); in PetscSFSetGraphLayout()
45 PetscCall(PetscMalloc1(nleaves, &remote)); in PetscSFSetGraphLayout()
46 if (nleaves) ls = gremote[0] + 1; in PetscSFSetGraphLayout()
47 for (i = 0; i < nleaves; i++) { in PetscSFSetGraphLayout()
59 PetscCall(PetscSFSetGraph(sf, nroots, nleaves, ilocal, localmode, remote, PETSC_OWN_POINTER)); in PetscSFSetGraphLayout()
86 PetscErrorCode PetscSFGetGraphLayout(PetscSF sf, PetscLayout *layout, PetscInt *nleaves, const Pets… in PetscSFGetGraphLayout() argument
95 if (nleaves) PetscAssertPointer(nleaves, 3); in PetscSFGetGraphLayout()
110 if (nleaves) *nleaves = nl; in PetscSFGetGraphLayout()
135 PetscInt pStart, pEnd, p, nroots, nleaves = 0, l; in PetscSFSetGraphSection() local
159 nleaves += gdof < 0 ? -(gdof + 1) - gcdof : gdof - gcdof; in PetscSFSetGraphSection()
161 PetscCall(PetscMalloc1(nleaves, &local)); in PetscSFSetGraphSection()
162 PetscCall(PetscMalloc1(nleaves, &remote)); in PetscSFSetGraphSection()
207 …PetscCheck(l == nleaves, comm, PETSC_ERR_PLIB, "Iteration error, l %" PetscInt_FMT " != nleaves %"… in PetscSFSetGraphSection()
209 …PetscCall(PetscSFSetGraph(sf, nroots, nleaves, local, PETSC_OWN_POINTER, remote, PETSC_OWN_POINTER… in PetscSFSetGraphSection()
531 PetscInt i, nroots, nleaves = 0; in PetscSFCreateFromLayouts() local
554 remote[nleaves].rank = owner; in PetscSFCreateFromLayouts()
555 remote[nleaves].index = i - rmap->range[owner]; in PetscSFCreateFromLayouts()
556 nleaves++; in PetscSFCreateFromLayouts()
558 …PetscCall(PetscSFSetGraph(*sf, nroots, nleaves, NULL, PETSC_OWN_POINTER, remote, PETSC_COPY_VALUES… in PetscSFCreateFromLayouts()
572 PetscInt r, len = 0, nleaves = 0; in PetscLayoutMapLocal() local
590 ridxs[nleaves].rank = p; in PetscLayoutMapLocal()
591 ridxs[nleaves].index = idxs[r] - owners[p]; in PetscLayoutMapLocal()
592 ilocal[nleaves] = r; in PetscLayoutMapLocal()
593 nleaves++; in PetscLayoutMapLocal()
596 PetscCall(PetscSFSetGraph(sf, n, nleaves, ilocal, PETSC_OWN_POINTER, ridxs, PETSC_OWN_POINTER)); in PetscLayoutMapLocal()
734 PetscInt *ilocal, nleaves, N, n, i; in PetscSFCreateByMatchingIndices() local
801 for (i = 0, nleaves = 0; i < numLeafIndices; ++i) in PetscSFCreateByMatchingIndices()
802 if (owners[i].rank != rank) ++nleaves; in PetscSFCreateByMatchingIndices()
803 PetscCall(PetscMalloc1(nleaves, &ilocal)); in PetscSFCreateByMatchingIndices()
804 PetscCall(PetscMalloc1(nleaves, &iremote)); in PetscSFCreateByMatchingIndices()
805 for (i = 0, nleaves = 0; i < numLeafIndices; ++i) { in PetscSFCreateByMatchingIndices()
807 ilocal[nleaves] = leafLocalOffset + i; in PetscSFCreateByMatchingIndices()
808 iremote[nleaves].rank = owners[i].rank; in PetscSFCreateByMatchingIndices()
809 iremote[nleaves].index = owners[i].index; in PetscSFCreateByMatchingIndices()
810 ++nleaves; in PetscSFCreateByMatchingIndices()
815 nleaves = numLeafIndices; in PetscSFCreateByMatchingIndices()
816 PetscCall(PetscMalloc1(nleaves, &ilocal)); in PetscSFCreateByMatchingIndices()
817 …for (i = 0; i < nleaves; ++i) ilocal[i] = leafLocalOffset + (leafLocalIndices ? leafLocalIndices[i… in PetscSFCreateByMatchingIndices()
822 …PetscCall(PetscSFSetGraph(*sf, rootLocalOffset + numRootIndices, nleaves, ilocal, PETSC_OWN_POINTE… in PetscSFCreateByMatchingIndices()
876 PetscInt nleaves = 0; in PetscSFMerge() local
879 clocal[nleaves] = clocal[i]; in PetscSFMerge()
880 cremote[nleaves] = cremote[i]; in PetscSFMerge()
881 nleaves++; in PetscSFMerge()
884 …PetscCall(PetscSFSetGraph(*merged, aroots, nleaves, clocal, PETSC_COPY_VALUES, cremote, PETSC_COPY… in PetscSFMerge()