Skip to content
GitLab
Menu
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
7c5d6627
Commit
7c5d6627
authored
Jul 14, 2016
by
James Willis
Browse files
Formatting.
parent
23404b61
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
7c5d6627
...
...
@@ -2393,11 +2393,10 @@ void engine_step(struct engine *e) {
printf
(
" %6d %14e %14e %10zd %10zd %21.3f
\n
"
,
e
->
step
,
e
->
time
,
e
->
timeStep
,
e
->
updates
,
e
->
g_updates
,
e
->
wallclock_time
);
fflush
(
stdout
);
fprintf
(
e
->
file_timesteps
,
" %6d %14e %14e %10zd %10zd %21.3f
\n
"
,
e
->
step
,
e
->
time
,
e
->
timeStep
,
e
->
updates
,
e
->
g_updates
,
e
->
wallclock_time
);
fflush
(
e
->
file_timesteps
);
fprintf
(
e
->
file_timesteps
,
" %6d %14e %14e %10zd %10zd %21.3f
\n
"
,
e
->
step
,
e
->
time
,
e
->
timeStep
,
e
->
updates
,
e
->
g_updates
,
e
->
wallclock_time
);
fflush
(
e
->
file_timesteps
);
}
/* Save some statistics */
...
...
@@ -2960,29 +2959,40 @@ void engine_init(struct engine *e, struct space *s,
/* Open some files */
if
(
e
->
nodeID
==
0
)
{
char
energyfileName
[
200
]
=
""
;
parser_get_opt_param_string
(
params
,
"Statistics:energy_file_name"
,
energyfileName
,
engine_default_energy_file_name
);
sprintf
(
energyfileName
+
strlen
(
energyfileName
),
".txt"
);
parser_get_opt_param_string
(
params
,
"Statistics:energy_file_name"
,
energyfileName
,
engine_default_energy_file_name
);
sprintf
(
energyfileName
+
strlen
(
energyfileName
),
".txt"
);
e
->
file_stats
=
fopen
(
energyfileName
,
"w"
);
fprintf
(
e
->
file_stats
,
"# %14s %14s %14s %14s %14s %14s %14s %14s %14s %14s %14s %14s
\n
"
,
"Time"
,
"Mass"
,
"E_tot"
,
"E_kin"
,
"E_int"
,
"E_pot"
,
"p_x"
,
"p_y"
,
"p_z"
,
"ang_x"
,
"ang_y"
,
"ang_z"
);
fflush
(
e
->
file_stats
);
char
timestepsfileName
[
200
]
=
""
;
parser_get_opt_param_string
(
params
,
"Statistics:timestep_file_name"
,
timestepsfileName
,
engine_default_timesteps_file_name
);
parser_get_opt_param_string
(
params
,
"Statistics:timestep_file_name"
,
timestepsfileName
,
engine_default_timesteps_file_name
);
sprintf
(
timestepsfileName
+
strlen
(
timestepsfileName
),
"_%d.txt"
,
nr_nodes
*
nr_threads
);
sprintf
(
timestepsfileName
+
strlen
(
timestepsfileName
),
"_%d.txt"
,
nr_nodes
*
nr_threads
);
e
->
file_timesteps
=
fopen
(
timestepsfileName
,
"w"
);
fprintf
(
e
->
file_timesteps
,
"# Branch: %s
\n
# Revision: %s
\n
# Compiler: %s, Version: %s
\n
# Number of threads: %d
\n
# Number of MPI ranks: %d
\n
# Hydrodynamic scheme: %s
\n
# Hydrodynamic kernel: %s
\n
# No. of neighbours: %.2f +/- %.2f
\n
# Eta: %f
\n
"
,
git_branch
(),
git_revision
(),
compiler_name
(),
compiler_version
(),
e
->
nr_threads
,
e
->
nr_nodes
,
SPH_IMPLEMENTATION
,
kernel_name
,
e
->
hydro_properties
->
target_neighbours
,
e
->
hydro_properties
->
delta_neighbours
,
e
->
hydro_properties
->
eta_neighbours
);
fprintf
(
e
->
file_timesteps
,
"# %6s %14s %14s %10s %10s %16s [%s]
\n
"
,
"Step"
,
"Time"
,
"Time-step"
,
"Updates"
,
"g-Updates"
,
"Wall-clock time"
,
clocks_getunit
());
"# Branch: %s
\n
# Revision: %s
\n
# Compiler: %s, Version: %s
\n
# "
"Number of threads: %d
\n
# Number of MPI ranks: %d
\n
# Hydrodynamic "
"scheme: %s
\n
# Hydrodynamic kernel: %s
\n
# No. of neighbours: %.2f "
"+/- %.2f
\n
# Eta: %f
\n
"
,
git_branch
(),
git_revision
(),
compiler_name
(),
compiler_version
(),
e
->
nr_threads
,
e
->
nr_nodes
,
SPH_IMPLEMENTATION
,
kernel_name
,
e
->
hydro_properties
->
target_neighbours
,
e
->
hydro_properties
->
delta_neighbours
,
e
->
hydro_properties
->
eta_neighbours
);
fprintf
(
e
->
file_timesteps
,
"# %6s %14s %14s %10s %10s %16s [%s]
\n
"
,
"Step"
,
"Time"
,
"Time-step"
,
"Updates"
,
"g-Updates"
,
"Wall-clock time"
,
clocks_getunit
());
fflush
(
e
->
file_timesteps
);
}
/* Print policy */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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