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
b8b5f0e9
Commit
b8b5f0e9
authored
Aug 14, 2017
by
Peter W. Draper
Browse files
Remove debugging output and format
parent
fc6717e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
b8b5f0e9
...
...
@@ -300,11 +300,12 @@ static void dumpCells_map(struct cell *c, void *data) {
/* Only locally active cells are dumped. */
if
(
c
->
count
>
0
)
fprintf
(
file
,
" %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d %6d %6d %6d "
"%6.1f %20lld %6d %6d %6d %6d
\n
"
,
c
->
loc
[
0
],
c
->
loc
[
1
],
c
->
loc
[
2
],
c
->
width
[
0
],
c
->
width
[
1
],
c
->
width
[
2
],
c
->
count
,
c
->
gcount
,
c
->
scount
,
c
->
depth
,
ntasks
,
c
->
ti_end_min
,
get_time_bin
(
c
->
ti_end_min
),
(
c
->
super
==
c
),
fprintf
(
file
,
" %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d %6d %6d %6d "
"%6.1f %20lld %6d %6d %6d %6d
\n
"
,
c
->
loc
[
0
],
c
->
loc
[
1
],
c
->
loc
[
2
],
c
->
width
[
0
],
c
->
width
[
1
],
c
->
width
[
2
],
c
->
count
,
c
->
gcount
,
c
->
scount
,
c
->
depth
,
ntasks
,
c
->
ti_end_min
,
get_time_bin
(
c
->
ti_end_min
),
(
c
->
super
==
c
),
cell_is_active
(
c
,
e
),
c
->
nodeID
);
}
...
...
@@ -328,14 +329,15 @@ void dumpCells(const char *prefix, struct space *s) {
file
=
fopen
(
fname
,
"w"
);
/* Header. */
fprintf
(
file
,
"# %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s "
"%20s %6s %6s %6s
\n
"
,
"x"
,
"y"
,
"z"
,
"xw"
,
"yw"
,
"zw"
,
"count"
,
"gcount"
,
"scount"
,
"depth"
,
"tasks"
,
"ti_end_min"
,
"timebin"
,
"issuper"
,
"active"
,
"rank"
);
fprintf
(
file
,
"# %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s "
"%20s %6s %6s %6s
\n
"
,
"x"
,
"y"
,
"z"
,
"xw"
,
"yw"
,
"zw"
,
"count"
,
"gcount"
,
"scount"
,
"depth"
,
"tasks"
,
"ti_end_min"
,
"timebin"
,
"issuper"
,
"active"
,
"rank"
);
uintptr_t
data
[
2
];
data
[
0
]
=
(
size_t
)
file
;
data
[
1
]
=
(
size_t
)
s
->
e
;
data
[
0
]
=
(
size_t
)
file
;
data
[
1
]
=
(
size_t
)
s
->
e
;
space_map_cells_pre
(
s
,
1
,
dumpCells_map
,
&
data
);
fclose
(
file
);
}
...
...
src/engine.c
View file @
b8b5f0e9
...
...
@@ -2906,8 +2906,7 @@ void engine_print_task_counts(struct engine *e) {
int
engine_estimate_nr_tasks
(
struct
engine
*
e
)
{
int
tasks_per_cell
=
e
->
tasks_per_cell
;
if
(
tasks_per_cell
>
0
)
return
e
->
s
->
tot_cells
*
tasks_per_cell
;
if
(
tasks_per_cell
>
0
)
return
e
->
s
->
tot_cells
*
tasks_per_cell
;
/* Our guess differs depending on the types of tasks we are using, but we
* basically use a formula <n1>*ntopcells + <n2>*(totcells - ntopcells).
...
...
@@ -2966,14 +2965,14 @@ int engine_estimate_nr_tasks(struct engine *e) {
struct
cell
*
c
=
&
e
->
s
->
cells_top
[
k
];
/* Any cells with particles will have tasks (local & foreign). */
int
nparts
=
c
->
count
+
c
->
gcount
+
c
->
scount
;
int
nparts
=
c
->
count
+
c
->
gcount
+
c
->
scount
;
if
(
nparts
>
0
)
{
ntop
++
;
ncells
++
;
/* Count cell depth until we get below the parts per cell threshold. */
int
depth
=
3
;
while
(
nparts
>
space_splitsize
)
{
while
(
nparts
>
space_splitsize
)
{
depth
++
;
nparts
/=
8
;
ncells
+=
(
1
<<
depth
);
...
...
@@ -3656,12 +3655,6 @@ void engine_step(struct engine *e) {
/* Print the number of active tasks ? */
if
(
e
->
verbose
)
engine_print_task_counts
(
e
);
/* Dump cells of our space. */
char
name
[
15
];
sprintf
(
name
,
"%s_%d"
,
"cells"
,
e
->
nodeID
);
dumpCells
(
name
,
e
->
s
);
#ifdef SWIFT_DEBUG_CHECKS
/* Check that we have the correct total mass in the top-level multipoles */
size_t
num_gpart_mpole
=
0
;
...
...
src/scheduler.c
View file @
b8b5f0e9
...
...
@@ -772,8 +772,11 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
const
int
ind
=
atomic_inc
(
&
s
->
tasks_next
);
/* Overflow? */
if
(
ind
>=
s
->
size
)
error
(
"Task list overflow (%d). Need to increase "
"Scheduler:tasks_per_cell."
,
ind
);
if
(
ind
>=
s
->
size
)
error
(
"Task list overflow (%d). Need to increase "
"Scheduler:tasks_per_cell."
,
ind
);
/* Get a pointer to the new task. */
struct
task
*
t
=
&
s
->
tasks
[
ind
];
...
...
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