Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QuickSched
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
QuickSched
Commits
cd64e179
Commit
cd64e179
authored
10 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Plain Diff
Merge branch 'bugfix' into 'master'
Bugfix Fixes issue
#4
reported by Matthieu and another bug found by Aidan. See merge request
!2
parents
844d116a
af623002
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/test_bh.c
+9
-22
9 additions, 22 deletions
examples/test_bh.c
with
9 additions
and
22 deletions
examples/test_bh.c
+
9
−
22
View file @
cd64e179
...
@@ -433,19 +433,6 @@ static inline void make_interact_pc(struct part_local *parts, int count,
...
@@ -433,19 +433,6 @@ static inline void make_interact_pc(struct part_local *parts, int count,
w
=
mcom
*
const_G
*
ir
*
ir
*
ir
;
w
=
mcom
*
const_G
*
ir
*
ir
*
ir
;
for
(
k
=
0
;
k
<
3
;
k
++
)
parts
[
j
].
a
[
k
]
+=
w
*
dx
[
k
];
for
(
k
=
0
;
k
<
3
;
k
++
)
parts
[
j
].
a
[
k
]
+=
w
*
dx
[
k
];
#if ICHECK >= 0
if
(
leaf
->
parts
[
j
].
id
==
ICHECK
)
printf
(
"[DEBUG] cell [%f,%f,%f] interacting with cj->loc=[%f,%f,%f] "
"m=%f h=%f
\n
"
,
leaf
->
loc
[
0
],
leaf
->
loc
[
1
],
leaf
->
loc
[
2
],
cj
->
loc
[
0
],
cj
->
loc
[
1
],
cj
->
loc
[
2
],
mcom
,
cj
->
h
);
if
(
leaf
->
parts
[
j
].
id
==
ICHECK
)
printf
(
"[NEW] Interaction with monopole a=( %e %e %e ) h= %f Nj= %d m_j= "
"%f
\n
"
,
w
*
dx
[
0
],
w
*
dx
[
1
],
w
*
dx
[
2
],
cj
->
h
,
cj
->
count
,
mcom
);
#endif
}
/* loop over every particle. */
}
/* loop over every particle. */
}
}
...
@@ -738,7 +725,7 @@ static inline void iact_pair_direct(struct cell *ci, struct cell *cj) {
...
@@ -738,7 +725,7 @@ static inline void iact_pair_direct(struct cell *ci, struct cell *cj) {
/* Find the center point of the interaction. */
/* Find the center point of the interaction. */
for
(
k
=
0
;
k
<
3
;
k
++
)
{
for
(
k
=
0
;
k
<
3
;
k
++
)
{
com
[
k
]
=
0
.
5
*
(
ci
->
loc
[
k
]
+
cj
->
loc
[
k
]
+
ci
->
h
);
com
[
k
]
=
0
.
5
*
(
ci
->
loc
[
k
]
+
cj
->
loc
[
k
]);
}
}
/* Init the local copies of the particles. */
/* Init the local copies of the particles. */
...
@@ -747,7 +734,7 @@ static inline void iact_pair_direct(struct cell *ci, struct cell *cj) {
...
@@ -747,7 +734,7 @@ static inline void iact_pair_direct(struct cell *ci, struct cell *cj) {
parts_j
[
k
].
x
[
j
]
=
cj
->
parts
[
k
].
x
[
j
]
-
com
[
j
];
parts_j
[
k
].
x
[
j
]
=
cj
->
parts
[
k
].
x
[
j
]
-
com
[
j
];
parts_j
[
k
].
a
[
j
]
=
0
.
0
f
;
parts_j
[
k
].
a
[
j
]
=
0
.
0
f
;
}
}
parts_j
[
k
].
mass
=
c
i
->
parts
[
k
].
mass
;
parts_j
[
k
].
mass
=
c
j
->
parts
[
k
].
mass
;
}
}
/* Loop over all particles in ci... */
/* Loop over all particles in ci... */
...
@@ -1006,13 +993,13 @@ void iact_self_direct(struct cell *c) {
...
@@ -1006,13 +993,13 @@ void iact_self_direct(struct cell *c) {
}
}
#if ICHECK >= 0
#if ICHECK >= 0
if
(
parts
[
i
].
id
==
ICHECK
)
if
(
c
->
parts
[
i
].
id
==
ICHECK
)
message
(
"[NEW] Interaction with particle id= %d (self i)"
,
message
(
"[NEW] Interaction with particle id= %d (self i)"
,
parts
[
j
].
id
);
c
->
parts
[
j
].
id
);
if
(
parts
[
j
].
id
==
ICHECK
)
if
(
c
->
parts
[
j
].
id
==
ICHECK
)
message
(
"[NEW] Interaction with particle id= %d (self j)"
,
message
(
"[NEW] Interaction with particle id= %d (self j)"
,
parts
[
i
].
id
);
c
->
parts
[
i
].
id
);
#endif
#endif
}
/* loop over every other particle. */
}
/* loop over every other particle. */
...
@@ -1024,7 +1011,7 @@ void iact_self_direct(struct cell *c) {
...
@@ -1024,7 +1011,7 @@ void iact_self_direct(struct cell *c) {
/* Copy the local particle data back. */
/* Copy the local particle data back. */
for
(
k
=
0
;
k
<
count
;
k
++
)
{
for
(
k
=
0
;
k
<
count
;
k
++
)
{
for
(
j
=
0
;
j
<
3
;
j
++
)
c
->
parts
[
k
].
a
[
j
]
=
parts
[
k
].
a
[
j
];
for
(
j
=
0
;
j
<
3
;
j
++
)
c
->
parts
[
k
].
a
[
j
]
+
=
parts
[
k
].
a
[
j
];
}
}
}
/* otherwise, compute interactions directly. */
}
/* otherwise, compute interactions directly. */
}
}
...
@@ -1543,8 +1530,8 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) {
...
@@ -1543,8 +1530,8 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) {
#if ICHECK >= 0
#if ICHECK >= 0
message
(
"[check] accel of part %i is [%.3e,%.3e,%.3e]"
,
ICHECK
,
message
(
"[check] accel of part %i is [%.3e,%.3e,%.3e]"
,
ICHECK
,
root
->
parts
[
ICHECK
].
a
[
0
],
root
->
parts
[
ICHECK
].
a
[
1
],
root
->
parts
[
ICHECK
].
a
_legacy
[
0
],
root
->
parts
[
ICHECK
].
a
_legacy
[
1
],
root
->
parts
[
ICHECK
].
a
[
2
]);
root
->
parts
[
ICHECK
].
a
_legacy
[
2
]);
#endif
#endif
printf
(
"task counts: [ %8s %8s %8s %8s %8s ]
\n
"
,
"self"
,
"pair"
,
"m-poles"
,
printf
(
"task counts: [ %8s %8s %8s %8s %8s ]
\n
"
,
"self"
,
"pair"
,
"m-poles"
,
"direct"
,
"CoMs"
);
"direct"
,
"CoMs"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment