| /petsc/src/vec/is/sf/tests/ |
| H A D | ex10.c | 9 PetscInt nroots, nleaves; in main() local 23 nleaves = 0; in main() 24 PetscCall(PetscMalloc1(nleaves, &ilocalA0)); in main() 25 PetscCall(PetscMalloc1(nleaves, &iremoteA0)); in main() 26 …PetscCall(PetscSFSetGraph(sfA0, nroots, nleaves, ilocalA0, PETSC_OWN_POINTER, iremoteA0, PETSC_OWN… in main() 32 nleaves = 1; in main() 33 PetscCall(PetscMalloc1(nleaves, &ilocalA1)); in main() 34 PetscCall(PetscMalloc1(nleaves, &iremoteA1)); in main() 38 …PetscCall(PetscSFSetGraph(sfA1, nroots, nleaves, ilocalA1, PETSC_OWN_POINTER, iremoteA1, PETSC_OWN… in main() 44 nleaves = 1; in main() [all …]
|
| H A D | ex25.c | 9 PetscInt i, nroots, nleaves; in main() local 27 nleaves = 0; in main() 30 nleaves = n; in main() 31 PetscCall(PetscMalloc1(nleaves, &iremote)); in main() 32 for (i = 0; i < nleaves; i++) { in main() 37 …PetscCall(PetscSFSetGraph(sf, nroots, nleaves, NULL, PETSC_OWN_POINTER, iremote, PETSC_OWN_POINTER… in main() 39 …PetscCall(PetscCalloc2(nroots * m, &rootdata, nleaves * m, &leafdata)); // allocate fat nodes to a… in main() 54 …if (rank == 1) PetscCheck(leafdata[nleaves * m - 1] == 123, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF: … in main()
|
| H A D | ex20.c | 10 PetscInt height = 2, width = 3, nroots = height, nleaves, dim = 2; in main() local 19 nleaves = (width - (rank == 0) - (rank == size - 1)) * height; in main() 20 PetscCall(PetscMalloc2(nroots * dim, &rootcoords, nleaves * dim, &leafcoords)); in main() 26 leafcoords[(i * nleaves / height + l) * dim + 0] = 0.1 * (rank + j - 1); in main() 27 leafcoords[(i * nleaves / height + l) * dim + 1] = 1. * i; in main() 35 PetscCall(PetscRealView(nleaves * dim, leafcoords, viewer)); in main() 38 …PetscCall(PetscSFSetGraphFromCoordinates(sf, nroots, nleaves, dim, 1e-10, rootcoords, leafcoords)); in main()
|
| H A D | ex17.c | 9 PetscInt i, nroots, nleaves; in main() local 32 nleaves = 0; in main() 35 nleaves = n; in main() 36 PetscCall(PetscMalloc1(nleaves, &iremote)); in main() 37 for (i = 0; i < nleaves; i++) { in main() 42 …PetscCall(PetscSFSetGraph(sf, nroots, nleaves, NULL, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES… in main() 43 PetscCall(PetscMalloc2(nroots, &rootdata, nleaves, &leafdata)); in main()
|
| H A D | ex3.c | 9 PetscInt i, N = 10, low, high, nleaves; in main() local 58 PetscCall(PetscSFGetGraph(gathersf, NULL, &nleaves, NULL, NULL)); in main() 59 PetscCall(VecCreateSeq(PETSC_COMM_SELF, nleaves, &y)); in main() 78 PetscCall(VecCreateMPIWithArray(PETSC_COMM_WORLD, 1, nleaves, PETSC_DECIDE, leafupdate, &gy2)); in main() 113 PetscCall(PetscSFGetGraph(allgathersf, NULL, &nleaves, NULL, NULL)); in main() 114 PetscCall(VecCreateSeq(PETSC_COMM_SELF, nleaves, &y)); in main() 138 PetscCall(VecCreateMPIWithArray(PETSC_COMM_WORLD, 1, nleaves, PETSC_DECIDE, leafupdate, &gy2)); in main() 177 PetscCall(PetscSFGetGraph(alltoallsf, NULL, &nleaves, NULL, NULL)); in main() 178 PetscCall(VecCreateSeq(PETSC_COMM_SELF, nleaves, &y)); in main() 196 PetscCall(VecCreateMPIWithArray(PETSC_COMM_WORLD, 1, nleaves, PETSC_DECIDE, leafupdate, &gy2)); in main()
|
| H A D | ex4k.kokkos.cxx | 37 PetscInt i, j, n, nroots, nleaves, niter = 100, nskip = 10; in main() local 90 nleaves = 0; in main() 93 nleaves = n; in main() 94 for (j = 0; j < nleaves; j++) { in main() 99 …PetscCall(PetscSFSetGraph(sf[i], nroots, nleaves, NULL, PETSC_COPY_VALUES, iremote, PETSC_COPY_VAL… in main()
|
| H A D | ex24.c | 72 PetscInt nroots, nleaves; in createSparseSF() local 79 nleaves = (rank & 2) ? 1 : 0; in createSparseSF() 82 if (nleaves == 1) remote.rank = (rank & 1) ? (rank ^ 2) : (rank ^ 1); in createSparseSF() 83 …PetscCall(PetscSFSetGraph(*sf, nroots, nleaves, NULL, PETSC_COPY_VALUES, &remote, PETSC_COPY_VALUE… in createSparseSF()
|
| H A D | ex1.c | 8 PetscInt nroots, nleaves; in CheckGraphNotSet() local 14 PetscCall(PetscSFGetGraph(sf, &nroots, &nleaves, &ilocal, &iremote)); in CheckGraphNotSet() 16 PetscCheck(nleaves < 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF graph is set"); in CheckGraphNotSet() 26 PetscInt nroots, nleaves; in CheckGraphEmpty() local 32 PetscCall(PetscSFGetGraph(sf, &nroots, &nleaves, &ilocal, &iremote)); in CheckGraphEmpty() 34 PetscCheck(!nleaves, PETSC_COMM_SELF, PETSC_ERR_PLIB, "SF graph is not empty"); in CheckGraphEmpty()
|
| /petsc/src/vec/is/sf/impls/basic/alltoall/ |
| H A D | sfalltoall.c | 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 [all …]
|
| /petsc/src/vec/is/sf/impls/basic/allgatherv/ |
| H A D | sfallgatherv.c | 4 …rCode PetscSFGetGraph_Allgatherv(PetscSF sf, PetscInt *nroots, PetscInt *nleaves, const PetscInt *… in PetscSFGetGraph_Allgatherv() argument 13 if (nleaves) *nleaves = sf->nleaves; in PetscSFGetGraph_Allgatherv() 16 …if (!sf->remote && sf->nleaves) { /* The && sf->nleaves makes sfgatherv able to inherit this routi… in PetscSFGetGraph_Allgatherv() 18 PetscCall(PetscMalloc1(sf->nleaves, &sf->remote)); in PetscSFGetGraph_Allgatherv() 44 if (sf->nleaves) { /* This if (sf->nleaves) test makes sfgatherv able to inherit this routine */ in PetscSFSetUp_Allgatherv() 105 PetscMPIInt sendcount, rank, nleaves; in PetscSFBcastBegin_Allgatherv() local 123 PetscCall(PetscMPIIntCast(sf->nleaves, &nleaves)); in PetscSFBcastBegin_Allgatherv() 124 …if (dat->bcast_pattern) PetscCallMPI(MPIU_Ibcast(leafbuf, nleaves, unit, dat->bcast_root, comm, re… in PetscSFBcastBegin_Allgatherv() 153 PetscInt nleaves = sf->nleaves; in PetscSFReduceBegin_Allgatherv() local 161 nleaves *= nreal; in PetscSFReduceBegin_Allgatherv() [all …]
|
| /petsc/src/vec/is/sf/tutorials/ |
| H A D | ex1f.F90 | 12 PetscInt i, nroots, nrootsalloc, nleaves, nleavesalloc, mine(6), stride 39 nleaves = 3 41 nleaves = 2 43 nleavesalloc = nleaves*stride 45 do i = 1, nleaves 64 …PetscCallA(PetscSFSetGraph(sf, nrootsalloc, nleaves, mine, PETSC_COPY_VALUES, remote, PETSC_COPY_V… 104 …PetscCheckA(gnleaves == nleaves, PETSC_COMM_WORLD, PETSC_ERR_PLIB, 'nleaves returned from PetscSFG… 105 do i = 1, nleaves 108 do i = 1, nleaves 123 …PetscCallA(PetscSFSetGraph(sf, nrootsalloc, nleaves, PETSC_NULL_INTEGER_ARRAY, PETSC_COPY_VALUES, …
|
| H A D | ex3.c | 14 PetscInt nroots, nleaves; in main() local 36 nleaves = 1; in main() 38 PetscCall(PetscMalloc1(nleaves, &ilocal)); in main() 40 for (i = 0; i < nleaves; i++) ilocal[i] = i; in main() 42 PetscCall(PetscMalloc1(nleaves, &iremote)); in main() 45 …PetscCall(PetscSFSetGraph(sf, nroots, nleaves, ilocal, PETSC_OWN_POINTER, iremote, PETSC_OWN_POINT… in main()
|
| H A D | ex2.c | 17 PetscInt nroots, nleaves; in main() local 32 nleaves = 2; in main() 34 PetscCall(PetscMalloc1(nleaves, &ilocal)); in main() 36 for (i = 0; i < nleaves; i++) ilocal[i] = i; in main() 38 PetscCall(PetscMalloc1(nleaves, &iremote)); in main() 50 …PetscCall(PetscSFSetGraph(sf, nroots, nleaves, ilocal, PETSC_OWN_POINTER, iremote, PETSC_OWN_POINT… in main()
|
| H A D | ex1.c | 21 PetscInt i, nroots, nleaves; in PetscSFViewCustomLocals_Private() local 26 PetscCall(PetscSFGetGraph(sf, &nroots, &nleaves, NULL, &iremote)); in PetscSFViewCustomLocals_Private() 30 …s=%" PetscInt_FMT ", leaves=%" PetscInt_FMT ", remote ranks=%d\n", rank, nroots, nleaves, nranks)); in PetscSFViewCustomLocals_Private() 31 …for (i = 0; i < nleaves; i++) PetscCall(PetscViewerASCIISynchronizedPrintf(viewer, "[%d] %" PetscI… in PetscSFViewCustomLocals_Private() 40 PetscInt i, bs = 2, nroots, nrootsalloc, nleaves, nleavesalloc, *mine, stride; in main() local 112 nleaves = size; in main() 115 PetscCall(PetscMalloc1(nleaves, &remote)); in main() 123 nleaves = 2 + (PetscInt)(rank > 0); in main() 124 nleavesalloc = nleaves * stride; in main() 129 PetscCall(PetscMalloc1(nleaves, &mine)); in main() [all …]
|
| /petsc/src/vec/is/sf/utils/ |
| H A D | sfutils.c | 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() [all …]
|
| H A D | sfcoord.c | 118 PetscErrorCode PetscSFSetGraphFromCoordinates(PetscSF sf, PetscInt nroots, PetscInt nleaves, PetscI… in PetscSFSetGraphFromCoordinates() argument 133 if (nleaves != 0) PetscAssertPointer(leafcoords, 7); in PetscSFSetGraphFromCoordinates() 140 PetscCall(GetBoundingBox_Internal(nleaves, dim, leafcoords, bbox)); in PetscSFSetGraphFromCoordinates() 184 PetscCall(PetscMalloc1(nleaves, &lremote)); in PetscSFSetGraphFromCoordinates() 190 PetscCall(PetscMalloc2(nleaves, &indices, nleaves, &distances)); in PetscSFSetGraphFromCoordinates() 191 …PetscCall(PetscKDTreeQueryPointsNearestNeighbor(tree, nleaves, leafcoords, tol, indices, distances… in PetscSFSetGraphFromCoordinates() 192 for (PetscInt i = 0; i < nleaves; i++) { in PetscSFSetGraphFromCoordinates() 210 …PetscCall(PetscSFSetGraph(sf, nroots, nleaves, NULL, PETSC_USE_POINTER, lremote, PETSC_OWN_POINTER… in PetscSFSetGraphFromCoordinates()
|
| /petsc/src/vec/is/tests/ |
| H A D | ex5.c | 127 PetscInt nroots = -1, nleaves = -1, *ilocal; in main() local 172 nleaves = 1; in main() 173 PetscCall(PetscMalloc1(nleaves, &ilocal)); in main() 174 PetscCall(PetscMalloc1(nleaves, &iremote)); in main() 181 nleaves = 1; in main() 182 PetscCall(PetscMalloc1(nleaves, &ilocal)); in main() 183 PetscCall(PetscMalloc1(nleaves, &iremote)); in main() 190 …PetscCall(PetscSFSetGraph(sf, nroots, nleaves, ilocal, PETSC_OWN_POINTER, iremote, PETSC_OWN_POINT… in main()
|
| /petsc/src/vec/is/sf/interface/ |
| H A D | sf.c | 65 b->nleaves = -1; in PetscSFCreate() 119 sf->nleaves = -1; in PetscSFReset() 253 PetscInt i, nleaves; in PetscSFCheckGraphValid_Private() local 260 PetscCall(PetscSFGetGraph(sf, NULL, &nleaves, &ilocal, &iremote)); in PetscSFCheckGraphValid_Private() 262 for (i = 0; i < nleaves; i++) { in PetscSFCheckGraphValid_Private() 456 PetscErrorCode PetscSFSetGraph(PetscSF sf, PetscInt nroots, PetscInt nleaves, PetscInt ilocal[], Pe… in PetscSFSetGraph() argument 462 if (nleaves > 0 && ilocal) PetscAssertPointer(ilocal, 4); in PetscSFSetGraph() 463 if (nleaves > 0) PetscAssertPointer(iremote, 6); in PetscSFSetGraph() 465 …PetscCheck(nleaves >= 0, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "nleaves %" PetscInt_FMT ", ca… in PetscSFSetGraph() 480 …for (PetscInt i = 0; i < nleaves; i++) PetscCheck(iremote[i].rank >= -1 && iremote[i].rank < size,… in PetscSFSetGraph() [all …]
|
| /petsc/src/mat/utils/ |
| H A D | overlapsplit.c | 17 PetscInt *indices_ov_rd, nroots, nleaves, *localoffsets, *indices_recv; in MatIncreaseOverlapSplit_Single() local 112 nleaves = localoffsets[size]; in MatIncreaseOverlapSplit_Single() 115 PetscCall(PetscMalloc1(nleaves, &remote)); in MatIncreaseOverlapSplit_Single() 116 for (PetscInt i = 0; i < nleaves; i++) { in MatIncreaseOverlapSplit_Single() 125 nleaves = 0; in MatIncreaseOverlapSplit_Single() 137 …PetscCall(PetscSFSetGraph(sf, nroots, nleaves, NULL, PETSC_OWN_POINTER, remote, PETSC_OWN_POINTER)… in MatIncreaseOverlapSplit_Single()
|
| /petsc/src/vec/vec/utils/ |
| H A D | vscat.c | 673 PetscInt i, n, N, nroots, nleaves, *ilocal, xstart, ystart, ixsize, iysize, xlen, ylen; in VecScatterCreate() local 894 PetscCall(ISGetLocalSize(iyy,&nleaves)); in VecScatterCreate() 895 PetscCall(PetscMalloc2(nleaves,&iremote,nleaves*2,&leafdata)); in VecScatterCreate() 897 for (i=0; i<nleaves; i++) { in VecScatterCreate() 904 … PetscCall(PetscSFSetGraph(tmpsf,nroots,nleaves,NULL,PETSC_USE_POINTER,iremote,PETSC_USE_POINTER)); in VecScatterCreate() 920 nleaves = inedges; in VecScatterCreate() 922 PetscCall(PetscMalloc1(nleaves,&ilocal)); in VecScatterCreate() 923 PetscCall(PetscMalloc1(nleaves,&iremote)); in VecScatterCreate() 1027 nleaves = rlentotal; in VecScatterCreate() 1028 PetscCall(PetscMalloc1(nleaves, &ilocal)); in VecScatterCreate() [all …]
|
| /petsc/src/binding/petsc4py/src/petsc4py/PETSc/ |
| H A D | SF.pyx | 178 cdef PetscInt nroots = 0, nleaves = 0 181 CHKERR(PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote)) 183 local = arange(0, nleaves, 1) 185 local = array_i(nleaves, ilocal) 186 remote = array_i(nleaves*2, <const PetscInt*>iremote) 187 remote = remote.reshape(nleaves, 2) 208 process. Should be ``2*nleaves`` long as (rank, index) pairs. 216 cdef PetscInt nleaves = 0 222 local = iarray_i(local, &nleaves, &ilocal) 223 assert 2*nleaves == nremote [all …]
|
| /petsc/src/vec/is/utils/ |
| H A D | isltog.c | 555 PetscInt i, maxlocal, nroots, nleaves, *globals, *ltog; in ISLocalToGlobalMappingCreateSF() local 562 PetscCall(PetscSFGetGraph(sf, &nroots, &nleaves, NULL, NULL)); in ISLocalToGlobalMappingCreateSF() 1231 PetscInt nroots, nleaves, newnleaves, bs, i, j, m, mnroots, p; in ISLocalToGlobalMappingSetUpBlockInfo_Private() local 1243 PetscCall(ISLocalToGlobalMappingGetSize(mapping, &nleaves)); in ISLocalToGlobalMappingSetUpBlockInfo_Private() 1244 nleaves /= bs; in ISLocalToGlobalMappingSetUpBlockInfo_Private() 1247 for (i = 0, m = 0; i < nleaves; i++) m = PetscMax(m, gidxs[i]); in ISLocalToGlobalMappingSetUpBlockInfo_Private() 1255 PetscCall(PetscSFSetGraphLayout(sf, layout, nleaves, NULL, PETSC_OWN_POINTER, gidxs)); in ISLocalToGlobalMappingSetUpBlockInfo_Private() 1264 …PetscCall(PetscMalloc3(2 * PetscMax(mnroots, nroots), &mrootdata, 2 * nleaves, &leafdata, nleaves,… in ISLocalToGlobalMappingSetUpBlockInfo_Private() 1274 for (i = 0, newnleaves = 0; i < nleaves; i++) { in ISLocalToGlobalMappingSetUpBlockInfo_Private() 1281 for (i = 0, m = 0; i < nleaves; i++) { in ISLocalToGlobalMappingSetUpBlockInfo_Private() [all …]
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexdistribute.c | 504 PetscInt pStart, pEnd, p, sStart, sEnd, nleaves, l; in DMPlexCreateOverlapLabel() local 523 PetscCall(PetscSFGetGraph(sfPoint, NULL, &nleaves, &local, &remote)); in DMPlexCreateOverlapLabel() 526 for (l = 0; l < nleaves; ++l) { in DMPlexCreateOverlapLabel() 587 for (l = 0; l < nleaves; ++l) { in DMPlexCreateOverlapLabel() 670 PetscInt pStart, pEnd, p, sStart, sEnd, nleaves, l, el; in DMPlexCreateOverlapLabelFromLabels() local 683 PetscCall(PetscSFGetGraph(sfPoint, NULL, &nleaves, &local, &remote)); in DMPlexCreateOverlapLabelFromLabels() 703 if (local) PetscCall(PetscFindInt(p, nleaves, local, &loc)); in DMPlexCreateOverlapLabelFromLabels() 704 else loc = (p >= 0 && p < nleaves) ? p : -1; in DMPlexCreateOverlapLabelFromLabels() 748 for (l = 0; l < nleaves; ++l) { in DMPlexCreateOverlapLabelFromLabels() 777 PetscInt d, dim, p, pStart, pEnd, nroots, nleaves, newLeaves, point, numSharedPoints; in DMPlexCreateOverlapMigrationSF() local [all …]
|
| H A D | plexcheckinterface.c | 74 PetscInt nleaves; in SortByRemote_Private() local 82 nleaves = roffset[nranks]; in SortByRemote_Private() 83 PetscCall(PetscMalloc2(nleaves, rmine1, nleaves, rremote1)); in SortByRemote_Private() 169 PetscInt nleaves, nroots; in DMPlexCheckInterfaceCones() local 198 PetscCall(PetscSFGetGraph(sf, &nroots, &nleaves, &mine, &remote)); in DMPlexCheckInterfaceCones()
|
| /petsc/src/vec/is/sf/interface/ftn-custom/ |
| H A D | zsf.c | 31 PETSC_EXTERN void petscsfgetgraph_(PetscSF *sf, PetscInt *nroots, PetscInt *nleaves, F90Array1d *ai… in petscsfgetgraph_() argument 37 *ierr = PetscSFGetGraph(*sf, nroots, nleaves, &ilocal, &iremote); in petscsfgetgraph_() 39 nl = *nleaves; in petscsfgetgraph_() 43 f90array1dcreatesfnode_(iremote, &one, nleaves, airemote PETSC_F90_2PTR_PARAM(piremote)); in petscsfgetgraph_() 46 PETSC_EXTERN void petscsfrestoregraph_(PetscSF *sf, PetscInt *nroots, PetscInt *nleaves, F90Array1d… in petscsfrestoregraph_() argument
|