Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
5c13d956
Commit
5c13d956
authored
May 15, 2013
by
Pedro Gonnet
Browse files
tighten output.
Former-commit-id: 2de1876f4101fc8c5b2a4e1bb919439ec564964b
parent
cfe70539
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/Makefile.am
View file @
5c13d956
...
...
@@ -19,26 +19,34 @@
# Automake stuff
AUTOMAKE_OPTIONS
=
gnu
# Common flags
MYFLAGS
=
-DTIMER
# Add the source directory and debug to CFLAGS
AM_CFLAGS
=
-g
-Wall
-Werror
-I
../src
$(OPENMP_CFLAGS)
-DCPU_TPS
=
2.67e9
AM_LDFLAGS
=
# Set-up the library
bin_PROGRAMS
=
test
test_fix
e
d test_single
bin_PROGRAMS
=
test
test_fixd
t test_mindt
test_single
# Sources for test
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)
# Sources for test_fixed
test_fixed_SOURCES
=
test.c
test_fixed_CFLAGS
=
-DCOUNTER
-DTIMER
$(AM_CFLAGS)
-DENGINE_POLICY
=
"engine_policy_fixdt | engine_policy_keep"
test_fixed_LDADD
=
../src/.libs/libswiftsim.a
$(HDF5_LDFLAGS)
# Sources for test_fixdt
test_fixdt_SOURCES
=
test.c
test_fixdt_CFLAGS
=
$(MYFLAGS)
$(AM_CFLAGS)
-DENGINE_POLICY
=
"engine_policy_fixdt | engine_policy_keep"
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
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)
examples/SedovBlast/solution.py
View file @
5c13d956
...
...
@@ -33,7 +33,7 @@ P_0 = 1.e-5 # Background Pressure
E_0
=
1.e2
# Energy of the explosion
gamma
=
5.
/
3.
# Gas polytropic index
t
=
0.
1
5
# Time of the solution
t
=
0.
27
5
# Time of the solution
N
=
1000
# Number of radial points
R_max
=
3.
# Maximal radius
...
...
examples/runs.sh
View file @
5c13d956
...
...
@@ -14,7 +14,7 @@ do
fi
if
[
!
-e
SodShock_fixed_
${
cpu
}
.dump
]
then
./test_fix
e
d
-r
1000
-t
$cpu
-f
sodShock.hdf5
-m
0.1
-w
5000
-d
1e-3
>
SodShock_fixed_
${
cpu
}
.dump
./test_fixd
t
-r
1000
-t
$cpu
-f
sodShock.hdf5
-m
0.1
-w
5000
-d
1e-3
>
SodShock_fixed_
${
cpu
}
.dump
fi
# Sedov blast
...
...
@@ -24,7 +24,7 @@ do
fi
if
[
!
-e
SedovBlast_fixed_
${
cpu
}
.dump
]
then
./test_fix
e
d
-r
4096
-t
$cpu
-f
sedov.hdf5
-m
1.0
-w
5000
-d
5e-5
>
SedovBlast_fixed_
${
cpu
}
.dump
./test_fixd
t
-r
4096
-t
$cpu
-f
sedov.hdf5
-m
1.0
-w
5000
-d
5e-5
>
SedovBlast_fixed_
${
cpu
}
.dump
fi
# Cosmological volume
...
...
@@ -34,7 +34,7 @@ do
fi
if
[
!
-e
CosmoVolume_fixed_
${
cpu
}
.dump
]
then
./test_fix
e
d
-r
256
-t
$cpu
-f
cosmoVolume.hdf5
-m
0.6
-w
5000
-d
1e-8
>
CosmoVolume_fixed_
${
cpu
}
.dump
./test_fixd
t
-r
256
-t
$cpu
-f
cosmoVolume.hdf5
-m
0.6
-w
5000
-d
1e-8
>
CosmoVolume_fixed_
${
cpu
}
.dump
fi
done
...
...
examples/test.c
View file @
5c13d956
...
...
@@ -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
);
/* Apply h scaling */
if
(
scaling
!=
1
.
0
)
if
(
scaling
!=
1
.
0
)
for
(
k
=
0
;
k
<
N
;
k
++
)
parts
[
k
].
h
*=
scaling
;
...
...
@@ -871,10 +871,20 @@ int main ( int argc , char *argv[] ) {
runner_hist_bins
[
k
]
=
0
;
#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. */
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
);
#ifdef COUNTER
for
(
k
=
0
;
k
<
runner_counter_count
;
k
++
)
...
...
@@ -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" ,
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. */
#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++ )
printf( " %.3f" , ((double)timers[k])/CPU_TPS*1000 );
printf
(
" ] ms.
\n
"
);
printf
(
"main: queue timers are [ %.3f"
,
queue_timer
[
0
]
/
CPU_TPS
*
1000
);
printf( " ] ms.\n" );
*/
/*
printf( "main: queue timers are [ %.3f" , queue_timer[0]/CPU_TPS*1000 );
for ( k = 1 ; k < queue_timer_count ; k++ )
printf( " %.3f" , ((double)queue_timer[k])/CPU_TPS*1000 );
for ( k = 0 ; k < queue_timer_count ; k++ )
...
...
@@ -933,7 +956,7 @@ int main ( int argc , char *argv[] ) {
printf( " %.3f" , ((double)cell_timer[k])/CPU_TPS*1000 );
for ( k = 0 ; k < cell_timer_count ; k++ )
cell_timer[k] = 0;
printf
(
" ] ms.
\n
"
);
printf( " ] ms.\n" );
*/
#else
printf
(
"main: engine_run with %i threads took %.3f ms.
\n
"
,
nr_threads
,
((
double
)(
getticks
()
-
tic
))
/
CPU_TPS
*
1000
);
#endif
...
...
@@ -943,11 +966,21 @@ int main ( int argc , char *argv[] ) {
printf
(
" %d"
,
runner_counter
[
k
]
);
printf
(
" ].
\n
"
);
#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++ )
printf( " %i" , e.queues[k].count );
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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment