Skip to content

Commit ffd855c

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into feature_aero_thermo_elasticity
2 parents d0dd10d + db166ba commit ffd855c

13 files changed

Lines changed: 248 additions & 273 deletions

Common/include/CConfig.hpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,9 @@ class CConfig {
996996
DV_Penalty; /*!< \brief Penalty weight to add a constraint to the total amount of stiffness. */
997997
unsigned long Nonphys_Points, /*!< \brief Current number of non-physical points in the solution. */
998998
Nonphys_Reconstr; /*!< \brief Current number of non-physical reconstructions for 2nd-order upwinding. */
999-
bool ParMETIS; /*!< \brief Boolean for activating ParMETIS mode (while testing). */
999+
su2double ParMETIS_tolerance; /*!< \brief Load balancing tolerance for ParMETIS. */
1000+
long ParMETIS_pointWgt; /*!< \brief Load balancing weight given to points. */
1001+
long ParMETIS_edgeWgt; /*!< \brief Load balancing weight given to edges. */
10001002
unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */
10011003
bool DiscreteAdjoint; /*!< \brief AD-based discrete adjoint mode. */
10021004
unsigned long Wrt_Surf_Freq_DualTime; /*!< \brief Writing surface solution frequency for Dual Time. */
@@ -9379,6 +9381,21 @@ class CConfig {
93799381
*/
93809382
unsigned long GetEdgeColoringGroupSize(void) const { return edgeColorGroupSize; }
93819383

9384+
/*!
9385+
* \brief Get the ParMETIS load balancing tolerance.
9386+
*/
9387+
passivedouble GetParMETIS_Tolerance() const { return SU2_TYPE::GetValue(ParMETIS_tolerance); }
9388+
9389+
/*!
9390+
* \brief Get the ParMETIS load balancing weight for points.
9391+
*/
9392+
long GetParMETIS_PointWeight() const { return ParMETIS_pointWgt; }
9393+
9394+
/*!
9395+
* \brief Get the ParMETIS load balancing weight for edges
9396+
*/
9397+
long GetParMETIS_EdgeWeight() const { return ParMETIS_edgeWgt; }
9398+
93829399
/*!
93839400
* \brief Find the marker index (if any) that is part of a given interface pair.
93849401
* \param[in] iInterface - Number of the interface pair being tested, starting at 0.

Common/include/fem/fem_geometry_structure.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ class CMeshFEM_DG: public CMeshFEM {
880880
* \brief Set the send receive boundaries of the grid.
881881
* \param[in] config - Definition of the particular problem.
882882
*/
883-
void SetSendReceive(CConfig *config) override;
883+
void SetSendReceive(const CConfig *config) override;
884884

885885
/*!
886886
* \brief Set the local index that correspond with the global numbering index.

Common/include/geometry/CGeometry.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ class CGeometry {
137137

138138
#if defined(HAVE_MPI) && defined(HAVE_PARMETIS)
139139
vector<vector<unsigned long> > adj_nodes; /*!< \brief Vector of vectors holding each node's adjacency during preparation for ParMETIS. */
140-
idx_t *adjacency{nullptr}; /*!< \brief Local adjacency array to be input into ParMETIS for partitioning (idx_t is a ParMETIS type defined in their headers). */
141-
idx_t *xadj{nullptr}; /*!< \brief Index array that points to the start of each node's adjacency in CSR format (needed to interpret the adjacency array). */
140+
vector<idx_t> adjacency; /*!< \brief Local adjacency array to be input into ParMETIS for partitioning (idx_t is a ParMETIS type defined in their headers). */
141+
vector<idx_t> xadj; /*!< \brief Index array that points to the start of each node's adjacency in CSR format (needed to interpret the adjacency array). */
142142
#endif
143143

144144
/*--- Turbomachinery variables ---*/
@@ -769,7 +769,7 @@ class CGeometry {
769769
* \brief A virtual member.
770770
* \param[in] config - Definition of the particular problem.
771771
*/
772-
inline virtual void SetColorGrid_Parallel(CConfig *config) {}
772+
inline virtual void SetColorGrid_Parallel(const CConfig *config) {}
773773

774774
/*!
775775
* \brief A virtual member.
@@ -789,7 +789,7 @@ class CGeometry {
789789
* \param[in] config - Definition of the particular problem.
790790
* \param[in] val_domain - Number of domains for parallelization purposes.
791791
*/
792-
inline virtual void SetSendReceive(CConfig *config) {}
792+
inline virtual void SetSendReceive(const CConfig *config) {}
793793

794794
/*!
795795
* \brief A virtual member.

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,22 @@ class CPhysicalGeometry final : public CGeometry {
164164
* \param[in] geometry - Definition of the geometry container holding the initial linear partitions of the grid + coloring.
165165
* \param[in] config - Definition of the particular problem.
166166
*/
167-
void DistributeColoring(CConfig *config, CGeometry *geometry);
167+
void DistributeColoring(const CConfig *config, CGeometry *geometry);
168168

169169
/*!
170170
* \brief Distribute the grid points, including ghost points, across all ranks based on a ParMETIS coloring.
171171
* \param[in] config - Definition of the particular problem.
172172
* \param[in] geometry - Geometrical definition of the problem.
173173
*/
174-
void DistributePoints(CConfig *config, CGeometry *geometry);
174+
void DistributePoints(const CConfig *config, CGeometry *geometry);
175175

176176
/*!
177177
* \brief Distribute the connectivity for a single volume element type across all ranks based on a ParMETIS coloring.
178178
* \param[in] config - Definition of the particular problem.
179179
* \param[in] geometry - Geometrical definition of the problem.
180180
* \param[in] Elem_Type - VTK index of the element type being distributed.
181181
*/
182-
void DistributeVolumeConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type);
182+
void DistributeVolumeConnectivity(const CConfig *config, CGeometry *geometry, unsigned short Elem_Type);
183183

184184
/*!
185185
* \brief Distribute the connectivity for a single surface element type in all markers across all ranks based on a ParMETIS coloring.
@@ -273,21 +273,17 @@ class CPhysicalGeometry final : public CGeometry {
273273
* \brief Routine to sort the adjacency for ParMETIS for graph partitioning in parallel.
274274
* \param[in] config - Definition of the particular problem.
275275
*/
276-
void SortAdjacency(CConfig *config);
276+
void SortAdjacency(const CConfig *config);
277277

278278
/*!
279279
* \brief Set the send receive boundaries of the grid.
280-
* \param[in] geometry - Geometrical definition of the problem.
281280
* \param[in] config - Definition of the particular problem.
282-
* \param[in] val_domain - Number of domains for parallelization purposes.
283281
*/
284-
void SetSendReceive(CConfig *config) override;
282+
void SetSendReceive(const CConfig *config) override;
285283

286284
/*!
287285
* \brief Set the send receive boundaries of the grid.
288-
* \param[in] geometry - Geometrical definition of the problem.
289286
* \param[in] config - Definition of the particular problem.
290-
* \param[in] val_domain - Number of domains for parallelization purposes.
291287
*/
292288
void SetBoundaries(CConfig *config) override;
293289

@@ -373,7 +369,7 @@ class CPhysicalGeometry final : public CGeometry {
373369
* \brief Prepares the grid point adjacency based on a linearly partitioned mesh object needed by ParMETIS for graph partitioning in parallel.
374370
* \param[in] config - Definition of the particular problem.
375371
*/
376-
void PrepareAdjacency(CConfig *config);
372+
void PrepareAdjacency(const CConfig *config);
377373

378374
/*!
379375
* \brief Find repeated nodes between two elements to identify the common face.
@@ -533,7 +529,7 @@ class CPhysicalGeometry final : public CGeometry {
533529
* \brief Set the domains for grid grid partitioning using ParMETIS.
534530
* \param[in] config - Definition of the particular problem.
535531
*/
536-
void SetColorGrid_Parallel(CConfig *config) override;
532+
void SetColorGrid_Parallel(const CConfig *config) override;
537533

538534
/*!
539535
* \brief Set the domains for FEM grid partitioning using ParMETIS.

Common/src/CConfig.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,8 +2666,14 @@ void CConfig::SetConfig_Options() {
26662666
/* DESCRIPTION: Number of zones of the problem */
26672667
addPythonOption("NZONES");
26682668

2669-
/* DESCRIPTION: Activate ParMETIS mode for testing */
2670-
addBoolOption("PARMETIS", ParMETIS, false);
2669+
/* DESCRIPTION: ParMETIS load balancing tolerance */
2670+
addDoubleOption("PARMETIS_TOLERANCE", ParMETIS_tolerance, 0.02);
2671+
2672+
/* DESCRIPTION: ParMETIS load balancing weight for points */
2673+
addLongOption("PARMETIS_POINT_WEIGHT", ParMETIS_pointWgt, 0);
2674+
2675+
/* DESCRIPTION: ParMETIS load balancing weight for edges (equiv. to neighbors) */
2676+
addLongOption("PARMETIS_EDGE_WEIGHT", ParMETIS_edgeWgt, 1);
26712677

26722678
/*--- options that are used in the Hybrid RANS/LES Simulations ---*/
26732679
/*!\par CONFIG_CATEGORY:Hybrid_RANSLES Options\ingroup Config*/

Common/src/fem/fem_geometry_structure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3443,7 +3443,7 @@ void CMeshFEM_DG::CreateStandardVolumeElements(CConfig *config) {
34433443
}
34443444
}
34453445

3446-
void CMeshFEM_DG::SetSendReceive(CConfig *config) {
3446+
void CMeshFEM_DG::SetSendReceive(const CConfig *config) {
34473447

34483448
/*----------------------------------------------------------------------------*/
34493449
/*--- Step 1: Determine the ranks from which this rank has to receive data ---*/

0 commit comments

Comments
 (0)