Commit e83aa571 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

more civilized way of dealing with fixed time-steps.


Former-commit-id: 9b7880b04520458efd8729c5dfadf2a15caaaea9
parent 4fe80ee1
...@@ -25,10 +25,15 @@ AM_CFLAGS = -g -Wall -Werror -I../src $(OPENMP_CFLAGS) -DCPU_TPS=2.67e9 ...@@ -25,10 +25,15 @@ AM_CFLAGS = -g -Wall -Werror -I../src $(OPENMP_CFLAGS) -DCPU_TPS=2.67e9
AM_LDFLAGS = AM_LDFLAGS =
# Set-up the library # Set-up the library
bin_PROGRAMS = test bin_PROGRAMS = test test_fixed
# Sources for test # Sources for test
test_SOURCES = test.c test_SOURCES = test.c
test_CFLAGS = -DCOUNTER -DTIMER $(AM_CFLAGS) test_CFLAGS = -DCOUNTER -DTIMER $(AM_CFLAGS)
test_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) test_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
# Sources for test_fixed
test_fixed_SOURCES = test.c
test_fixed_CFLAGS = -DCOUNTER -DTIMER $(AM_CFLAGS) -DENGINE_FLAGS=engine_policy_fixdt
test_fixed_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
...@@ -46,6 +46,11 @@ ...@@ -46,6 +46,11 @@
#define CPU_TPS 2.67e9 #define CPU_TPS 2.67e9
#endif #endif
/* Engine policy flags. */
#ifndef ENGINE_POLICY
#define ENGINE_POLICY engine_policy_none
#endif
/* Error macro. */ /* Error macro. */
#define error(s) { printf( "%s:%s:%i: %s\n" , __FILE__ , __FUNCTION__ , __LINE__ , s ); abort(); } #define error(s) { printf( "%s:%s:%i: %s\n" , __FILE__ , __FUNCTION__ , __LINE__ , s ); abort(); }
...@@ -852,7 +857,7 @@ int main ( int argc , char *argv[] ) { ...@@ -852,7 +857,7 @@ int main ( int argc , char *argv[] ) {
/* Initialize the runner with this space. */ /* Initialize the runner with this space. */
tic = getticks(); tic = getticks();
engine_init( &e , &s , dt_max , nr_threads , nr_queues , engine_policy_steal | engine_policy_keep ); engine_init( &e , &s , dt_max , nr_threads , nr_queues , ENGINE_POLICY | engine_policy_steal );
printf( "main: engine_init took %.3f ms.\n" , ((double)(getticks() - tic)) / CPU_TPS * 1000 ); fflush(stdout); printf( "main: engine_init took %.3f ms.\n" , ((double)(getticks() - tic)) / CPU_TPS * 1000 ); fflush(stdout);
/* Write the state of the system as it is before starting time integration. */ /* Write the state of the system as it is before starting time integration. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment