plexdistribute.c (1ed6e3ff8437baa411029a28c2b08f047df9ad9a) plexdistribute.c (f13dfd9ea68e0ddeee984e65c377a1819eab8a8a)
1#include <petsc/private/dmpleximpl.h> /*I "petscdmplex.h" I*/
2#include <petsc/private/dmlabelimpl.h> /*I "petscdmlabel.h" I*/
3
4/*@C
5 DMPlexSetAdjacencyUser - Define adjacency in the mesh using a user-provided callback
6
7 Input Parameters:
8+ dm - The DM object

--- 718 unchanged lines hidden (view full) ---

727 PetscCall(DMLabelClearValue(*ovLabel, local[l], rank));
728 PetscCall(DMLabelSetValue(*ovLabel, remote[l].index, remote[l].rank));
729 }
730 /* Clean up */
731 PetscCall(DMLabelDestroy(&ovAdjByRank));
732 PetscFunctionReturn(PETSC_SUCCESS);
733}
734
1#include <petsc/private/dmpleximpl.h> /*I "petscdmplex.h" I*/
2#include <petsc/private/dmlabelimpl.h> /*I "petscdmlabel.h" I*/
3
4/*@C
5 DMPlexSetAdjacencyUser - Define adjacency in the mesh using a user-provided callback
6
7 Input Parameters:
8+ dm - The DM object

--- 718 unchanged lines hidden (view full) ---

727 PetscCall(DMLabelClearValue(*ovLabel, local[l], rank));
728 PetscCall(DMLabelSetValue(*ovLabel, remote[l].index, remote[l].rank));
729 }
730 /* Clean up */
731 PetscCall(DMLabelDestroy(&ovAdjByRank));
732 PetscFunctionReturn(PETSC_SUCCESS);
733}
734
735/*@
735/*@C
736 DMPlexCreateOverlapMigrationSF - Create a `PetscSF` describing the new mesh distribution to make the overlap described by the input `PetscSF`
737
738 Collective
739
740 Input Parameters:
741+ dm - The `DM`
742- overlapSF - The `PetscSF` mapping ghost points in overlap to owner points on other processes
743

--- 721 unchanged lines hidden (view full) ---

1465 if (a[i].rank >= b[i].rank) {
1466 a[i].rank = b[i].rank;
1467 a[i].index = b[i].index;
1468 }
1469 }
1470 }
1471}
1472
736 DMPlexCreateOverlapMigrationSF - Create a `PetscSF` describing the new mesh distribution to make the overlap described by the input `PetscSF`
737
738 Collective
739
740 Input Parameters:
741+ dm - The `DM`
742- overlapSF - The `PetscSF` mapping ghost points in overlap to owner points on other processes
743

--- 721 unchanged lines hidden (view full) ---

1465 if (a[i].rank >= b[i].rank) {
1466 a[i].rank = b[i].rank;
1467 a[i].index = b[i].index;
1468 }
1469 }
1470 }
1471}
1472
1473/*@
1473/*@C
1474 DMPlexCreatePointSF - Build a point `PetscSF` from an `PetscSF` describing a point migration
1475
1476 Input Parameters:
1477+ dm - The source `DMPLEX` object
1478. migrationSF - The star forest that describes the parallel point remapping
1479- ownership - Flag causing a vote to determine point ownership
1480
1481 Output Parameter:

--- 115 unchanged lines hidden (view full) ---

1597 if (shiftDebug) PetscCall(PetscSynchronizedFlush(PetscObjectComm((PetscObject)dm), PETSC_STDOUT));
1598 PetscCall(PetscSFSetGraph(*pointSF, nleaves, npointLeaves, pointLocal, PETSC_OWN_POINTER, pointRemote, PETSC_OWN_POINTER));
1599 PetscCall(PetscFree2(rootNodes, leafNodes));
1600 PetscCall(PetscLogEventEnd(DMPLEX_CreatePointSF, dm, 0, 0, 0));
1601 if (PetscDefined(USE_DEBUG)) PetscCall(DMPlexCheckPointSF(dm, *pointSF, PETSC_FALSE));
1602 PetscFunctionReturn(PETSC_SUCCESS);
1603}
1604
1474 DMPlexCreatePointSF - Build a point `PetscSF` from an `PetscSF` describing a point migration
1475
1476 Input Parameters:
1477+ dm - The source `DMPLEX` object
1478. migrationSF - The star forest that describes the parallel point remapping
1479- ownership - Flag causing a vote to determine point ownership
1480
1481 Output Parameter:

--- 115 unchanged lines hidden (view full) ---

1597 if (shiftDebug) PetscCall(PetscSynchronizedFlush(PetscObjectComm((PetscObject)dm), PETSC_STDOUT));
1598 PetscCall(PetscSFSetGraph(*pointSF, nleaves, npointLeaves, pointLocal, PETSC_OWN_POINTER, pointRemote, PETSC_OWN_POINTER));
1599 PetscCall(PetscFree2(rootNodes, leafNodes));
1600 PetscCall(PetscLogEventEnd(DMPLEX_CreatePointSF, dm, 0, 0, 0));
1601 if (PetscDefined(USE_DEBUG)) PetscCall(DMPlexCheckPointSF(dm, *pointSF, PETSC_FALSE));
1602 PetscFunctionReturn(PETSC_SUCCESS);
1603}
1604
1605/*@
1605/*@C
1606 DMPlexMigrate - Migrates internal `DM` data over the supplied star forest
1607
1608 Collective
1609
1610 Input Parameters:
1611+ dm - The source `DMPLEX` object
1612- sf - The star forest communication context describing the migration pattern
1613

--- 399 unchanged lines hidden (view full) ---

2013
2014 Collective
2015
2016 Input Parameters:
2017+ dm - The non-overlapping distributed `DMPLEX` object
2018- overlap - The overlap of partitions (the same on all ranks)
2019
2020 Output Parameters:
1606 DMPlexMigrate - Migrates internal `DM` data over the supplied star forest
1607
1608 Collective
1609
1610 Input Parameters:
1611+ dm - The source `DMPLEX` object
1612- sf - The star forest communication context describing the migration pattern
1613

--- 399 unchanged lines hidden (view full) ---

2013
2014 Collective
2015
2016 Input Parameters:
2017+ dm - The non-overlapping distributed `DMPLEX` object
2018- overlap - The overlap of partitions (the same on all ranks)
2019
2020 Output Parameters:
2021+ sf - The `PetscSF` used for point distribution
2022- dmOverlap - The overlapping distributed `DMPLEX` object, or `NULL`
2021+ sf - The `PetscSF` used for point distribution, or pass `NULL` if not needed
2022- dmOverlap - The overlapping distributed `DMPLEX` object
2023
2024 Options Database Keys:
2025+ -dm_plex_overlap_labels <name1,name2,...> - List of overlap label names
2026. -dm_plex_overlap_values <int1,int2,...> - List of overlap label values
2027. -dm_plex_overlap_exclude_label <name> - Label used to exclude points from overlap
2028- -dm_plex_overlap_exclude_value <int> - Label value used to exclude points from overlap
2029
2030 Level: advanced

--- 316 unchanged lines hidden (view full) ---

2347 }
2348 PetscCall(DMPlexGetChart(dm, &pStart, &pEnd));
2349 count = (pEnd - pStart) > 0 ? 1 : 0;
2350 PetscCall(MPIU_Allreduce(MPI_IN_PLACE, &count, 1, MPIU_INT, MPI_SUM, comm));
2351 *distributed = count > 1 ? PETSC_TRUE : PETSC_FALSE;
2352 PetscFunctionReturn(PETSC_SUCCESS);
2353}
2354
2023
2024 Options Database Keys:
2025+ -dm_plex_overlap_labels <name1,name2,...> - List of overlap label names
2026. -dm_plex_overlap_values <int1,int2,...> - List of overlap label values
2027. -dm_plex_overlap_exclude_label <name> - Label used to exclude points from overlap
2028- -dm_plex_overlap_exclude_value <int> - Label value used to exclude points from overlap
2029
2030 Level: advanced

--- 316 unchanged lines hidden (view full) ---

2347 }
2348 PetscCall(DMPlexGetChart(dm, &pStart, &pEnd));
2349 count = (pEnd - pStart) > 0 ? 1 : 0;
2350 PetscCall(MPIU_Allreduce(MPI_IN_PLACE, &count, 1, MPIU_INT, MPI_SUM, comm));
2351 *distributed = count > 1 ? PETSC_TRUE : PETSC_FALSE;
2352 PetscFunctionReturn(PETSC_SUCCESS);
2353}
2354
2355/*@
2355/*@C
2356 DMPlexDistributionSetName - Set the name of the specific parallel distribution
2357
2358 Input Parameters:
2359+ dm - The `DM`
2360- name - The name of the specific parallel distribution
2361
2362 Level: developer
2363

--- 12 unchanged lines hidden (view full) ---

2376 PetscFunctionBegin;
2377 PetscValidHeaderSpecificType(dm, DM_CLASSID, 1, DMPLEX);
2378 if (name) PetscAssertPointer(name, 2);
2379 PetscCall(PetscFree(mesh->distributionName));
2380 PetscCall(PetscStrallocpy(name, &mesh->distributionName));
2381 PetscFunctionReturn(PETSC_SUCCESS);
2382}
2383
2356 DMPlexDistributionSetName - Set the name of the specific parallel distribution
2357
2358 Input Parameters:
2359+ dm - The `DM`
2360- name - The name of the specific parallel distribution
2361
2362 Level: developer
2363

--- 12 unchanged lines hidden (view full) ---

2376 PetscFunctionBegin;
2377 PetscValidHeaderSpecificType(dm, DM_CLASSID, 1, DMPLEX);
2378 if (name) PetscAssertPointer(name, 2);
2379 PetscCall(PetscFree(mesh->distributionName));
2380 PetscCall(PetscStrallocpy(name, &mesh->distributionName));
2381 PetscFunctionReturn(PETSC_SUCCESS);
2382}
2383
2384/*@
2384/*@C
2385 DMPlexDistributionGetName - Retrieve the name of the specific parallel distribution
2386
2387 Input Parameter:
2388. dm - The `DM`
2389
2390 Output Parameter:
2391. name - The name of the specific parallel distribution
2392

--- 20 unchanged lines hidden ---
2385 DMPlexDistributionGetName - Retrieve the name of the specific parallel distribution
2386
2387 Input Parameter:
2388. dm - The `DM`
2389
2390 Output Parameter:
2391. name - The name of the specific parallel distribution
2392

--- 20 unchanged lines hidden ---