| /petsc/src/dm/partitioner/impls/simple/ |
| H A D | partsimple.c | 44 static PetscErrorCode PetscPartitionerPartition_Simple_Grid(PetscPartitioner part, PetscInt nparts,… in PetscPartitionerPartition_Simple_Grid() argument 61 …PetscCheck(nparts == Np, comm, PETSC_ERR_ARG_INCOMP, "Number of partitions %" PetscInt_FMT " != %"… in PetscPartitionerPartition_Simple_Grid() 62 …PetscCheck(nparts == size, comm, PETSC_ERR_ARG_INCOMP, "Number of partitions %" PetscInt_FMT " != … in PetscPartitionerPartition_Simple_Grid() 63 …nparts == 0, comm, PETSC_ERR_ARG_INCOMP, "Number of cells %" PetscInt_FMT " is not divisible by nu… in PetscPartitionerPartition_Simple_Grid() 65 Nr = numVertices / nparts; in PetscPartitionerPartition_Simple_Grid() 78 …for (np = 0; np < nparts; ++np) PetscCall(PetscSectionSetDof(partSection, np, numVertices / nparts… in PetscPartitionerPartition_Simple_Grid() 80 PetscCall(PetscCalloc1(nparts, &offsets)); in PetscPartitionerPartition_Simple_Grid() 81 for (np = 0; np < nparts; ++np) PetscCall(PetscSectionGetOffset(partSection, np, &offsets[np])); in PetscPartitionerPartition_Simple_Grid() 111 …nparts; ++np) PetscCheck(offsets[np] - offsets[np - 1] == numVertices / nparts, PETSC_COMM_SELF, P… in PetscPartitionerPartition_Simple_Grid() 117 static PetscErrorCode PetscPartitionerPartition_Simple(PetscPartitioner part, PetscInt nparts, Pets… in PetscPartitionerPartition_Simple() argument [all …]
|
| /petsc/src/dm/partitioner/tests/ |
| H A D | ex33.c | 11 PetscInt nparts, i; in main() local 23 nparts = size; in main() 24 PetscCall(PetscOptionsGetInt(NULL, NULL, "-nparts", &nparts, NULL)); in main() 45 PetscCall(PetscSectionSetChart(targetSection, 0, nparts)); in main() 46 for (i = 0; i < nparts; i++) PetscCall(PetscSectionSetDof(targetSection, i, 1)); in main() 73 …PetscCall(PetscPartitionerPartition(p, nparts, 0, NULL, NULL, vertexSection, NULL, targetSection, … in main() 87 …PetscCall(PetscPartitionerPartition(p, nparts, nv, vv, vadj, vertexSection, NULL, targetSection, p… in main() 89 …PetscCall(PetscPartitionerPartition(p, nparts, 0, NULL, NULL, vertexSection, NULL, targetSection, … in main() 104 …PetscCall(PetscPartitionerPartition(p, nparts, 0, NULL, NULL, NULL, NULL, targetSection, partSecti… in main() 113 …PetscCall(PetscPartitionerPartition(p, nparts, nv, vv, pvadj, NULL, NULL, targetSection, partSecti… in main()
|
| /petsc/src/dm/partitioner/impls/parmetis/ |
| H A D | partparmetis.c | 78 static PetscErrorCode PetscPartitionerPartition_ParMetis(PetscPartitioner part, PetscInt nparts, Pe… in PetscPartitionerPartition_ParMetis() argument 105 …PetscCall(PetscMalloc4(size + 1, &vtxdist, nparts * ncon, &tpwgts, ncon, &ubvec, nvtxs, &assignmen… in PetscPartitionerPartition_ParMetis() 123 for (p = 0; p < nparts; ++p) { in PetscPartitionerPartition_ParMetis() 131 for (p = 0, sumt = 0.0; p < nparts; ++p) { in PetscPartitionerPartition_ParMetis() 135 for (p = 0; p < nparts; ++p) tpwgts[p] /= sumt; in PetscPartitionerPartition_ParMetis() 136 for (p = 0, sumt = 0.0; p < nparts - 1; ++p) sumt += tpwgts[p]; in PetscPartitionerPartition_ParMetis() 137 tpwgts[nparts - 1] = (real_t)(1. - sumt); in PetscPartitionerPartition_ParMetis() 140 for (p = 0; p < nparts; ++p) tpwgts[p] = (real_t)(1.0 / nparts); in PetscPartitionerPartition_ParMetis() 167 …err = METIS_PartGraphRecursive(&nvtxs, &ncon, xadj, adjncy, vwgt, NULL, adjwgt, &nparts, tpwgts, u… in PetscPartitionerPartition_ParMetis() 179 …err = METIS_PartGraphKway(&nvtxs, &ncon, xadj, adjncy, vwgt, NULL, adjwgt, &nparts, tpwgts, ubvec,… in PetscPartitionerPartition_ParMetis() [all …]
|
| /petsc/src/dm/partitioner/impls/ptscotch/ |
| H A D | partptscotch.c | 58 …COTCH_Num adjncy[], SCOTCH_Num vtxwgt[], SCOTCH_Num adjwgt[], SCOTCH_Num nparts, SCOTCH_Num tpart[… in PTScotch_PartGraph_Seq() argument 85 PetscCallPTSCOTCH(SCOTCH_stratGraphMapBuild(&stradat, flagval, nparts, kbalval)); in PTScotch_PartGraph_Seq() 88 PetscCallPTSCOTCH(SCOTCH_archCmpltw(&archdat, PetscMin(nparts, n), tpart)); in PTScotch_PartGraph_Seq() 90 PetscCallPTSCOTCH(SCOTCH_archCmplt(&archdat, PetscMin(nparts, n))); in PTScotch_PartGraph_Seq() 99 …COTCH_Num adjncy[], SCOTCH_Num vtxwgt[], SCOTCH_Num adjwgt[], SCOTCH_Num nparts, SCOTCH_Num tpart[… in PTScotch_PartGraph_MPI() argument 133 PetscCallPTSCOTCH(SCOTCH_stratDgraphMapBuild(&stradat, flagval, procglbnbr, nparts, kbalval)); in PTScotch_PartGraph_MPI() 136 PetscCallPTSCOTCH(SCOTCH_archCmpltw(&archdat, nparts, tpart)); in PTScotch_PartGraph_MPI() 138 PetscCallPTSCOTCH(SCOTCH_archCmplt(&archdat, nparts)); in PTScotch_PartGraph_MPI() 202 static PetscErrorCode PetscPartitionerPartition_PTScotch(PetscPartitioner part, PetscInt nparts, Pe… in PetscPartitionerPartition_PTScotch() argument 251 PetscCall(PetscCalloc1(nparts, &tpwgts)); in PetscPartitionerPartition_PTScotch() [all …]
|
| /petsc/src/mat/graphops/partition/impls/scotch/ |
| H A D | scotch.c | 273 … *locals, *velotab, *veloloctab, *edloloctab, vertlocnbr, edgelocnbr, nparts = part->n; in MatPartitioningApply_PTScotch_Private() local 330 PetscCall(PetscMalloc1(nparts, &vwgttab)); in MatPartitioningApply_PTScotch_Private() 331 PetscCall(PetscMalloc1(nparts, &velotab)); in MatPartitioningApply_PTScotch_Private() 332 for (j = 0; j < nparts; j++) { in MatPartitioningApply_PTScotch_Private() 333 if (part->part_weights) vwgttab[j] = part->part_weights[j] * nparts; in MatPartitioningApply_PTScotch_Private() 336 for (i = 0; i < nparts; i++) { in MatPartitioningApply_PTScotch_Private() 339 for (j = 0; j < nparts; j++) vwgttab[j] /= deltval; in MatPartitioningApply_PTScotch_Private() 342 for (i = 0; i < nparts; i++) velotab[i] = (SCOTCH_Num)(vwgttab[i] + 0.5); in MatPartitioningApply_PTScotch_Private() 352 for (p = 0; !mat->rmap->range[p + 1] && p < nparts; ++p); in MatPartitioningApply_PTScotch_Private() 367 …PetscCallExternal(SCOTCH_stratDgraphMapBuild, &stradat, scotch->strategy, nparts, nparts, scotch->… in MatPartitioningApply_PTScotch_Private() [all …]
|
| /petsc/src/dm/partitioner/impls/matpart/ |
| H A D | partmatpart.c | 88 …etscPartitionerPartition_MatPartitioning(PetscPartitioner part, PetscInt nparts, PetscInt numVerti… in PetscPartitionerPartition_MatPartitioning() argument 116 PetscCall(MatPartitioningSetNParts(p->mp, nparts)); in PetscPartitionerPartition_MatPartitioning() 124 PetscCall(PetscMalloc1(nparts, &tpwgts)); in PetscPartitionerPartition_MatPartitioning() 125 for (p = 0; p < nparts; ++p) { in PetscPartitionerPartition_MatPartitioning() 133 for (p = 0, sumt = 0.0; p < nparts; ++p) { in PetscPartitionerPartition_MatPartitioning() 137 for (p = 0; p < nparts; ++p) tpwgts[p] /= sumt; in PetscPartitionerPartition_MatPartitioning() 138 for (p = 0, sumt = 0.0; p < nparts - 1; ++p) sumt += tpwgts[p]; in PetscPartitionerPartition_MatPartitioning() 139 tpwgts[nparts - 1] = 1. - sumt; in PetscPartitionerPartition_MatPartitioning()
|
| /petsc/src/dm/partitioner/impls/shell/ |
| H A D | partshell.c | 83 static PetscErrorCode PetscPartitionerPartition_Shell(PetscPartitioner part, PetscInt nparts, Petsc… in PetscPartitionerPartition_Shell() argument 96 PetscCall(PetscRandomSetInterval(r, 0.0, (PetscScalar)nparts)); in PetscPartitionerPartition_Shell() 98 PetscCall(PetscCalloc2(nparts, &sizes, numVertices, &points)); in PetscPartitionerPartition_Shell() 100 …for (p = 0; p < nparts; ++p) sizes[p] = numVertices / nparts + (PetscInt)(p < numVertices % nparts… in PetscPartitionerPartition_Shell() 113 PetscCall(PetscPartitionerShellSetPartition(part, nparts, sizes, points)); in PetscPartitionerPartition_Shell() 118 …nparts == np, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Number of requested partitions %" PetscI… in PetscPartitionerPartition_Shell()
|
| /petsc/src/mat/graphops/partition/ |
| H A D | partition.c | 33 PetscInt m, M, nparts, *indices, r, d, *parts, i, start, end, loc; in MatPartitioningApply_Average() local 38 nparts = part->n; in MatPartitioningApply_Average() 39 PetscCall(PetscMalloc1(nparts, &parts)); in MatPartitioningApply_Average() 40 d = M / nparts; in MatPartitioningApply_Average() 41 for (i = 0; i < nparts; i++) parts[i] = d; in MatPartitioningApply_Average() 42 r = M % nparts; in MatPartitioningApply_Average() 44 for (i = 1; i < nparts; i++) parts[i] += parts[i - 1]; in MatPartitioningApply_Average() 48 PetscCall(PetscFindInt(i, nparts, parts, &loc)); in MatPartitioningApply_Average() 378 PetscMPIInt nparts; in MatPartitioningViewImbalance() local 386 PetscCall(PetscMPIIntCast(matp->n, &nparts)); in MatPartitioningViewImbalance() [all …]
|
| /petsc/src/dm/partitioner/interface/ |
| H A D | partitioner.c | 302 PetscErrorCode PetscPartitionerPartition(PetscPartitioner part, PetscInt nparts, PetscInt numVertic… in PetscPartitionerPartition() argument 306 PetscValidLogicalCollectiveInt(part, nparts, 2); in PetscPartitionerPartition() 307 …PetscCheck(nparts > 0, PetscObjectComm((PetscObject)part), PETSC_ERR_ARG_OUTOFRANGE, "Number of pa… in PetscPartitionerPartition() 333 …PetscCheck(s <= 0 && e >= nparts, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Invalid targetSectio… in PetscPartitionerPartition() 339 PetscCall(PetscSectionSetChart(partSection, 0, nparts)); in PetscPartitionerPartition() 340 if (nparts == 1) { /* quick */ in PetscPartitionerPartition() 343 …} else PetscUseTypeMethod(part, partition, nparts, numVertices, start, adjacency, vertexSection, e… in PetscPartitionerPartition()
|
| /petsc/src/mat/graphops/partition/impls/pmetis/ |
| H A D | pmetis.c | 69 …PetscInt itmp = 0, wgtflag = 0, numflag = 0, ncon = part->ncon, nparts = part->n, options[24], … in MatPartitioningApply_Parmetis_Private() local 102 PetscCall(PetscMalloc1(ncon * nparts, &tpwgts)); in MatPartitioningApply_Parmetis_Private() 104 for (j = 0; j < nparts; j++) { in MatPartitioningApply_Parmetis_Private() 106 tpwgts[i * nparts + j] = (real_t)part->part_weights[i * nparts + j]; in MatPartitioningApply_Parmetis_Private() 108 tpwgts[i * nparts + j] = (real_t)1. / nparts; in MatPartitioningApply_Parmetis_Private() 153 …>values, (idx_t *)&wgtflag, (idx_t *)&numflag, (idx_t *)&ncon, (idx_t *)&nparts, tpwgts, ubvec, &i… in MatPartitioningApply_Parmetis_Private() 156 …>values, (idx_t *)&wgtflag, (idx_t *)&numflag, (idx_t *)&ncon, (idx_t *)&nparts, tpwgts, ubvec, (i… in MatPartitioningApply_Parmetis_Private() 159 …>values, (idx_t *)&wgtflag, (idx_t *)&numflag, (idx_t *)&ncon, (idx_t *)&nparts, tpwgts, ubvec, (i… in MatPartitioningApply_Parmetis_Private()
|
| /petsc/src/dm/partitioner/impls/gather/ |
| H A D | partgather.c | 14 static PetscErrorCode PetscPartitionerPartition_Gather(PetscPartitioner part, PetscInt nparts, Pets… in PetscPartitionerPartition_Gather() argument 21 for (np = 1; np < nparts; ++np) PetscCall(PetscSectionSetDof(partSection, np, 0)); in PetscPartitionerPartition_Gather()
|
| /petsc/src/dm/partitioner/impls/chaco/ |
| H A D | partchaco.c | 42 static PetscErrorCode PetscPartitionerPartition_Chaco(PetscPartitioner part, PetscInt nparts, Petsc… in PetscPartitionerPartition_Chaco() argument 98 mesh_dims[0] = nparts; in PetscPartitionerPartition_Chaco() 139 for (p = 0, i = 0; p < nparts; ++p) { in PetscPartitionerPartition_Chaco()
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexpartition.c | 1683 PetscInt nparts, wgtflag, numflag, ncon, edgecut; in DMPlexRebalanceSharedPoints() local 1819 nparts = size; in DMPlexRebalanceSharedPoints() 1821 PetscCall(PetscMalloc1(ncon * nparts, &tpwgts)); in DMPlexRebalanceSharedPoints() 1822 for (i = 0; i < ncon * nparts; i++) tpwgts[i] = (real_t)(1. / (nparts)); in DMPlexRebalanceSharedPoints() 1881 …idx_t *)xadj, (idx_t *)adjncy, vtxwgt, NULL, &wgtflag, &numflag, &ncon, &nparts, tpwgts, ubvec, op… in DMPlexRebalanceSharedPoints() 1888 …idx_t *)xadj, (idx_t *)adjncy, vtxwgt, NULL, &wgtflag, &numflag, &ncon, &nparts, tpwgts, ubvec, op… in DMPlexRebalanceSharedPoints() 1932 …numRows_g, &ncon, (idx_t *)xadj, (idx_t *)adjncy, vtxwgt_g, NULL, NULL, &nparts, tpwgts, ubvec, op… in DMPlexRebalanceSharedPoints()
|
| /petsc/src/dm/partitioner/impls/multistage/ |
| H A D | mspart.c | 584 static PetscErrorCode PetscPartitionerPartition_Multistage(PetscPartitioner part, PetscInt nparts, … in PetscPartitionerPartition_Multistage() argument 696 PetscCall(PetscSectionSetChart(partSection, 0, nparts)); in PetscPartitionerPartition_Multistage()
|
| /petsc/src/dm/impls/da/hypre/ |
| H A D | mhyp.c | 537 PetscInt nparts = 1; /* assuming only one part */ in MatSetUp_HYPRESStruct() local 567 …PetscCallHYPRE(HYPRE_SStructGridCreate(ex->hcomm, (HYPRE_Int)dim, (HYPRE_Int)nparts, &ex->ss_grid)… in MatSetUp_HYPRESStruct()
|
| /petsc/src/ts/tutorials/ |
| H A D | ex30.c | 1180 PetscInt nparts, cStart, cEnd, nr, ccStart, ccEnd, cpStart, cpEnd; in LoadFromFile() local 1192 nparts = size; in LoadFromFile() 1196 PetscCall(PetscCalloc1(nparts, &npoints)); in LoadFromFile() 1197 …PetscCall(PetscMalloc4(cEnd - cStart, &points, cEnd - cStart, &ranks, nparts + 1, &starts, cEnd - … in LoadFromFile() 1220 for (PetscInt c = 0; c < nparts; c++) starts[c + 1] = starts[c] + npoints[c]; in LoadFromFile() 1223 PetscCall(PetscPartitionerShellSetPartition(part, nparts, npoints, points)); in LoadFromFile()
|