Skip to content

Commit

Permalink
Disable performance optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Jul 20, 2024
1 parent 90faf9d commit 08e24a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/EnergyPlus/FluidProperties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4061,9 +4061,9 @@ namespace FluidProperties {
assert(end > 0);
while (beg + 1 < end) {
int mid = ((beg + end) >> 1); // bit shifting is faster than /2
(Temperature > this->CpTemps(mid) ? beg : end) = mid;
(Temp > this->CpTemps(mid) ? beg : end) = mid;
} // Invariant: glycol_CpTemps[beg] <= Temperature <= glycol_CpTemps[end]
return GetInterpValue(Temperature, this->CpTemps(beg), this->CpTemps(end), this->CpValues(beg), this->CpValues(end));
return GetInterpValue(Temp, this->CpTemps(beg), this->CpTemps(end), this->CpValues(beg), this->CpValues(end));
#endif // PERFORMANCE_OPT
}
}
Expand Down Expand Up @@ -4143,9 +4143,9 @@ namespace FluidProperties {
}
Rho = this->RhoValues(this->LoRhoTempIdxLast) + (Temp - this->RhoTemps(this->LoRhoTempIdxLast)) * this->RhoTempRatios(this->LoRhoTempIdxLast);
#else // !PERFORMANCE_OPT
int LoTempIndex = FindArrayIndex(Temperature, this->RhoTemps, 1, this->NumRhoTempPoints);
Real64 TempInterpRatio = (Temperature - this->RhoTemps(LoTempIndex)) / (this->RhoTemps(LoTempIndex+1) - this->RhoTemps(LoTempIndex));
ReturnValue = this->RhoValues(LoTempIndex) + TempInterpRatio * (this->RhoValues(LoTempIndex+1) - this->RhoValues(LoTempIndex));
int LoTempIndex = FindArrayIndex(Temp, this->RhoTemps, 1, this->NumRhoTempPoints);
Real64 TempInterpRatio = (Temp - this->RhoTemps(LoTempIndex)) / (this->RhoTemps(LoTempIndex+1) - this->RhoTemps(LoTempIndex));
Rho = this->RhoValues(LoTempIndex) + TempInterpRatio * (this->RhoValues(LoTempIndex+1) - this->RhoValues(LoTempIndex));
#endif // PERFORMANCE_OPT
}

Expand Down Expand Up @@ -4272,9 +4272,9 @@ namespace FluidProperties {
}
Cond = this->CondValues(this->LoCondTempIdxLast) + (Temp - this->CondTemps(this->LoCondTempIdxLast)) * this->CondTempRatios(this->LoCondTempIdxLast);
#else // !PERFORMANCE_OPT
int LoTempIndex = FindArrayIndex(Temperature, this->CondTemps, 1, this->NumCondTempPoints);
Real64 TempInterpRatio = (Temperature - this->CondTemps(LoTempIndex)) / (this->CondTemps(LoTempIndex+1) - this->CondTemps(LoTempIndex));
ReturnValue = this->CondValues(LoTempIndex) + TempInterpRatio * (this->CondValues(LoTempIndex+1) - this->CondValues(LoTempIndex));
int LoTempIndex = FindArrayIndex(Temp, this->CondTemps, 1, this->NumCondTempPoints);
Real64 TempInterpRatio = (Temp - this->CondTemps(LoTempIndex)) / (this->CondTemps(LoTempIndex+1) - this->CondTemps(LoTempIndex));
Cond = this->CondValues(LoTempIndex) + TempInterpRatio * (this->CondValues(LoTempIndex+1) - this->CondValues(LoTempIndex));
#endif // PERFORMANCE_OPT
}

Expand Down Expand Up @@ -4405,8 +4405,8 @@ namespace FluidProperties {
Visc = this->ViscValues(this->LoViscTempIdxLast) + (Temp - this->ViscTemps(this->LoViscTempIdxLast)) * this->ViscTempRatios(this->LoViscTempIdxLast);
#else // !PERFORMANCE_OPT
int LoTempIndex = FindArrayIndex(Temp, this->ViscTemps, 1, this->NumViscTempPoints);
Real64 TempInterpRatio = (Temperature - this->ViscTemps(LoTempIndex)) / (this->ViscTemps(LoTempIndex+1) - this->ViscTemps(LoTempIndex));
ReturnValue = this->ViscValues(LoTempIndex) + TempInterpRatio * (this->ViscValues(LoTempIndex+1) - this->ViscValues(LoTempIndex));
Real64 TempInterpRatio = (Temp - this->ViscTemps(LoTempIndex)) / (this->ViscTemps(LoTempIndex+1) - this->ViscTemps(LoTempIndex));
Visc = this->ViscValues(LoTempIndex) + TempInterpRatio * (this->ViscValues(LoTempIndex+1) - this->ViscValues(LoTempIndex));
#endif // PERFORMANCE_OPT
}

Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/FluidProperties.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct EnergyPlusData;

namespace FluidProperties {

#define PERFORMANCE_OPT
#undef PERFORMANCE_OPT

#ifdef EP_cache_GlycolSpecificHeat
int constexpr t_sh_cache_size = 1024 * 1024;
Expand Down

5 comments on commit 08e24a1

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - x86_64-MacOS-10.18-clang-15.0.0: OK (3643 of 3644 tests passed, 52 test warnings)

Messages:\n

  • 25 tests had: ESO small diffs.
  • 15 tests had: MTR small diffs.
  • 11 tests had: EIO diffs.
  • 11 tests had: Table small diffs.
  • 30 tests had: ERR diffs.
  • 1 test had: Table string diffs.

Failures:\n

regression Test Summary

  • Passed: 790
  • Failed: 1

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - Win64-Windows-10-VisualStudio-16: OK (2852 of 2852 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3682 of 3685 tests passed, 51 test warnings)

Messages:\n

  • 11 tests had: EIO diffs.
  • 26 tests had: ESO small diffs.
  • 13 tests had: MTR small diffs.
  • 10 tests had: Table small diffs.
  • 30 tests had: ERR diffs.
  • 3 tests had: Table string diffs.
  • 1 test had: ESO big diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 808
  • Failed: 3

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (795 of 795 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2060 of 2060 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.