Skip to content

Commit d192a84

Browse files
committed
cmake: move random seed to boris example
and don't have it a CMake option any more Signed-off-by: Torbjörn Klatt <[email protected]>
1 parent 6c01e3e commit d192a84

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ cmake_dependent_option(
2222
option(pfasst_BUILD_TESTS "Build test suite for PFASST." ON )
2323
option(pfasst_WITH_MPI "Build with MPI enabled." ON )
2424
option(pfasst_WITH_GCC_PROF "Enable excessive debugging & profiling output with GCC." OFF)
25-
option(pfasst_DEFAULT_RAND_SEED "Using a hardcoded random seed" ON )
2625
cmake_dependent_option(
2726
enable_LTO "enable LinkTimeOptimization" OFF
2827
"CMAKE_BUILD_TYPE" Release)
@@ -43,10 +42,6 @@ if(${pfasst_WITH_MPI})
4342
add_definitions(-DWITH_MPI)
4443
endif()
4544

46-
if(pfasst_DEFAULT_RAND_SEED)
47-
set(pfasst_RANDOM_SEED "42")
48-
endif()
49-
5045
# Check for C++11 support
5146
if(${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
5247
check_cxx_compiler_flag(-std=c++11 HAVE_STD11)
@@ -129,12 +124,6 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
129124
"build-in profiling support"
130125
)
131126
endif()
132-
if(pfasst_RANDOM_SEED)
133-
add_feature_info(DefaultRandomSeed
134-
pfasst_RANDOM_SEED
135-
"using specific default random seed ${pfasst_RANDOM_SEED}"
136-
)
137-
endif()
138127

139128
set(3rdparty_INCLUDES)
140129
set(3rdparty_DEPENDEND_LIBS)

cmake/site_config.hpp.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
#ifndef _PFASST__SITE_CONFIG_HPP
44
#define _PFASST__SITE_CONFIG_HPP
55

6-
#ifdef PFASST_DEFAULT_RANDOM_SEED
7-
#define PFASST_RANDOM_SEED @pfasst_RANDOM_SEED@
8-
#endif
9-
106
#include <string>
117
using namespace std;
128

examples/boris/particle_cloud_impl.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ using namespace std;
1818

1919
#include "particle_util.hpp"
2020

21+
#define PFASST_RANDOM_SEED 42
22+
2123

2224
namespace pfasst
2325
{
@@ -280,11 +282,7 @@ namespace pfasst
280282

281283
precision scale = 1000.0;
282284

283-
#ifdef PFASST_DEFAULT_RANDOM_SEED
284-
default_random_engine rd_gen(PFASST_RANDOM_SEED);
285-
#else
286-
default_random_engine rd_gen();
287-
#endif
285+
default_random_engine rd_gen(PFASST_RANDOM_SEED);
288286
precision max_pos = max(center->pos());
289287
precision max_vel = max(center->vel());
290288
uniform_real_distribution<precision> dist_pos(- max_pos / scale, max_pos / scale);

0 commit comments

Comments
 (0)