Lines Matching refs:nleaves
43 static PetscErrorCode PetscSFGetGraph_Alltoall(PetscSF sf, PetscInt *nroots, PetscInt *nleaves, con… in PetscSFGetGraph_Alltoall() argument
49 if (nleaves) *nleaves = sf->nleaves; in PetscSFGetGraph_Alltoall()
53 PetscCall(PetscMalloc1(sf->nleaves, &sf->remote)); in PetscSFGetGraph_Alltoall()
55 for (i = 0; i < sf->nleaves; i++) { in PetscSFGetGraph_Alltoall()
67 PetscInt nroots = 1, nleaves = 1, *ilocal; in PetscSFCreateLocalSF_Alltoall() local
74 nleaves = 1; in PetscSFCreateLocalSF_Alltoall()
76 PetscCall(PetscMalloc1(nleaves, &ilocal)); in PetscSFCreateLocalSF_Alltoall()
77 PetscCall(PetscMalloc1(nleaves, &iremote)); in PetscSFCreateLocalSF_Alltoall()
83 …PetscCall(PetscSFSetGraph(lsf, nroots, nleaves, NULL /*contiguous leaves*/, PETSC_OWN_POINTER, ire… in PetscSFCreateLocalSF_Alltoall()
93 PetscMPIInt nroots, *roots, nleaves, *leaves, rank, ndiranks, ndranks; in PetscSFCreateEmbeddedRootSF_Alltoall() local
113 …omm, 0 /*empty msg*/, MPI_INT /*fake*/, nroots, roots, NULL /*todata*/, &nleaves, &leaves, NULL /*… in PetscSFCreateEmbeddedRootSF_Alltoall()
117 for (i = 0; i < nleaves; i++) { in PetscSFCreateEmbeddedRootSF_Alltoall()
124 PetscCall(PetscSortMPIInt(nleaves, leaves)); in PetscSFCreateEmbeddedRootSF_Alltoall()
125 if (nleaves && leaves[0] < 0) leaves[0] = rank; in PetscSFCreateEmbeddedRootSF_Alltoall()
128 PetscCall(PetscMalloc1(nleaves, &ilocal)); in PetscSFCreateEmbeddedRootSF_Alltoall()
129 PetscCall(PetscMalloc1(nleaves, &iremote)); in PetscSFCreateEmbeddedRootSF_Alltoall()
130 for (i = 0; i < nleaves; i++) { /* 1:1 map from roots to leaves */ in PetscSFCreateEmbeddedRootSF_Alltoall()
137 …PetscCall(PetscSFSetGraph(esf, sf->nleaves, nleaves, ilocal, PETSC_OWN_POINTER, iremote, PETSC_OWN… in PetscSFCreateEmbeddedRootSF_Alltoall()
140 …PetscCall(PetscMalloc4(nleaves, &esf->ranks, nleaves + 1, &esf->roffset, nleaves, &esf->rmine, nle… in PetscSFCreateEmbeddedRootSF_Alltoall()
141 esf->nranks = nleaves; in PetscSFCreateEmbeddedRootSF_Alltoall()
144 for (i = 0; i < nleaves; i++) { in PetscSFCreateEmbeddedRootSF_Alltoall()