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
533372c4
Commit
533372c4
authored
Dec 11, 2017
by
James Willis
Browse files
Define MAX_NUM_OF_NEIGHBOURS at configure time.
parent
047fa75a
Changes
2
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
533372c4
...
...
@@ -689,14 +689,21 @@ esac
# Check if debugging interactions is switched on.
AC_ARG_ENABLE([debug-interactions],
[AS_HELP_STRING([--enable-debug-interactions],
[Activate interaction debugging
@<:@yes/no@:>@
]
[Activate interaction debugging
, logging a maximum of @<:@N@:>@ neighbours. Defaults to 256 if no value set.
]
)],
[enable_debug_interactions="$enableval"],
[enable_debug_interactions="no"]
)
if test "$enable_debug_interactions" = "
yes
"; then
if test "$enable_debug_interactions"
!
= "
no
"; then
if test "$with_hydro" = "gadget2"; then
AC_DEFINE([DEBUG_INTERACTIONS_SPH],1,[Enable interaction debugging])
AC_DEFINE([DEBUG_INTERACTIONS_SPH],1,[Enable interaction debugging])
if test "$enable_debug_interactions" == "yes"; then
AC_DEFINE([MAX_NUM_OF_NEIGHBOURS],256,[The maximum number of particle neighbours to be logged])
[enable_debug_interactions="yes (Logging up to 256 neighbours)"]
else
AC_DEFINE_UNQUOTED([MAX_NUM_OF_NEIGHBOURS], [$enableval] ,[The maximum number of particle neighbours to be logged])
[enable_debug_interactions="yes (Logging up to $enableval neighbours)"]
fi
else
[enable_debug_interactions="no (only available for gadget2 hydro scheme)"]
fi
...
...
src/hydro/Gadget2/hydro_part.h
View file @
533372c4
...
...
@@ -33,10 +33,6 @@
#include
"cooling_struct.h"
#ifdef DEBUG_INTERACTIONS_SPH
#define NUM_OF_NEIGHBOURS 256
#endif
/* Extra particle data not needed during the SPH loops over neighbours. */
struct
xpart
{
...
...
@@ -149,10 +145,10 @@ struct part {
#ifdef DEBUG_INTERACTIONS_SPH
/*! List of interacting particles in the density SELF and PAIR */
long
long
ids_ngbs_density
[
NUM_OF_NEIGHBOURS
];
long
long
ids_ngbs_density
[
MAX_
NUM_OF_NEIGHBOURS
];
/*! List of interacting particles in the force SELF and PAIR */
long
long
ids_ngbs_force
[
NUM_OF_NEIGHBOURS
];
long
long
ids_ngbs_force
[
MAX_
NUM_OF_NEIGHBOURS
];
/*! Number of interactions in the density SELF and PAIR */
int
num_ngb_density
;
...
...
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