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
51f60b4b
Commit
51f60b4b
authored
Sep 22, 2017
by
Matthieu Schaller
Browse files
Added a configuration option to activate the naive interactions instead of the sorted ones.
parent
2f8497aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
51f60b4b
...
...
@@ -226,6 +226,18 @@ if test "$enable_debugging_checks" = "yes"; then
AC_DEFINE([SWIFT_DEBUG_CHECKS],1,[Enable expensive debugging])
fi
# Check whether we want to default to naive cell interactions
AC_ARG_ENABLE([naive-interactions],
[AS_HELP_STRING([--enable-naive-interactions],
[Activate use of naive cell interaction functions @<:@yes/no@:>@]
)],
[enable_naive_interactions="$enableval"],
[enable_naive_interactions="no"]
)
if test "$enable_naive_interactions" = "yes"; then
AC_DEFINE([SWIFT_USE_NAIVE_INTERACTIONS],1,[Enable use of naive cell interaction functions])
fi
# Check if gravity force checks are on for some particles.
AC_ARG_ENABLE([gravity-force-checks],
[AS_HELP_STRING([--enable-gravity-force-checks],
...
...
@@ -919,6 +931,7 @@ AC_MSG_RESULT([
Task debugging : $enable_task_debugging
Threadpool debugging : $enable_threadpool_debugging
Debugging checks : $enable_debugging_checks
Naive interactions : $enable_naive_interactions
Gravity checks : $gravity_force_checks
------------------------])
examples/main.c
View file @
51f60b4b
...
...
@@ -361,6 +361,13 @@ int main(int argc, char *argv[]) {
message
(
"WARNING: Debugging checks activated. Code will be slower !"
);
#endif
/* Do we have debugging checks ? */
#ifdef SWIFT_USE_NAIVE_INTERACTIONS
if
(
myrank
==
0
)
message
(
"WARNING: Naive cell interactions activated. Code will be slower !"
);
#endif
/* Do we have gravity accuracy checks ? */
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
if
(
myrank
==
0
)
...
...
src/runner_doiact.h
View file @
51f60b4b
...
...
@@ -124,10 +124,6 @@ void DOPAIR1_NAIVE(struct runner *r, struct cell *restrict ci,
const
struct
engine
*
e
=
r
->
e
;
#ifndef SWIFT_DEBUG_CHECKS
error
(
"Don't use in actual runs ! Slow code !"
);
#endif
TIMER_TIC
;
/* Anything to do here? */
...
...
@@ -216,10 +212,6 @@ void DOPAIR2_NAIVE(struct runner *r, struct cell *restrict ci,
const
struct
engine
*
e
=
r
->
e
;
#ifndef SWIFT_DEBUG_CHECKS
error
(
"Don't use in actual runs ! Slow code !"
);
#endif
TIMER_TIC
;
/* Anything to do here? */
...
...
@@ -310,10 +302,6 @@ void DOSELF1_NAIVE(struct runner *r, struct cell *restrict c) {
const
struct
engine
*
e
=
r
->
e
;
#ifndef SWIFT_DEBUG_CHECKS
error
(
"Don't use in actual runs ! Slow code !"
);
#endif
TIMER_TIC
;
/* Anything to do here? */
...
...
@@ -392,10 +380,6 @@ void DOSELF2_NAIVE(struct runner *r, struct cell *restrict c) {
const
struct
engine
*
e
=
r
->
e
;
#ifndef SWIFT_DEBUG_CHECKS
error
(
"Don't use in actual runs ! Slow code !"
);
#endif
TIMER_TIC
;
/* Anything to do here? */
...
...
@@ -481,10 +465,6 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci,
const
struct
engine
*
e
=
r
->
e
;
#ifndef SWIFT_DEBUG_CHECKS
error
(
"Don't use in actual runs ! Slow code !"
);
#endif
TIMER_TIC
;
const
int
count_j
=
cj
->
count
;
...
...
@@ -565,6 +545,11 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci,
const
struct
engine
*
e
=
r
->
e
;
#ifdef SWIFT_USE_NAIVE_INTERACTIONS
DOPAIR_SUBSET_NAIVE
(
r
,
ci
,
parts_i
,
ind
,
count
,
cj
);
return
;
#endif
TIMER_TIC
;
const
int
count_j
=
cj
->
count
;
...
...
@@ -777,8 +762,10 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
const
struct
engine
*
restrict
e
=
r
->
e
;
// DOPAIR1_NAIVE(r, ci, cj);
// return;
#ifdef SWIFT_USE_NAIVE_INTERACTIONS
DOPAIR1_NAIVE
(
r
,
ci
,
cj
);
return
;
#endif
TIMER_TIC
;
...
...
@@ -999,8 +986,10 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
struct
engine
*
restrict
e
=
r
->
e
;
// DOPAIR2_NAIVE(r, ci, cj);
// return;
#ifdef SWIFT_USE_NAIVE_INTERACTIONS
DOPAIR2_NAIVE
(
r
,
ci
,
cj
);
return
;
#endif
TIMER_TIC
;
...
...
@@ -1337,6 +1326,11 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
const
struct
engine
*
e
=
r
->
e
;
#ifdef SWIFT_USE_NAIVE_INTERACTIONS
DOSELF1_NAIVE
(
r
,
c
);
return
;
#endif
TIMER_TIC
;
if
(
!
cell_is_active
(
c
,
e
))
return
;
...
...
@@ -1469,6 +1463,11 @@ void DOSELF2(struct runner *r, struct cell *restrict c) {
const
struct
engine
*
e
=
r
->
e
;
#ifdef SWIFT_USE_NAIVE_INTERACTIONS
DOSELF2_NAIVE
(
r
,
c
);
return
;
#endif
TIMER_TIC
;
if
(
!
cell_is_active
(
c
,
e
))
return
;
...
...
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