Commit 5c13d956 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

tighten output.


Former-commit-id: 2de1876f4101fc8c5b2a4e1bb919439ec564964b
parent cfe70539
...@@ -19,26 +19,34 @@ ...@@ -19,26 +19,34 @@
# Automake stuff # Automake stuff
AUTOMAKE_OPTIONS=gnu AUTOMAKE_OPTIONS=gnu
# Common flags
MYFLAGS = -DTIMER
# Add the source directory and debug to CFLAGS # Add the source directory and debug to CFLAGS
AM_CFLAGS = -g -Wall -Werror -I../src $(OPENMP_CFLAGS) -DCPU_TPS=2.67e9 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 test_fixed test_single bin_PROGRAMS = test test_fixdt test_mindt test_single
# Sources for test # Sources for test
test_SOURCES = test.c test_SOURCES = test.c
test_CFLAGS = -DCOUNTER -DTIMER $(AM_CFLAGS) test_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_multistep | engine_policy_keep"
test_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) test_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
# Sources for test_fixed # Sources for test_fixdt
test_fixed_SOURCES = test.c test_fixdt_SOURCES = test.c
test_fixed_CFLAGS = -DCOUNTER -DTIMER $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_fixdt | engine_policy_keep" test_fixdt_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_fixdt | engine_policy_keep"
test_fixed_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) test_fixdt_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
# Sources for test_mindt
test_mindt_SOURCES = test.c
test_mindt_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_keep"
test_mindt_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
# Sources for test_single # Sources for test_single
test_single_SOURCES = test_single.c test_single_SOURCES = test_single.c
test_single_CFLAGS = -DCOUNTER -DTIMER $(AM_CFLAGS) test_single_CFLAGS = $(MYFLAGS) $(AM_CFLAGS)
test_single_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) test_single_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
...@@ -33,7 +33,7 @@ P_0 = 1.e-5 # Background Pressure ...@@ -33,7 +33,7 @@ P_0 = 1.e-5 # Background Pressure
E_0 = 1.e2 # Energy of the explosion E_0 = 1.e2 # Energy of the explosion
gamma = 5./3. # Gas polytropic index gamma = 5./3. # Gas polytropic index
t = 0.15 # Time of the solution t = 0.275 # Time of the solution
N = 1000 # Number of radial points N = 1000 # Number of radial points
R_max = 3. # Maximal radius R_max = 3. # Maximal radius
......
...@@ -14,7 +14,7 @@ do ...@@ -14,7 +14,7 @@ do
fi fi
if [ ! -e SodShock_fixed_${cpu}.dump ] if [ ! -e SodShock_fixed_${cpu}.dump ]
then then
./test_fixed -r 1000 -t $cpu -f sodShock.hdf5 -m 0.1 -w 5000 -d 1e-3 > SodShock_fixed_${cpu}.dump ./test_fixdt -r 1000 -t $cpu -f sodShock.hdf5 -m 0.1 -w 5000 -d 1e-3 > SodShock_fixed_${cpu}.dump
fi fi
# Sedov blast # Sedov blast
...@@ -24,7 +24,7 @@ do ...@@ -24,7 +24,7 @@ do
fi fi
if [ ! -e SedovBlast_fixed_${cpu}.dump ] if [ ! -e SedovBlast_fixed_${cpu}.dump ]
then then
./test_fixed -r 4096 -t $cpu -f sedov.hdf5 -m 1.0 -w 5000 -d 5e-5 > SedovBlast_fixed_${cpu}.dump ./test_fixdt -r 4096 -t $cpu -f sedov.hdf5 -m 1.0 -w 5000 -d 5e-5 > SedovBlast_fixed_${cpu}.dump
fi fi
# Cosmological volume # Cosmological volume
...@@ -34,7 +34,7 @@ do ...@@ -34,7 +34,7 @@ do
fi fi
if [ ! -e CosmoVolume_fixed_${cpu}.dump ] if [ ! -e CosmoVolume_fixed_${cpu}.dump ]
then then
./test_fixed -r 256 -t $cpu -f cosmoVolume.hdf5 -m 0.6 -w 5000 -d 1e-8 > CosmoVolume_fixed_${cpu}.dump ./test_fixdt -r 256 -t $cpu -f cosmoVolume.hdf5 -m 0.6 -w 5000 -d 1e-8 > CosmoVolume_fixed_${cpu}.dump
fi fi
done done
......
...@@ -794,7 +794,7 @@ int main ( int argc , char *argv[] ) { ...@@ -794,7 +794,7 @@ int main ( int argc , char *argv[] ) {
printf( "main: reading particle properties took %.3f ms.\n" , ((double)(getticks() - tic)) / CPU_TPS * 1000 ); fflush(stdout); printf( "main: reading particle properties took %.3f ms.\n" , ((double)(getticks() - tic)) / CPU_TPS * 1000 ); fflush(stdout);
/* Apply h scaling */ /* Apply h scaling */
if(scaling != 1.0) if( scaling != 1.0 )
for ( k = 0 ; k < N ; k++ ) for ( k = 0 ; k < N ; k++ )
parts[k].h *= scaling; parts[k].h *= scaling;
...@@ -871,10 +871,20 @@ int main ( int argc , char *argv[] ) { ...@@ -871,10 +871,20 @@ int main ( int argc , char *argv[] ) {
runner_hist_bins[k] = 0; runner_hist_bins[k] = 0;
#endif #endif
/* Inauguration speech. */
if ( runs < INT_MAX )
printf( "main: starting for %i steps with %i threads and %i queues...\n" , runs , e.nr_threads , e.nr_queues );
else
printf( "main: starting for t=%.3e with %i threads and %i queues...\n" , clock , e.nr_threads , e.nr_queues );
fflush(stdout);
/* Legend. */
printf( "# step time e_tot e_kin e_temp dt dt_step count dt_min dt_max\n" );
/* Let loose a runner on the space. */ /* Let loose a runner on the space. */
for ( j = 0 ; j < runs && e.time < clock ; j++ ) { for ( j = 0 ; j < runs && e.time < clock ; j++ ) {
printf( "main: starting run %i/%i (t=%.3e) with %i threads and %i queues...\n" , j+1 , runs , e.time , e.nr_threads , e.nr_queues ); fflush(stdout); // printf( "main: starting run %i/%i (t=%.3e) with %i threads and %i queues...\n" , j+1 , runs , e.time , e.nr_threads , e.nr_queues ); fflush(stdout);
timers_reset( timers_mask_all ); timers_reset( timers_mask_all );
#ifdef COUNTER #ifdef COUNTER
for ( k = 0 ; k < runner_counter_count ; k++ ) for ( k = 0 ; k < runner_counter_count ; k++ )
...@@ -916,13 +926,26 @@ int main ( int argc , char *argv[] ) { ...@@ -916,13 +926,26 @@ int main ( int argc , char *argv[] ) {
printf( "main: particle %lli/%i at [ %e %e %e ] has smallest dt=%e (h=%.3e,u=%.3e).\n" , printf( "main: particle %lli/%i at [ %e %e %e ] has smallest dt=%e (h=%.3e,u=%.3e).\n" ,
p->id , (int)(p - s.parts) , p->x[0] , p->x[1] , p->x[2] , p->dt , p->h , p->u ); */ p->id , (int)(p - s.parts) , p->x[0] , p->x[1] , p->x[2] , p->dt , p->h , p->u ); */
/* Get the particle with the highest e_kin. */
p = &s.parts[0];
double a2, a2_max = p->a[0]*p->a[0] + p->a[1]*p->a[1] + p->a[2]*p->a[2];
for ( k = 0 ; k < s.nr_parts ; k++ ) {
a2 = s.parts[k].a[0]*s.parts[k].a[0] + s.parts[k].a[1]*s.parts[k].a[1] + s.parts[k].a[2]*s.parts[k].a[2];
if ( a2 > a2_max ) {
p = &s.parts[k];
a2_max = a2;
}
}
/* printf( "main: particle %lli/%i at [ %e %e %e ] has largest ekin=%e.\n" ,
p->id , (int)(p - s.parts) , p->x[0] , p->x[1] , p->x[2] , ekin_max ); */
/* Output. */ /* Output. */
#ifdef TIMER #ifdef TIMER
printf( "main: runner timers are [ %.3f" , timers[0]/CPU_TPS*1000 ); /* printf( "main: runner timers are [ %.3f" , timers[0]/CPU_TPS*1000 );
for ( k = 1 ; k < timer_count ; k++ ) for ( k = 1 ; k < timer_count ; k++ )
printf( " %.3f" , ((double)timers[k])/CPU_TPS*1000 ); printf( " %.3f" , ((double)timers[k])/CPU_TPS*1000 );
printf( " ] ms.\n" ); printf( " ] ms.\n" ); */
printf( "main: queue timers are [ %.3f" , queue_timer[0]/CPU_TPS*1000 ); /* printf( "main: queue timers are [ %.3f" , queue_timer[0]/CPU_TPS*1000 );
for ( k = 1 ; k < queue_timer_count ; k++ ) for ( k = 1 ; k < queue_timer_count ; k++ )
printf( " %.3f" , ((double)queue_timer[k])/CPU_TPS*1000 ); printf( " %.3f" , ((double)queue_timer[k])/CPU_TPS*1000 );
for ( k = 0 ; k < queue_timer_count ; k++ ) for ( k = 0 ; k < queue_timer_count ; k++ )
...@@ -933,7 +956,7 @@ int main ( int argc , char *argv[] ) { ...@@ -933,7 +956,7 @@ int main ( int argc , char *argv[] ) {
printf( " %.3f" , ((double)cell_timer[k])/CPU_TPS*1000 ); printf( " %.3f" , ((double)cell_timer[k])/CPU_TPS*1000 );
for ( k = 0 ; k < cell_timer_count ; k++ ) for ( k = 0 ; k < cell_timer_count ; k++ )
cell_timer[k] = 0; cell_timer[k] = 0;
printf( " ] ms.\n" ); printf( " ] ms.\n" ); */
#else #else
printf( "main: engine_run with %i threads took %.3f ms.\n" , nr_threads , ((double)(getticks() - tic)) / CPU_TPS * 1000 ); printf( "main: engine_run with %i threads took %.3f ms.\n" , nr_threads , ((double)(getticks() - tic)) / CPU_TPS * 1000 );
#endif #endif
...@@ -943,11 +966,21 @@ int main ( int argc , char *argv[] ) { ...@@ -943,11 +966,21 @@ int main ( int argc , char *argv[] ) {
printf( " %d" , runner_counter[k] ); printf( " %d" , runner_counter[k] );
printf( " ].\n" ); printf( " ].\n" );
#endif #endif
printf( "main: engine queue lengths are [ %i" , e.queues[0].count ); /* printf( "main: engine queue lengths are [ %i" , e.queues[0].count );
for ( k = 1 ; k < e.nr_queues ; k++ ) for ( k = 1 ; k < e.nr_queues ; k++ )
printf( " %i" , e.queues[k].count ); printf( " %i" , e.queues[k].count );
printf( " ].\n" ); printf( " ].\n" );
fflush(stdout); fflush(stdout); */
/* Dump a line of agregate output. */
printf( "%i %e %e %e %e %e %e %i %e %e" ,
j , e.time ,
e.ekin+e.epot , e.ekin , e.epot ,
e.dt , e.dt_step , e.count_step ,
e.dt_min , e.dt_max );
for ( k = 0 ; k < timer_count ; k++ )
printf( " %.3f" , ((double)timers[k])/CPU_TPS*1000 );
printf( " %lli %e\n" , p->id , a2_max ); fflush(stdout);
} }
......
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