Skip to content

Commit

Permalink
regression updates and SIMD size 1 for reverse AD
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarruscag committed Sep 18, 2022
1 parent c0a8d7c commit 4357145
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
12 changes: 11 additions & 1 deletion Common/include/parallelization/vectorization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,17 @@ template<class T>
constexpr size_t preferredLen() { return PREFERRED_SIZE / sizeof(T); }

template<>
constexpr size_t preferredLen<su2double>() { return PREFERRED_SIZE / sizeof(passivedouble); }
constexpr size_t preferredLen<su2double>() {
#ifdef CODI_REVERSE_TYPE
/*--- Use a SIMD size of 1 for reverse AD, larger sizes increase
* the pre-accumulation time with no performance benefit. ---*/
return 1;
#else
/*--- For forward AD there is a performance benefit. This covers
* forward AD and primal mode (su2double == passivedouble). ---*/
return PREFERRED_SIZE / sizeof(passivedouble);
#endif
}

/*!
* \class Array
Expand Down
5 changes: 4 additions & 1 deletion SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@ CNumericsSIMD* createNumerics(const CConfig& config, int iMesh, const CVariable*
* numerical methods.
*/
CNumericsSIMD* CNumericsSIMD::CreateNumerics(const CConfig& config, int nDim, int iMesh, const CVariable* turbVars) {
#ifndef CODI_REVERSE_TYPE
if ((Double::Size < 4) && (SU2_MPI::GetRank() == MASTER_NODE)) {
cout << "WARNING: SU2 was not compiled for an AVX-capable architecture." << endl;
cout << "WARNING: SU2 was not compiled for an AVX-capable architecture. Performance could be better,\n"
" see https://su2code.github.io/docs_v7/Build-SU2-Linux-MacOS/#compiler-optimizations" << endl;
}
#endif
if (nDim == 2) return createNumerics<2>(config, iMesh, turbVars);
if (nDim == 3) return createNumerics<3>(config, iMesh, turbVars);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "MAXIMUM_HEATFLUX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP"
0 , 0.0 , -199999.9862164259, -2.2204999999731917e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.04999999997368221, -2.2200000003768e-08, -2.0599999983605954 , 0.0 , 2.1199999991616814 , 3.6999999980524834 , 330.00000030369847 , -30.00000106112566 , 314.000000400938 , -30.00000106112566 , -1.3999999826097564 , -139.99999737279722, 0.0 , -509.99999530176865, 1e-08
0 , 0.0 , -99999.96982514858, -2.2204000000409886e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.04000000053405728, 0.0 , -2.060000001136153 , 0.0 , 2.12000000054946 , 3.700000000828041 , 330.00000030369847 , -30.00000106112566 , 314.99999977313564 , -30.00000106112566 , -1.400000004814217 , -140.0000030571391, 0.0 , -509.99999530176865, 1e-08
2 changes: 1 addition & 1 deletion TestCases/serial_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def main():
turb_wallfunction_flatplate_sa.cfg_dir = "wallfunctions/flatplate/compressible_SA"
turb_wallfunction_flatplate_sa.cfg_file = "turb_SA_flatplate.cfg"
turb_wallfunction_flatplate_sa.test_iter = 10
turb_wallfunction_flatplate_sa.test_vals = [-4.684321, -2.249602, -2.229407, 0.779062, -5.306220, 10, -1.984965, 0.069232, 0.002496] #last 9 columns
turb_wallfunction_flatplate_sa.test_vals = [-4.436048, -2.044706, -2.114644, 0.979771, -5.393729, 10, -1.589465, 0.069744, 0.002686] #last 9 columns
turb_wallfunction_flatplate_sa.su2_exec = "SU2_CFD"
turb_wallfunction_flatplate_sa.timeout = 1600
turb_wallfunction_flatplate_sa.tol = 0.00001
Expand Down

0 comments on commit 4357145

Please sign in to comment.