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
9505d699
Commit
9505d699
authored
Dec 02, 2012
by
Pedro Gonnet
Browse files
fixed rather nasty hidden bug.
Former-commit-id: 409cb4852ca9b083add7c431ecfdebbc9c5d3309
parent
a5d97bbf
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
9505d699
...
...
@@ -64,8 +64,8 @@ void engine_prepare ( struct engine *e , int force ) {
struct
space
*
s
=
e
->
s
;
/* Rebuild the space. */
changes
=
space_rebuild
(
e
->
s
,
force
);
printf
(
"engine_prepare: space_rebuild with %i changes.
\n
"
,
changes
);
changes
=
space_rebuild
(
e
->
s
,
force
,
0
);
//
printf( "engine_prepare: space_rebuild with %i changes.\n" , changes );
/* Has anything changed? */
if
(
changes
)
{
...
...
src/runner.c
View file @
9505d699
...
...
@@ -321,7 +321,7 @@ void runner_dosort ( struct runner *r , struct cell *c , int flags ) {
void
runner_doghost
(
struct
runner
*
r
,
struct
cell
*
c
)
{
struct
part
*
p
;
struct
cell
*
finger
;
struct
cell
*
finger
,
*
finger_prev
;
;
int
i
,
k
,
redo
,
count
=
c
->
count
;
int
*
pid
;
float
ihg
,
ihg2
;
...
...
@@ -365,7 +365,8 @@ void runner_doghost ( struct runner *r , struct cell *c ) {
/* Did we get the right number density? */
if
(
p
->
wcount
+
kernel_root
>
const_nwneigh
+
1
||
p
->
wcount
+
kernel_root
<
const_nwneigh
-
1
)
{
// printf( "runner_doghost: particle %i (h=%e) has bad wcount=%f.\n" , p->id , p->h , p->wcount + kernel_root ); fflush(stdout);
// printf( "runner_doghost: particle %lli (h=%e,depth=%i) has bad wcount=%f.\n" , p->id , p->h , c->depth , p->wcount + kernel_root ); fflush(stdout);
// p->h += ( p->wcount + kernel_root - const_nwneigh ) / p->wcount_dh;
pid
[
redo
]
=
pid
[
i
];
redo
+=
1
;
p
->
wcount
=
0
.
0
;
...
...
@@ -401,6 +402,7 @@ void runner_doghost ( struct runner *r , struct cell *c ) {
// error( "Bad smoothing length, fixing this isn't implemented yet." );
/* Climb up the cell hierarchy. */
finger_prev
=
c
;
for
(
finger
=
c
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
{
/* Run through this cell's density interactions. */
...
...
@@ -423,9 +425,12 @@ void runner_doghost ( struct runner *r , struct cell *c ) {
/* Otherwise, sub interaction? */
else
if
(
finger
->
density
[
k
]
->
type
==
task_type_sub
)
runner_dosub_subset_density
(
r
,
finger
->
density
[
k
]
->
ci
,
finger
->
density
[
k
]
->
cj
,
c
,
c
->
parts
,
pid
,
count
,
finger
->
density
[
k
]
->
flags
);
runner_dosub_subset_density
(
r
,
finger
->
density
[
k
]
->
ci
,
finger
->
density
[
k
]
->
cj
,
finger_prev
,
c
->
parts
,
pid
,
count
,
finger
->
density
[
k
]
->
flags
);
}
/* Keep a finger on the previous cell. */
finger_prev
=
finger
;
}
...
...
src/runner_doiact.h
View file @
9505d699
...
...
@@ -223,7 +223,7 @@ void DOPAIR_SUBSET ( struct runner *r , struct cell *restrict ci , struct part *
if
(
r2
<
hi2
)
{
IACT_NONSYM
(
r2
,
dx
,
hi
,
pj
->
h
,
pi
,
pj
);
}
}
/* loop over the parts in cj. */
...
...
@@ -797,17 +797,20 @@ void DOSUB_SUBSET ( struct runner *r , struct cell *restrict ci , struct cell *r
// TIMER_TIC
// printf( "dosub_subset: doing sub with flags=%i, depth=%i.\n" , flags , ci->depth ); fflush(stdout);
/* Different types of flags. */
switch
(
flags
)
{
/* Regular sub-cell interactions of a single cell. */
case
0
:
for
(
j
=
0
;
j
<
7
;
j
++
)
for
(
k
=
j
+
1
;
k
<
8
;
k
++
)
for
(
k
=
j
+
1
;
k
<
8
;
k
++
)
{
if
(
ci
->
progeny
[
j
]
==
sub
&&
ci
->
progeny
[
k
]
!=
NULL
)
DOPAIR_SUBSET
(
r
,
ci
->
progeny
[
j
]
,
parts_i
,
ind
,
count
,
ci
->
progeny
[
k
]
);
else
if
(
ci
->
progeny
[
k
]
==
sub
&&
ci
->
progeny
[
j
]
!=
NULL
)
else
if
(
ci
->
progeny
[
k
]
==
sub
&&
ci
->
progeny
[
j
]
!=
NULL
)
DOPAIR_SUBSET
(
r
,
ci
->
progeny
[
k
]
,
parts_i
,
ind
,
count
,
ci
->
progeny
[
j
]
);
}
break
;
case
1
:
/* ( 1 , 1 , 0 ) */
...
...
src/space.c
View file @
9505d699
This diff is collapsed.
Click to expand it.
src/space.h
View file @
9505d699
...
...
@@ -103,7 +103,7 @@ void space_init ( struct space *s , double dim[3] , struct part *parts , int N ,
void
space_maketasks
(
struct
space
*
s
,
int
do_sort
);
void
space_map_cells
(
struct
space
*
s
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
)
,
void
*
data
);
void
space_map_parts
(
struct
space
*
s
,
void
(
*
fun
)(
struct
part
*
p
,
struct
cell
*
c
,
void
*
data
)
,
void
*
data
);
int
space_rebuild
(
struct
space
*
s
,
int
force
);
int
space_rebuild
(
struct
space
*
s
,
int
force
,
double
h_max
);
void
space_recycle
(
struct
space
*
s
,
struct
cell
*
c
);
void
space_split
(
struct
space
*
s
,
struct
cell
*
c
);
...
...
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