Commit 535460cc authored by Rainer Weinberger's avatar Rainer Weinberger

Removed option FOF_FUZZ_SORT_BY_NEAREST_GROUP; ensured allvars.h and proto.h are included first.

parent 01902d5c
......@@ -231,7 +231,6 @@ ifeq (FOF,$(findstring FOF,$(CONFIGVARS)))
OBJS += fof/fof.o \
fof/fof_distribute.o \
fof/fof_findgroups.o \
fof/fof_fuzz.o \
fof/fof_io.o \
fof/fof_nearest.o \
fof/fof_sort_kernels.o \
......
......@@ -34,10 +34,10 @@
* - 11.05.2018 Prepared file for public release -- Rainer Weinberger
*/
#include "add_bggrid.h"
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "add_bggrid.h"
#include "../domain/domain.h"
#ifdef ADDBACKGROUNDGRID
......
......@@ -38,9 +38,9 @@
#include <mpi.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "add_bggrid.h"
#ifdef ADDBACKGROUNDGRID
......
......@@ -49,10 +49,10 @@
#include <string.h>
#include <strings.h>
#include "../domain/bsd_tree.h"
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/bsd_tree.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
/* do some preparation work for use of red-black ordered binary tree based on BSD macros */
......
......@@ -49,9 +49,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
#include <gsl/gsl_heapsort.h>
......
......@@ -49,9 +49,9 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......@@ -350,11 +350,7 @@ void fof_prepare_output_order(void)
aux_sort[i].DM_BindingEnergy = PS[i].BindingEnergy;
#endif /* #ifdef SUBFIND */
aux_sort[i].Type = P[i].Type;
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
aux_sort[i].key = PS[i].GroupNr;
#else /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
aux_sort[i].ID = P[i].ID;
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP #else */
#if defined(RECOMPUTE_POTENTIAL_IN_SNAPSHOT)
aux_sort[i].FileOrder = P[i].FileOrder;
#endif /* #if defined(RECOMPUTE_POTENTIAL_IN_SNAPSHOT) */
......
......@@ -62,9 +62,6 @@ extern struct group_properties
MyDouble CM[3];
MyFloat Vel[3];
MyDouble Pos[3];
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
unsigned long long FuzzOffsetType[NTYPES];
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
MyDouble FirstPos[3];
#ifdef USE_SFR
......@@ -106,11 +103,7 @@ struct data_aux_sort
int TargetTask, TargetIndex;
int GrNr;
int Type;
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
peanokey key;
#else /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
MyIDType ID;
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP #else */
#if defined(RECOMPUTE_POTENTIAL_IN_SNAPSHOT)
MyIDType FileOrder;
#endif /* #if defined(RECOMPUTE_POTENTIAL_IN_SNAPSHOT) */
......
......@@ -37,9 +37,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
......@@ -52,9 +52,9 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
This diff is collapsed.
......@@ -63,10 +63,10 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../domain/domain.h"
#include "../gitversion/version.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../gitversion/version.h"
#include "../subfind/subfind.h"
#include "fof.h"
......@@ -601,10 +601,6 @@ void fof_subfind_fill_write_buffer(enum fof_subfind_iofields blocknr, int *start
ip = (int *)CommBuffer;
idp = (MyIDType *)CommBuffer;
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
unsigned long long *llp = (unsigned long long *)CommBuffer;
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
pindex = *startindex;
for(n = 0; n < pc; pindex++, n++)
......@@ -1120,10 +1116,6 @@ void fof_subfind_fill_write_buffer(enum fof_subfind_iofields blocknr, int *start
#endif /* #ifdef SUBFIND */
break;
case IO_FOF_FUZZOFFTYPE:
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
for(k = 0; k < NTYPES; k++)
*llp++ = Group[pindex].FuzzOffsetType[k];
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
break;
case IO_SUB_LEN:
#ifdef SUBFIND
......@@ -2520,9 +2512,6 @@ int fof_subfind_blockpresent(enum fof_subfind_iofields blocknr)
break;
case IO_FOF_FUZZOFFTYPE:
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
present = 1;
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
break;
case IO_FOF_M_MEAN200:
......
......@@ -48,9 +48,9 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
......@@ -64,9 +64,9 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......@@ -166,19 +166,11 @@ int fof_compare_aux_sort_GrNr(const void *a, const void *b)
return +1;
#endif /* #ifdef SUBFIND */
#if defined(FOF_FUZZ_SORT_BY_NEAREST_GROUP)
if(((struct data_aux_sort *)a)->key < ((struct data_aux_sort *)b)->key)
return -1;
if(((struct data_aux_sort *)a)->key > ((struct data_aux_sort *)b)->key)
return +1;
#else /* #if defined(FOF_FUZZ_SORT_BY_NEAREST_GROUP) */
if(((struct data_aux_sort *)a)->ID < ((struct data_aux_sort *)b)->ID)
return -1;
if(((struct data_aux_sort *)a)->ID > ((struct data_aux_sort *)b)->ID)
return +1;
#endif /* #if defined(FOF_FUZZ_SORT_BY_NEAREST_GROUP) #else */
return 0;
}
......
......@@ -40,9 +40,9 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
......@@ -73,9 +73,9 @@
#include <string.h>
#include <time.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
static int *th_list;
static unsigned char *level_list;
......
......@@ -41,10 +41,10 @@
#include <string.h>
#include <time.h>
#include "../domain/bsd_tree.h"
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/bsd_tree.h"
#include "../domain/domain.h"
/* \brief Structure of my tree nodes.
*/
......
......@@ -42,9 +42,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#ifdef EXTERNALGRAVITY
static void gravity_external_get_force(double pos[3], int type, MyIDType ID, double acc[3], double *pot, int *flag_set);
......
......@@ -39,9 +39,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
/*! \brief Sets the (comoving) softening length of all particle
* types in the table All.SofteningTable[...].
......
......@@ -43,9 +43,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#ifdef ALLOW_DIRECT_SUMMATION
static int Nimport;
......
......@@ -48,9 +48,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
static double ThreadsCosttotal[NUM_THREADS]; /*!< The total cost of the particles/nodes processed by each thread */
static int ThreadFirstExec[NUM_THREADS]; /*!< Keeps track, if a given thread executes the gravity_primary_loop() for the first time */
......
......@@ -49,9 +49,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#ifdef FORCETEST
......
......@@ -47,9 +47,9 @@
#include <sys/types.h>
#include <unistd.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
#ifdef HAVE_HDF5
......
......@@ -53,9 +53,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
static int density_evaluate(int target, int mode, int threadid);
......
......@@ -40,9 +40,9 @@
#include <stdlib.h>
#include <string.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
/*! \brief Prepares the loaded initial conditions for the run.
......
......@@ -74,10 +74,10 @@
#include <time.h>
#include <unistd.h>
#include "../fof/fof.h"
#include "../gitversion/version.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../fof/fof.h"
#include "../gitversion/version.h"
#include "../mesh/voronoi/voronoi.h"
#ifdef HAVE_HDF5
......
......@@ -753,11 +753,6 @@ void init_io_fields()
init_snapshot_type(IO_SUBFINDVELDISP, SN_NO_SUBBOX);
#endif /* #ifdef SAVE_HSML_IN_SNAPSHOT */
#if defined(FOF_FUZZ_SORT_BY_NEAREST_GROUP) && (FOF_FUZZ_SORT_BY_NEAREST_GROUP == 1)
init_field(IO_GROUPNR, "GROU", "GroupNr", MEM_INT, FILE_INT, FILE_NONE, 1, A_PS, &PS[0].GroupNr, 0, ALL_TYPES);
init_units(IO_GROUPNR, 0, 0, 0, 0, 0, 0);
#endif /* #if defined(FOF_FUZZ_SORT_BY_NEAREST_GROUP) && (FOF_FUZZ_SORT_BY_NEAREST_GROUP == 1) */
#if defined(REFINEMENT_HIGH_RES_GAS)
init_field(IO_HIGHRESMASS, "HRGM", "HighResGasMass", MEM_MY_FLOAT, FILE_MY_IO_FLOAT, FILE_NONE, 1, A_SPHP, &SphP[0].HighResMass, 0,
GAS_ONLY);
......
......@@ -71,10 +71,10 @@
#include <sys/types.h>
#include <unistd.h>
#include "../debug_md5/Md5.h"
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../debug_md5/Md5.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
#define MODUS_WRITE 0
......
......@@ -1306,9 +1306,6 @@ extern struct subfind_data
MyFloat SubfindVelDisp; /* 3D DM velocity dispersion */
#endif /* #ifdef SUBFIND_CALC_MORE */
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
int GroupNr;
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
#endif /* #ifdef SUBFIND */
} * PS;
......
......@@ -556,10 +556,6 @@ void special_particle_create_list();
void special_particle_update_list();
#endif /* #ifdef EXACT_GRAVITY_FOR_PARTICLE_TYPE */
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
void fof_assign_groups_to_fuzz(void);
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
#ifdef HAVE_HDF5
hid_t my_H5Fcreate(const char *fname, unsigned flags, hid_t fcpl_id, hid_t fapl_id);
......
......@@ -48,9 +48,9 @@
#include <string.h>
#include <unistd.h>
#include "../domain/domain.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
static void do_second_order_source_terms_first_half(void);
......
......@@ -36,6 +36,7 @@
* - 23.05.2018 Prepared file for public release -- Rainer Weinberger
*/
#include "../../main/allvars.h"
#include "../../main/proto.h"
......
......@@ -54,10 +54,10 @@
#include <string.h>
#include <time.h>
#include "../domain/domain.h"
#include "../gravity/forcetree.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../gravity/forcetree.h"
static void ngb_record_topnode_siblings(int no, int sib);
static int ngb_treebuild_construct(int npart);
......
......@@ -42,9 +42,10 @@
#include <stdlib.h>
#include <string.h>
#include "../gravity/forcetree.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../gravity/forcetree.h"
#ifdef USE_SFR
......
......@@ -43,9 +43,9 @@
#include <stdlib.h>
#include <string.h>
#include "../gravity/forcetree.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../gravity/forcetree.h"
#ifdef USE_SFR
......
......@@ -42,10 +42,10 @@
#include <sys/types.h>
#include <unistd.h>
#include "../domain/domain.h"
#include "../fof/fof.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../fof/fof.h"
#ifdef SUBFIND
#include "subfind.h"
......@@ -120,11 +120,6 @@ void subfind(int num)
else
PS[i].Utherm = 0;
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
for(i = 0; i < NumPart; i++)
PS[i].GroupNr = 0;
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
SubTreeAllocFactor = All.TreeAllocFactor;
/* Count, how many groups are above this limit, and how many processors we need for them */
......@@ -495,10 +490,6 @@ void subfind(int num)
if(PS[i].SubNr == TotNgroups + 1)
PS[i].BindingEnergy = 0;
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
fof_assign_groups_to_fuzz();
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
TIMER_STOP(CPU_SUBFIND);
TIMER_START(CPU_SNAPSHOT);
......
......@@ -40,9 +40,9 @@
#include <stdlib.h>
#include <string.h>
#include "../fof/fof.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../fof/fof.h"
#include "subfind.h"
#ifdef SUBFIND
......
......@@ -40,10 +40,10 @@
#include <sys/types.h>
#include <unistd.h>
#include "../domain/domain.h"
#include "../fof/fof.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../fof/fof.h"
#ifdef SUBFIND
#include "subfind.h"
......
......@@ -45,10 +45,10 @@
#include <string.h>
#include <time.h>
#include "../domain/domain.h"
#include "../gravity/forcetree.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../gravity/forcetree.h"
#include "subfind.h"
#ifdef SUBFIND
......
......@@ -218,10 +218,6 @@ void subfind_determine_sub_halo_properties(struct unbind_data *d, int num, struc
if(SubThisTask == mincpu)
{
mostboundid = P[minindex].ID;
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
if(subnr == 0)
PS[minindex].GroupNr = grnr + 1;
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
}
MPI_Bcast(&mostboundid, sizeof(mostboundid), MPI_BYTE, mincpu, SubComm);
......@@ -232,10 +228,6 @@ void subfind_determine_sub_halo_properties(struct unbind_data *d, int num, struc
terminate("minindex == -1");
mostboundid = P[minindex].ID;
#ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP
if(subnr == 0)
PS[minindex].GroupNr = grnr + 1;
#endif /* #ifdef FOF_FUZZ_SORT_BY_NEAREST_GROUP */
}
/* let's get bulk velocity and the center-of-mass */
......
......@@ -41,10 +41,10 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../domain/domain.h"
#include "../fof/fof.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../fof/fof.h"
#include "subfind.h"
#ifdef SUBFIND_EXTENDED_PROPERTIES
......
......@@ -69,10 +69,10 @@
#include <sys/types.h>
#include <unistd.h>
#include "../domain/domain.h"
#include "../fof/fof.h"
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../fof/fof.h"
#include "subfind.h"
#ifdef SUBFIND
......
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