Skip to content

Commit

Permalink
Merge branch 'develop' into feature_signal_handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfooted authored Jun 4, 2024
2 parents 28b9769 + c0324a4 commit ef316f2
Show file tree
Hide file tree
Showing 69 changed files with 1,458 additions and 648 deletions.
117 changes: 102 additions & 15 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ jobs:
key: ${{ matrix.config_set }}-${{ github.sha }}
restore-keys: ${{ matrix.config_set }}
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
- name: Build
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536
with:
args: -b ${{github.ref}} -f "${{matrix.flags}}"
- name: Compress binaries
Expand All @@ -68,7 +68,7 @@ jobs:
name: ${{ matrix.config_set }}
path: install_bin.tgz
- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand Down Expand Up @@ -97,12 +97,12 @@ jobs:
key: ${{ matrix.config_set }}-${{ github.sha }}
restore-keys: ${{ matrix.config_set }}
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
- name: Build
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536
with:
args: -b ${{github.ref}} -f "${{matrix.flags}}"
- name: Compress binaries
Expand All @@ -113,7 +113,47 @@ jobs:
name: ${{ matrix.config_set }}
path: install_bin.tgz
- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103
uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
build_asan:
name: Build SU2 (asan)
strategy:
fail-fast: false
matrix:
config_set: [BaseNoMPI-asan, ReverseNoMPI-asan]
include:
- config_set: BaseNoMPI-asan
flags: '--buildtype=debugoptimized -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true --warnlevel=3 --werror'
- config_set: ReverseNoMPI-asan
flags: '--buildtype=debugoptimized -Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled --warnlevel=3 --werror'
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
steps:
- name: Reduce ASLR entropy for asan
run: sudo sysctl -w vm.mmap_rnd_bits=28
- name: Cache Object Files
uses: actions/cache@v4
with:
path: ccache
key: ${{ matrix.config_set }}-${{ github.sha }}
restore-keys: ${{ matrix.config_set }}
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2-asan:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
- name: Build
run: docker run --rm --cap-add SYS_PTRACE -v $(pwd):${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}"
- name: Compress binaries
run: tar -zcvf install_bin.tgz install/*
- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config_set }}
path: install_bin.tgz
- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2/build-su2-asan:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand Down Expand Up @@ -144,7 +184,7 @@ jobs:
tag: OMP
steps:
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -170,12 +210,12 @@ jobs:
chmod a+x $BIN_FOLDER/*
ls -lahR $BIN_FOLDER
- name: Run Tests in Container
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
- name: Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -192,7 +232,7 @@ jobs:
- name: Reduce ASLR entropy for tsan
run: sudo sysctl -w vm.mmap_rnd_bits=28
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -218,12 +258,59 @@ jobs:
chmod a+x $BIN_FOLDER/*
ls -lahR $BIN_FOLDER
- name: Run Tests in Container
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tsan"
- name: Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
address_sanitizer_tests:
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
name: Address Sanitizer Tests
needs: build_asan
strategy:
fail-fast: false
matrix:
testscript: ['serial_regression.py', 'serial_regression_AD.py']
steps:
- name: Reduce ASLR entropy for asan
run: sudo sysctl -w vm.mmap_rnd_bits=28
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
- name: Download All artifacts
uses: actions/download-artifact@v4
- name: Uncompress and Move Binaries
run: |
BIN_FOLDER="$PWD/install/bin"
mkdir -p $BIN_FOLDER
ls -lah $BIN_FOLDER
for type in Base Reverse Forward; do
TYPE_FOLDER="${type}NoMPI-asan"
echo "Processing '$TYPE_FOLDER' ..."
if [ -d $TYPE_FOLDER ]; then
pushd $TYPE_FOLDER
ls -lah
tar -zxvf install_bin.tgz
ls -lah install/bin/
cp -r install/* $BIN_FOLDER/../
popd;
fi
done
chmod a+x $BIN_FOLDER/*
ls -lahR $BIN_FOLDER
- name: Run Tests in Container
uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--asan"
- name: Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand All @@ -244,7 +331,7 @@ jobs:
tag: MPI
steps:
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
Expand Down Expand Up @@ -305,11 +392,11 @@ jobs:
echo $PWD
ls -lahR
- name: Run Unit Tests
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
with:
entrypoint: install/bin/${{matrix.testdriver}}
- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103
uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
52 changes: 47 additions & 5 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,13 @@ class CConfig {
unsigned short nSpecies_Init; /*!< \brief Number of entries of SPECIES_INIT */

/*--- Additional flamelet solver options ---*/
su2double flame_init[8]; /*!< \brief Initial solution parameters for flamelet solver.*/
///TODO: Add python wrapper initialization option
FLAMELET_INIT_TYPE flame_init_type = FLAMELET_INIT_TYPE::NONE; /*!< \brief Method for solution ignition for flamelet problems. */
std::array<su2double,8> flame_init; /*!< \brief Flame front initialization parameters. */
std::array<su2double,6> spark_init; /*!< \brief Spark ignition initialization parameters. */
su2double* spark_reaction_rates; /*!< \brief Source terms for flamelet spark ignition option. */
unsigned short nspark; /*!< \brief Number of source terms for spark initialization. */
bool preferential_diffusion = false; /*!< \brief Preferential diffusion physics for flamelet solver.*/

/*--- lookup table ---*/
unsigned short n_scalars = 0; /*!< \brief Number of transported scalars for flamelet LUT approach. */
Expand Down Expand Up @@ -2138,13 +2144,44 @@ class CConfig {

/*!
* \brief Get the flame initialization.
* (x1,x2,x3) = flame offset.
* (x4,x5,x6) = flame normal, separating unburnt from burnt.
* (x1,x2,x3) = flame offset/spark center location.
* (x4,x5,x6) = flame normal, separating unburnt from burnt or
* spark radius, spark start iteration, spark duration.
* (x7) = flame thickness, the length from unburnt to burnt conditions.
* (x8) = flame burnt thickness, the length to stay at burnt conditions.
* \return Flame initialization for the flamelet model.
* \return Ignition initialization parameters for the flamelet model.
*/
const su2double* GetFlameInit() const {
switch (flame_init_type)
{
case FLAMELET_INIT_TYPE::FLAME_FRONT:
return flame_init.data();
break;
case FLAMELET_INIT_TYPE::SPARK:
return spark_init.data();
break;
default:
return nullptr;
break;
}
}

/*!
* \brief Get species net reaction rates applied during spark ignition.
*/
const su2double* GetSpark() const {
return spark_reaction_rates;
}

/*!
* \brief Preferential diffusion combustion problem.
*/
bool GetPreferentialDiffusion() const { return preferential_diffusion; }

/*!
* \brief Define preferential diffusion combustion problem.
*/
const su2double* GetFlameInit() const { return flame_init; }
inline void SetPreferentialDiffusion(bool input) { preferential_diffusion = input; }

/*!
* \brief Get the number of control variables for flamelet model.
Expand Down Expand Up @@ -2190,6 +2227,11 @@ class CConfig {
if (n_user_sources > 0) return user_source_names[i_user_source]; else return none;
}

/*!
* \brief Get the ignition method used for combustion problems.
*/
FLAMELET_INIT_TYPE GetFlameletInitType() const { return flame_init_type; }

/*!
* \brief Get the number of transported scalars for combustion.
*/
Expand Down
6 changes: 5 additions & 1 deletion Common/include/containers/CLookUpTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ class CLookUpTable {
/*!
* \brief Find the table levels with constant z-values directly above and below query val_z.
* \param[in] val_CV3 - Value of controlling variable 3.
* \param[in] within_limits - Whether query point lies within table bounds.
* \returns Pair of inclusion level indices (first = lower level index, second = upper level index).
*/
std::pair<unsigned long, unsigned long> FindInclusionLevels(const su2double val_CV3);
Expand All @@ -410,6 +409,11 @@ class CLookUpTable {
return limits_table_x[i_level];
}

/*!
* \brief Check whether requested set of variables are included in the table.
*/
bool CheckForVariables(const std::vector<std::string>& vars_to_check) const;

/*!
* \brief Returns the index to the variable in the lookup table.
* \param[in] nameVar - Variable name for which to retrieve the column index.
Expand Down
6 changes: 3 additions & 3 deletions Common/include/geometry/CGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class CGeometry {
* \param[out] COUNT_PER_POINT - Number of communicated variables per point.
* \param[out] MPI_TYPE - Enumerated type for the datatype of the quantity to be communicated.
*/
void GetCommCountAndType(const CConfig* config, unsigned short commType, unsigned short& COUNT_PER_POINT,
void GetCommCountAndType(const CConfig* config, MPI_QUANTITIES commType, unsigned short& COUNT_PER_POINT,
unsigned short& MPI_TYPE) const;

/*!
Expand All @@ -436,14 +436,14 @@ class CGeometry {
* \param[in] config - Definition of the particular problem.
* \param[in] commType - Enumerated type for the quantity to be communicated.
*/
void InitiateComms(CGeometry* geometry, const CConfig* config, unsigned short commType) const;
void InitiateComms(CGeometry* geometry, const CConfig* config, MPI_QUANTITIES commType) const;

/*!
* \brief Routine to complete the set of non-blocking communications launched by InitiateComms() and unpacking of the
* data into the geometry class. \param[in] geometry - Geometrical definition of the problem. \param[in] config -
* Definition of the particular problem. \param[in] commType - Enumerated type for the quantity to be unpacked.
*/
void CompleteComms(CGeometry* geometry, const CConfig* config, unsigned short commType);
void CompleteComms(CGeometry* geometry, const CConfig* config, MPI_QUANTITIES commType);

/*!
* \brief Get number of coordinates.
Expand Down
4 changes: 2 additions & 2 deletions Common/include/linear_algebra/CSysMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct CSysMatrixComms {
*/
template <class T>
static void Initiate(const CSysVector<T>& x, CGeometry* geometry, const CConfig* config,
unsigned short commType = SOLUTION_MATRIX);
MPI_QUANTITIES commType = MPI_QUANTITIES::SOLUTION_MATRIX);

/*!
* \brief Routine to complete the set of non-blocking communications launched by
Expand All @@ -104,7 +104,7 @@ struct CSysMatrixComms {
*/
template <class T>
static void Complete(CSysVector<T>& x, CGeometry* geometry, const CConfig* config,
unsigned short commType = SOLUTION_MATRIX);
MPI_QUANTITIES commType = MPI_QUANTITIES::SOLUTION_MATRIX);
};

/*!
Expand Down
31 changes: 29 additions & 2 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1333,11 +1333,38 @@ enum FLAMELET_SCALAR_SOURCES {
* \brief Look-up operations for the flamelet scalar solver.
*/
enum FLAMELET_LOOKUP_OPS {
TD, /*!< \brief Thermochemical properties (temperature, density, diffusivity, etc.). */
THERMO, /*!< \brief Thermochemical properties (temperature, density, diffusivity, etc.). */
PREFDIF, /*!< \brief Preferential diffusion scalars. */
SOURCES, /*!< \brief Scalar source terms (controlling variables, passive species).*/
LOOKUP, /*!< \brief Passive look-up variables specified in config. */
};

/*!
* \brief The preferential diffusion scalar indices for the preferential diffusion model.
*/
enum FLAMELET_PREF_DIFF_SCALARS {
I_BETA_PROGVAR, /*!< \brief Preferential diffusion scalar for the progress variable. */
I_BETA_ENTH_THERMAL, /*!< \brief Preferential diffusion scalar for temperature. */
I_BETA_ENTH, /*!< \brief Preferential diffusion scalar for total enthalpy. */
I_BETA_MIXFRAC, /*!< \brief Preferential diffusion scalar for mixture fraction. */
N_BETA_TERMS, /*!< \brief Total number of preferential diffusion scalars. */
};

/*!
* \brief Flame initialization options for the flamelet solver.
*/
enum class FLAMELET_INIT_TYPE {
FLAME_FRONT, /*!< \brief Straight flame front. */
SPARK, /*!< \brief Species reaction rate in a set location. */
NONE, /*!< \brief No ignition, cold flow only. */
};

static const MapType<std::string, FLAMELET_INIT_TYPE> Flamelet_Init_Map = {
MakePair("NONE", FLAMELET_INIT_TYPE::NONE)
MakePair("FLAME_FRONT", FLAMELET_INIT_TYPE::FLAME_FRONT)
MakePair("SPARK", FLAMELET_INIT_TYPE::SPARK)
};

/*!
* \brief Types of subgrid scale models
*/
Expand Down Expand Up @@ -2471,7 +2498,7 @@ enum PERIODIC_QUANTITIES {
/*!
* \brief Vertex-based quantities exchanged in MPI point-to-point communications.
*/
enum MPI_QUANTITIES {
enum class MPI_QUANTITIES {
SOLUTION , /*!< \brief Conservative solution communication. */
SOLUTION_OLD , /*!< \brief Conservative solution old communication. */
SOLUTION_GRADIENT , /*!< \brief Conservative solution gradient communication. */
Expand Down
Loading

0 comments on commit ef316f2

Please sign in to comment.