Skip to content

Commit

Permalink
C++ define macro to control which C++ simulators are built
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Sep 7, 2022
1 parent ebed77b commit 7bb1041
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
cmake $GITHUB_WORKSPACE \
-DENABLE_SAMRAI_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DlowResourceTests=ON \
-DCMAKE_CXX_FLAGS="-DPHARE_DIAG_DOUBLES=1 -O2"
-DCMAKE_CXX_FLAGS="-DPHARE_DIAG_DOUBLES=1 -O2 -DPHARE_SIMULATORS=1"
- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down
11 changes: 10 additions & 1 deletion src/core/utilities/meta/meta_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

#include "core/utilities/types.hpp"

#if !defined(PHARE_SIMULATORS)
#define PHARE_SIMULATORS 3
#endif

namespace PHARE
{
namespace core
Expand Down Expand Up @@ -76,15 +80,20 @@ namespace core
SimulatorOption<DimConst<1>, InterpConst<2>, 2, 3, 4>,
SimulatorOption<DimConst<1>, InterpConst<3>, 2, 3, 4, 5>,

#if PHARE_SIMULATORS > 1
SimulatorOption<DimConst<2>, InterpConst<1>, 4, 5, 8, 9>,
SimulatorOption<DimConst<2>, InterpConst<2>, 4, 5, 8, 9, 16>,
SimulatorOption<DimConst<2>, InterpConst<3>, 4, 5, 8, 9, 25>,
#endif

// TODO add in the rest of 3d nbrParticles permutations
// possibly consider compile time activation for uncommon cases
#if PHARE_SIMULATORS > 2
SimulatorOption<DimConst<3>, InterpConst<1>, 6, 12 /*, 27*/>,
SimulatorOption<DimConst<3>, InterpConst<2>, 6, 12>,
SimulatorOption<DimConst<3>, InterpConst<3>, 6, 12>>{};
SimulatorOption<DimConst<3>, InterpConst<3>, 6, 12>,
#endif
>{};
}


Expand Down

0 comments on commit 7bb1041

Please sign in to comment.