Commit 533372c4 authored by James Willis's avatar James Willis
Browse files

Define MAX_NUM_OF_NEIGHBOURS at configure time.

parent 047fa75a
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment