Skip to content

Commit c7dc04d

Browse files
committed
Changed the work estimates for ParMetis to passivedouble
1 parent 7f56cb1 commit c7dc04d

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

Common/include/fem/fem_standard_element.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ class CFEMStandardElement : public CFEMStandardElementBase {
990990
type. This information is used to determine a well balanced partition.
991991
* \param[in] config - Object, which contains the input parameters.
992992
*/
993-
su2double WorkEstimateMetis(CConfig* config);
993+
passivedouble WorkEstimateMetis(CConfig* config);
994994

995995
private:
996996
/*!
@@ -1420,7 +1420,7 @@ class CFEMStandardInternalFace : public CFEMStandardElementBase {
14201420
type. This information is used to determine a well balanced partition.
14211421
* \param[in] config - Object, which contains the input parameters.
14221422
*/
1423-
su2double WorkEstimateMetis(CConfig* config);
1423+
passivedouble WorkEstimateMetis(CConfig* config);
14241424

14251425
private:
14261426
/*!
@@ -1636,7 +1636,7 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase {
16361636
type. This information is used to determine a well balanced partition.
16371637
* \param[in] config - Object, which contains the input parameters.
16381638
*/
1639-
su2double WorkEstimateMetis(CConfig* config);
1639+
passivedouble WorkEstimateMetis(CConfig* config);
16401640

16411641
/*!
16421642
* \brief Function, which estimates the additional amount of work for an element
@@ -1645,7 +1645,7 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase {
16451645
* \param[in] config - Object, which contains the input parameters.
16461646
* \param[in] nPointsWF - Number of points to discretize the wall model.
16471647
*/
1648-
su2double WorkEstimateMetisWallFunctions(CConfig* config, const unsigned short nPointsWF);
1648+
passivedouble WorkEstimateMetisWallFunctions(CConfig* config, const unsigned short nPointsWF);
16491649

16501650
private:
16511651
/*!

Common/src/fem/fem_work_estimate_metis.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@
2828

2929
#include "../../include/fem/fem_standard_element.hpp"
3030

31-
su2double CFEMStandardElement::WorkEstimateMetis(CConfig* config) {
31+
passivedouble CFEMStandardElement::WorkEstimateMetis(CConfig* config) {
3232
/* TEMPORARY IMPLEMENTATION. */
3333
return nIntegration + 0.1 * nDOFs;
3434
}
3535

36-
su2double CFEMStandardInternalFace::WorkEstimateMetis(CConfig* config) {
36+
passivedouble CFEMStandardInternalFace::WorkEstimateMetis(CConfig* config) {
3737
/* TEMPORARY IMPLEMENTATION. */
3838
return 2.0 * nIntegration + 0.05 * (nDOFsFaceSide0 + nDOFsFaceSide1);
3939
}
4040

41-
su2double CFEMStandardBoundaryFace::WorkEstimateMetis(CConfig* config) {
41+
passivedouble CFEMStandardBoundaryFace::WorkEstimateMetis(CConfig* config) {
4242
/* TEMPORARY IMPLEMENTATION. */
4343
return nIntegration + 0.05 * nDOFsFace;
4444
}
4545

46-
su2double CFEMStandardBoundaryFace::WorkEstimateMetisWallFunctions(CConfig* config, const unsigned short nPointsWF) {
46+
passivedouble CFEMStandardBoundaryFace::WorkEstimateMetisWallFunctions(CConfig* config, const unsigned short nPointsWF) {
4747
/* TEMPORARY IMPLEMENTATION. */
4848
return 0.25 * nIntegration * nPointsWF;
4949
}

Common/src/geometry/CPhysicalGeometryFEM.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,13 +1162,13 @@ void CPhysicalGeometry::DetermineFEMColorsViaParMETIS(vector<vector<unsigned lon
11621162

11631163
/* Create the vertex weights in ParMETIS format. */
11641164
vector<idx_t> vwgtPar(nElem * ncon);
1165-
for (unsigned long i = 0; i < nElem * ncon; ++i) vwgtPar[i] = (idx_t)ceil(vwgt[i]);
1165+
for (unsigned long i = 0; i < nElem * ncon; ++i) vwgtPar[i] = static_cast<idx_t>(ceil(vwgt[i]));
11661166

11671167
/* Create the adjacency weight in ParMETIS format. */
11681168
vector<idx_t> adjwgtPar(xadjPar[nElem]);
11691169
ii = 0;
11701170
for (unsigned long i = 0; i < nElem; ++i) {
1171-
for (unsigned long j = 0; j < adjwgt[i].size(); ++j, ++ii) adjwgtPar[ii] = (idx_t)ceil(adjwgt[i][j]);
1171+
for (unsigned long j = 0; j < adjwgt[i].size(); ++j, ++ii) adjwgtPar[ii] = static_cast<idx_t>(ceil(adjwgt[i][j]));
11721172
}
11731173

11741174
/* Make sure that an equal distribution is obtained. */
@@ -2960,12 +2960,13 @@ void CPhysicalGeometry::DetermineFEMGraphWeights(
29602960

29612961
/*--- Determine the minimum of the workload of the elements, i.e. 1st vertex
29622962
weight, over the entire domain. ---*/
2963-
su2double minvwgt = vwgt[0];
2963+
passivedouble minvwgt = vwgt[0];
29642964
for (unsigned long i = 0; i < nElem; ++i) minvwgt = min(minvwgt, vwgt[2 * i]);
29652965

29662966
#ifdef HAVE_MPI
2967-
su2double locminvwgt = minvwgt;
2968-
SU2_MPI::Allreduce(&locminvwgt, &minvwgt, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm());
2967+
su2double locminvwgt = minvwgt, globminvwgt;
2968+
SU2_MPI::Allreduce(&locminvwgt, &globminvwgt, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm());
2969+
minvwgt = SU2_TYPE::GetValue(globminvwgt);
29692970
#endif
29702971

29712972
/*--- Scale the workload of the elements, the 1st vertex weight, with the

0 commit comments

Comments
 (0)