Skip to content
Snippets Groups Projects
Commit dc311347 authored by Volker Springel's avatar Volker Springel
Browse files

import of sources

parent f3ce7bea
Branches
No related tags found
No related merge requests found
Showing
with 1133 additions and 0 deletions
---
Language: Cpp
BasedOnStyle: Google
BreakBeforeBraces: GNU
SpaceBeforeParens: Never
AllowShortLoopsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AlignConsecutiveAssignments: true
ColumnLimit: 135
ReflowComments: true
SortUsingDeclarations: true
...
#eclipse stuff
.cproject
.dep/
.project
.settings/
.pydevproject
#OS
.gdb_history
.DS_Store
#binaries
build
Arepo
Arepo.dSYM
Tenet
Tenet.dSYM
Gadget4
Gadget4.dSYM
.build*/
*.o
*.check
/extlibs
doxygen
WARNINGS
processes_*.txt
*~
*.o*
*.e*
*\#
*.sh
#potentially large files
*.h5
*.hdf5
*.dat
*.bin
#media files
*.mp4
*.png
*.eps
*.jpg
*.jpeg
*.pdf
*.out
*.aux
*.toc
*.log
#Config files
/Config.sh
/Makefile.systype
/param.txt
/parameter.txt
/Run1.tex
/param.tex
/param.param
/*.param
#Output folders
/tests
/out
/**/output*/
balance.txt
cpu.txt
info.txt
domain.txt
memory.txt
timebins.txt
timings.txt
energy.txt
cpu.csv
*-usedvalues
**/restartfiles/
# special files in test directory
tests/Aquarius/Aq-A-2-cont/Tree-PM-O3/*.txt
tests/ICs
# symbolic links in repository
tests/MilliMillHyper/output
tests/MilliMillHyper/output_tree
tests/EuclidTest/G4_TreePM/output
site/
Makefile 0 → 100644
#/*******************************************************************************
# * \copyright This file is part of the GADGET4 N-body/SPH code developed
# * \copyright by Volker Springel. Copyright (C) 2014, 2015 by Volker Springel
# * \copyright (volker.springel@h-its.org) and all contributing authors.
# *******************************************************************************/
#
# You might be looking for the compile-time Makefile options of the
# code if you are familiar with Gadget2...
#
# They have moved to a separate file.
#
# To build the code, do the following:
#
# (1) Copy the file "Template-Config.sh" to "Config.sh"
#
# cp Template-Config.sh Config.sh
#
# (2) Edit "Config.sh" as needed for your application
#
# (3) Run "make"
#
#
# New compile-time options should be added to the
# file "Template-Config.sh" only. Usually, they should be added
# there in the disabled/default version.
#
# "Config.sh" should not be checked in to the repository.
#
# Note: It is possible to override the default name of the
# Config.sh file, if desired, as well as the name of the
# executable. For example:
#
# make CONFIG=MyNewConf.sh EXEC=Gadget4_new
#
#-----------------------------------------------------------------
#
# You might also be looking for the target system SYSTYPE option
#
# It has also moved to a separate file.
#
# To build the code, do the following:
#
# (A) set the SYSTYPE variable in your .bashrc (or similar file):
#
# e.g. export SYSTYPE=Magny
# or
#
# (B) set SYSTYPE in Makefile.systype
# This file has priority over your shell variable:
#
# (1) Copy the file "Template-Makefile.systype" to "Makefile.systype"
#
# cp Template-Makefile.systype Makefile.systype
#
# (2) Uncomment your system in "Makefile.systype".
#
# For the chosen system type, an if-clause should be defined below,
# loading short definitions of library path names and/or compiler
# names and options from the buildsystem/ directory. A new system
# type should also be added to Template-Makefile.systype
#
ifdef DIR
EXEC = $(DIR)/Gadget4
CONFIG = $(DIR)/Config.sh
BUILD_DIR = $(DIR)/build
else
EXEC = Gadget4
CONFIG = Config.sh
BUILD_DIR = build
endif
SRC_DIR = src
###################
#determine SYSTYPE#
###################
ifdef SYSTYPE
SYSTYPE := "$(SYSTYPE)"
-include Makefile.systype
else
include Makefile.systype
endif
$(info Build configuration:)
$(info SYSTYPE: $(SYSTYPE))
$(info CONFIG: $(CONFIG))
$(info EXEC: $(EXEC))
$(info )
PYTHON = /usr/bin/python
RESULT := $(shell CONFIG=$(CONFIG) PYTHON=$(PYTHON) BUILD_DIR=$(BUILD_DIR) SRC_DIR=$(SRC_DIR) CURDIR=$(CURDIR) make -f buildsystem/Makefile.config)
$(info $(RESULT))
CONFIGVARS := $(shell cat $(BUILD_DIR)/gadgetconfig.h)
RESULT := $(shell SRC_DIR=$(SRC_DIR) BUILD_DIR=$(BUILD_DIR) ./buildsystem/git_version.sh)
##########################
#define available Systems#
##########################
ifeq ($(SYSTYPE),"Generic-gcc")
include buildsystem/Makefile.gen.libs
include buildsystem/Makefile.comp.gcc
endif
ifeq ($(SYSTYPE),"Generic-intel")
include buildsystem/Makefile.comp.gcc-paranoia
include buildsystem/Makefile.gen.libs
endif
ifeq ($(SYSTYPE),"SuperMUC-NG")
include buildsystem/Makefile.comp.supermuc-ng
include buildsystem/Makefile.path.supermuc-ng
endif
ifeq ($(SYSTYPE),"SuperMUC-NG-OpenMPI")
include buildsystem/Makefile.comp.supermuc-ng-openmpi
include buildsystem/Makefile.path.supermuc-ng
endif
ifeq ($(SYSTYPE),"SuperMUC-NG-GCC")
include buildsystem/Makefile.comp.supermuc-ng-gcc
include buildsystem/Makefile.path.supermuc-ng-gcc
endif
ifeq ($(SYSTYPE), "Generic-gcc-single")
include buildsystem/Makefile.comp.gcc
include buildsystem/Makefile.gen.singlelibs
endif
ifeq ($(SYSTYPE), "Generic-intel-single")
include buildsystem/Makefile.comp.gcc-paranoia
include buildsystem/Makefile.gen.singlelibs
endif
ifeq ($(SYSTYPE),"Darwin")
include buildsystem/Makefile.comp.gcc
include buildsystem/Makefile.path.macports
endif
ifeq ($(SYSTYPE),"Magny")
include buildsystem/Makefile.comp.gcc
include buildsystem/Makefile.path.magny
endif
ifeq ($(SYSTYPE),"Freya")
include buildsystem/Makefile.comp.freya
include buildsystem/Makefile.path.freya
endif
#module load gcc/7.2 gsl/2.2 hdf5-serial/gcc/1.8.18 fftw/gcc/3.3.6
ifeq ($(SYSTYPE),"FreyaOpenMPI")
include buildsystem/Makefile.comp.freyaopenmpi
include buildsystem/Makefile.path.freya
endif
ifeq ($(SYSTYPE),"Cobra")
include buildsystem/Makefile.comp.cobra
include buildsystem/Makefile.path.cobra
endif
ifeq ($(SYSTYPE),"RavenOpenMPI")
include buildsystem/Makefile.comp.ravenopenmpi
include buildsystem/Makefile.path.cobra
endif
ifeq ($(SYSTYPE),"CobraOpenMPI")
include buildsystem/Makefile.comp.cobraopenmpi
include buildsystem/Makefile.path.cobra
endif
ifeq ($(SYSTYPE),"Haswell")
include buildsystem/Makefile.comp.gcc
include buildsystem/Makefile.path.haswell
endif
ifeq ($(SYSTYPE),"gcc-paranoia")
include buildsystem/Makefile.comp.gcc-paranoia
include buildsystem/Makefile.path.mpa_desktop
endif
ifeq ($(SYSTYPE),"libs")
include buildsystem/makefile.comp.gcc
include buildsystem/Makefile.path.libs
endif
ifeq ($(SYSTYPE),"hydra")
include buildsystem/Makefile.comp.gcc
include buildsystem/Makefile.path.hydra
endif
ifeq ($(SYSTYPE),"bwforcluster")
include buildsystem/Makefile.comp.gcc
include buildsystem/Makefile.path.bwforcluster
endif
ifndef LINKER
LINKER = $(CPP)
endif
##########################################
#determine the needed object/header files#
##########################################
SUBDIRS += .
SUBDIRS += main
OBJS += main/begrun.o main/init.o main/main.o main/run.o
INCL += main/main.h main/simulation.h
SUBDIRS += data
OBJS += data/mymalloc.o data/allvars.o data/test_symtensors.o
INCL += data/allvars.h data/dtypes.h data/mymalloc.h data/idstorage.h data/symtensors.h \
data/intposconvert.h data/constants.h data/simparticles.h \
data/macros.h data/particle_data.h data/sph_particle_data.h \
data/lightcone_particle_data.h data/lightcone_massmap_data.h data/lcparticles.h data/mmparticles.h
SUBDIRS += domain
OBJS += domain/domain.o domain/domain_balance.o domain/domain_box.o \
domain/domain_exchange.o domain/domain_toplevel.o
INCL += domain/domain.h
SUBDIRS += io
OBJS += io/hdf5_util.o io/snap_io.o io/parameters.o \
io/restart.o io/io.o io/test_io_bandwidth.o
INCL += io/io.h io/hdf5_util.h io/snap_io.h io/parameters.h \
io/restart.h io/io_streamcount.h io/test_io_bandwidth.h
SUBDIRS += logs
OBJS += logs/logs.o
INCL += logs/logs.h logs/timer.h
SUBDIRS += gitversion
INCL += gitversion/version.h
SUBDIRS += mpi_utils
OBJS += mpi_utils/hypercube_allgatherv.o mpi_utils/mpi_types.o mpi_utils/mpi_vars.o mpi_utils/sums_and_minmax.o \
mpi_utils/sizelimited_sendrecv.o mpi_utils/myalltoall.o mpi_utils/allreduce_sparse_double_sum.o mpi_utils/healthtest.o \
mpi_utils/allreduce_debugcheck.o mpi_utils/shared_mem_handler.o
INCL += mpi_utils/mpi_utils.h mpi_utils/generic_comm.h mpi_utils/shared_mem_handler.h
SUBDIRS += pm
OBJS += pm/pm_nonperiodic.o pm/pm_periodic.o \
pm/pm_mpi_fft.o
INCL += pm/pm.h pm/pm_mpi_fft.h pm/pm_periodic.h pm/pm_nonperiodic.h
SUBDIRS += vectorclass
OBJS += vectorclass/instrset_detect.o
INCL +=
SUBDIRS += sort
OBJS += sort/peano.o
INCL += sort/peano.h sort/cxxsort.h sort/parallel_sort.h
SUBDIRS += sph
OBJS += sph/density.o sph/hydra.o sph/init_entropy.o sph/artificial_viscosity.o
INCL += sph/kernel.h sph/sph.h
SUBDIRS += system
OBJS += system/pinning.o system/system.o
INCL += system/system.h system/pinning.h
SUBDIRS += time_integration
OBJS += time_integration/driftfac.o time_integration/kicks.o \
time_integration/predict.o time_integration/timestep.o \
time_integration/timestep_treebased.o
INCL += time_integration/timestep.h time_integration/driftfac.h
SUBDIRS += gravity
OBJS += gravity/gravity.o gravity/ewald.o gravity/ewald_test.o \
gravity/grav_forcetest.o \
gravity/grav_direct.o gravity/second_order_ics.o
INCL += gravity/ewald.h gravity/ewaldtensors.h gravity/grav_forcetest.h
SUBDIRS += tree
OBJS += tree/tree.o
INCL += tree/tree.h
SUBDIRS += gravtree
OBJS += gravtree/gravtree_build.o gravtree/gravtree.o gravtree/gwalk.o
INCL += gravtree/gravtree.h gravtree/gwalk.h
SUBDIRS += ngbtree
OBJS += ngbtree/ngbtree_build.o
INCL += ngbtree/ngbtree.h
ifeq (COOLING,$(findstring COOLING,$(CONFIGVARS)))
OBJS += cooling_sfr/cooling.o cooling_sfr/sfr_eos.o cooling_sfr/starformation.o
INCL += cooling_sfr/cooling.h
SUBDIRS += cooling_sfr
endif
ifeq (FOF,$(findstring FOF,$(CONFIGVARS)))
OBJS += fof/fof.o fof/fof_findgroups.o fof/fof_nearest.o fof/fof_io.o fof/foftree_build.o
INCL += fof/fof.h fof/fof_io.h fof/foftree.h
SUBDIRS += fof
endif
ifeq (SUBFIND,$(findstring SUBFIND,$(CONFIGVARS)))
OBJS += subfind/subfind.o subfind/subfind_treepotential.o \
subfind/subfind_processing.o subfind/subfind_density.o subfind/subfind_distribute.o subfind/subfind_findlinkngb.o \
subfind/subfind_nearesttwo.o subfind/subfind_properties.o subfind/subfind_unbind.o subfind/subfind_history.o \
subfind/subfind_so.o subfind/subfind_readid_io.o subfind/subfind_orphanids.o subfind/subfind_excursionset.o
INCL += subfind/subfind.h subfind/subfind_readid_io.h
SUBDIRS += subfind
endif
ifeq (FMM,$(findstring FMM,$(CONFIGVARS)))
SUBDIRS += fmm
OBJS += fmm/fmm.o
INCL += fmm/fmm.h
endif
ifeq (MERGERTREE,$(findstring MERGERTREE,$(CONFIGVARS)))
OBJS += mergertree/descendant.o mergertree/io_descendant.o mergertree/io_progenitors.o \
mergertree/postproc_descendants.o mergertree/io_readsnap.o mergertree/halotrees.o \
mergertree/io_halotrees.o mergertree/io_treelinks.o mergertree/io_readtrees_mbound.o \
mergertree/rearrange.o
INCL += mergertree/mergertree.h mergertree/io_descendant.h mergertree/io_progenitors.h \
mergertree/io_readsnap.h mergertree/io_treelinks.h mergertree/io_halotrees.h \
mergertree/io_readtrees_mbound.h
SUBDIRS += mergertree
endif
ifeq (LIGHTCONE,$(findstring LIGHTCONE,$(CONFIGVARS)))
SUBDIRS += lightcone
OBJS += lightcone/lightcone.o lightcone/lightcone_particle_io.o lightcone/lightcone_massmap_io.o
INCL += lightcone/lightcone.h lightcone/lightcone_particle_io.h lightcone/lightcone_massmap_io.h
endif
ifeq (LIGHTCONE_MASSMAPS,$(findstring LIGHTCONE_MASSMAPS,$(CONFIGVARS)))
MAPS_LIBS += -lchealpix -lcfitsio #-lcurl
endif
ifeq (LIGHTCONE_PARTICLES,$(findstring LIGHTCONE_PARTICLES,$(CONFIGVARS)))
MAPS_LIBS += -lchealpix -lcfitsio #-lcurl
endif
ifeq (NGENIC,$(findstring NGENIC,$(CONFIGVARS)))
OBJS += ngenic/ngenic.o ngenic/power.o ngenic/grid.o
INCL += ngenic/ngenic.h
SUBDIRS += ngenic
endif
ifeq (DEBUG_MD5,$(findstring DEBUG_MD5,$(CONFIGVARS)))
SUBDIRS += debug_md5
OBJS += debug_md5/calc_checksum.o debug_md5/Md5.o
INCL += debug_md5/Md5.h
endif
################################
#determine the needed libraries#
################################
# we only need fftw if PMGRID is turned on
ifeq (PMGRID, $(findstring PMGRID, $(CONFIGVARS)))
ifeq (DOUBLEPRECISION_FFTW,$(findstring DOUBLEPRECISION_FFTW,$(CONFIGVARS))) # test for double precision libraries
FFTW_LIBS += -lfftw3
else
FFTW_LIBS += -lfftw3f
endif
else
ifeq (NGENIC, $(findstring NGENIC, $(CONFIGVARS)))
ifeq (DOUBLEPRECISION_FFTW,$(findstring DOUBLEPRECISION_FFTW,$(CONFIGVARS))) # test for double precision libraries
FFTW_LIBS += -lfftw3
else
FFTW_LIBS += -lfftw3f
endif
else
endif
endif
ifeq (FORCETEST, $(findstring FORCETEST, $(CONFIGVARS)))
FFTW_LIBS += -lfftw3
endif
HWLOC_LIBS += -lhwloc
ifneq (IMPOSE_PINNING,$(findstring IMPOSE_PINNING,$(CONFIGVARS)))
HWLOC_INCL =
HWLOC_LIBS =
endif
ifneq (VTUNE_INSTRUMENT,$(findstring VTUNE_INSTRUMENT,$(CONFIGVARS)))
VTUNE_INCL =
VTUNE_LIBS =
endif
GSL_LIBS += -lgsl -lgslcblas
HDF5_LIBS += -lhdf5 -lz
MATH_LIBS = -lm
MAKEFILES = $(MAKEFILE_LIST) buildsystem/Makefile.config
##########################
#combine compiler options#
##########################
CFLAGS = $(OPTIMIZE) $(OPT) $(HDF5_INCL) $(GSL_INCL) $(FFTW_INCL) $(HWLOC_INCL) $(VTUNE_INCL) $(MAPS_INCL) -I$(BUILD_DIR) -I$(SRC_DIR)
LIBS = $(MATH_LIBS) $(HDF5_LIBS) $(GSL_LIBS) $(FFTW_LIBS) $(HWLOC_LIBS) $(VTUNE_LIBS) $(TEST_LIBS) $(MAPS_LIBS)
SUBDIRS := $(addprefix $(BUILD_DIR)/,$(SUBDIRS))
OBJS := $(addprefix $(BUILD_DIR)/,$(OBJS)) $(BUILD_DIR)/compile_time_info.o $(BUILD_DIR)/compile_time_info_hdf5.o $(BUILD_DIR)/version.o
INCL := $(addprefix $(SRC_DIR)/,$(INCL)) $(BUILD_DIR)/gadgetconfig.h
TO_CHECK := $(addsuffix .check, $(OBJS) $(patsubst $(SRC_DIR)%, $(BUILD_DIR)%, $(INCL)) )
TO_CHECK += $(BUILD_DIR)/Makefile.check
CONFIG_CHECK = $(BUILD_DIR)/$(notdir $(CONFIG)).check
DOCS_CHECK = $(BUILD_DIR)/config.check $(BUILD_DIR)/param.check
################
#create subdirs#
################
RESULT := $(shell mkdir -p $(SUBDIRS) )
###########################################
#create info file for command line options#
###########################################
RESULT := $(shell echo 'static const char *compiler_flags="$(CPP) $(CFLAGS)";' > $(BUILD_DIR)/compiler-command-line-args.h )
#############
#build rules#
#############
all: check_docs check build
build: $(EXEC)
$(EXEC): $(OBJS)
$(LINKER) $(OPTIMIZE) $(OBJS) $(LIBS) -o $(EXEC)
clean:
rm -f $(OBJS) $(EXEC)
rm -f $(BUILD_DIR)/compile_time_info.cc $(BUILD_DIR)/compile_time_info_hdf5.cc $(BUILD_DIR)/gadgetconfig.h
rm -f $(TO_CHECK) $(CONFIG_CHECK)
rm -f $(BUILD_DIR)/version.cc
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp $(INCL) $(MAKEFILES)
$(CPP) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cc $(INCL) $(MAKEFILES)
$(CPP) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/compile_time_info.o: $(BUILD_DIR)/compile_time_info.cc $(MAKEFILES)
$(CPP) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/compile_time_info_hdf5.o: $(BUILD_DIR)/compile_time_info_hdf5.cc $(MAKEFILES)
$(CPP) $(CFLAGS) -c $< -o $@
check: $(CONFIG_CHECK)
check_docs: $(DOCS_CHECK)
$(CONFIG_CHECK): $(TO_CHECK) $(CONFIG) buildsystem/check.py
@$(PYTHON) buildsystem/check.py 2 $(CONFIG) $(CONFIG_CHECK) defines_extra $(TO_CHECK)
$(BUILD_DIR)/%.o.check: $(SRC_DIR)/%.cpp Template-Config.sh defines_extra buildsystem/check.py
@$(PYTHON) buildsystem/check.py 1 $< $@ Template-Config.sh defines_extra
$(BUILD_DIR)/%.o.check: $(SRC_DIR)/%.cc Template-Config.sh defines_extra buildsystem/check.py
@$(PYTHON) buildsystem/check.py 1 $< $@ Template-Config.sh defines_extra
$(BUILD_DIR)/%.h.check: $(SRC_DIR)/%.h Template-Config.sh defines_extra buildsystem/check.py
@$(PYTHON) buildsystem/check.py 1 $< $@ Template-Config.sh defines_extra
$(BUILD_DIR)/%.o.check: $(BUILD_DIR)/%.cc Template-Config.sh defines_extra buildsystem/check.py
@$(PYTHON) buildsystem/check.py 1 $< $@ Template-Config.sh defines_extra
$(BUILD_DIR)/%.h.check: $(BUILD_DIR)/%.h Template-Config.sh defines_extra buildsystem/check.py
@$(PYTHON) buildsystem/check.py 1 $< $@ Template-Config.sh defines_extra
$(BUILD_DIR)/Makefile.check: Makefile Template-Config.sh defines_extra buildsystem/check.py
@$(PYTHON) buildsystem/check.py 3 $< $@ Template-Config.sh defines_extra
$(BUILD_DIR)/config.check: documentation/04_config-options.md Template-Config.sh buildsystem/check.py
@$(PYTHON) buildsystem/check.py 4 Template-Config.sh $@ $<
$(BUILD_DIR)/param.check: documentation/05_parameterfile.md $(SRC_DIR)/io/parameters.cc buildsystem/check.py
@$(PYTHON) buildsystem/check.py 5 $(SRC_DIR)/data/allvars.cc $@ $<
.PHONY = all check build clean
##################################################
# Enable/Disable compile-time options as needed #
##################################################
#----------------------------------------Parallelization options
IMPOSE_PINNING
#IMPOSE_PINNING_OVERRIDE_MODE
#EXPLICIT_VECTORIZATION # This uses AVX at selected places through the vectorclass C++ library
#PRESERVE_SHMEM_BINARY_INVARIANCE
#SIMPLE_DOMAIN_AGGREGATION
#--------------------------------------- Basic operation mode of code
PERIODIC
#TWODIMS
#ONEDIMS
#LONG_X_BITS=2
#LONG_Y_BITS=2
#LONG_Z_BITS=1
#NTYPES=6 # Number of particle types. Note that this may only be changed from the default value of 6 if
# HDF5 snapshot files are used.
#GADGET2_HEADER # allows reading in of Gadget2/3 snapshots by using this code's header format for snaphot file formats 1 and 2
#SECOND_ORDER_LPT_ICS # treats second order LPT ICs generated with Adrian Jenkin's code
#LEAN # selects a special 'lean' mode of code operation, which is optimized for extreme memory saving
#--------------------------------------- Gravity calculation
SELFGRAVITY # switch on for self-gravity
HIERARCHICAL_GRAVITY
#FMM # enables FMM tree algorithm
ALLOW_DIRECT_SUMMATION # allows calculation of small number of particles with direct summation
#EXTERNALGRAVITY # switch on for external potential
#EVALPOTENTIAL # computes gravitational potential
#EXTRAPOTTERM # if this is set, the extra multipole term needed in principle for the potential is computed even though it does not enter the force
#EXTRA_HIGH_EWALD_ACCURACY # if this is activate, a third order Taylor expansion is used for the Ewald corrections
#MULTIPOLE_ORDER=2 # enables in tree and/or FMM for a value of 2 monopoles+dipoles (this is default), 3 gives quadrupoles, 4 octupoles, and 5 hexadecupoles
#RANDOMIZE_DOMAINCENTER
#--------------------------------------- TreePM Options
PMGRID=512
#ASMTH=1.25
#RCUT=6.0
#NTAB=128 # size of short-range look-up table
#TREEPM_NOTIMESPLIT # if this is activated, long-range and short-range gravity are time-integrated on a single timestep
#PLACEHIGHRESREGION=2
#HRPMGRID=512 # High-res PM grid size (optional, default is HRPMGRID=PMGRID)
#FFT_COLUMN_BASED
#PM_ZOOM_OPTIMIZED
#GRAVITY_TALLBOX=2 # this can be used to set-up gravity with two-dimensional boxes
#TREE_NUM_BEFORE_NODESPLIT=10 # Optional number that tells how many particles are allowed in a tree node before it is split
#--------------------------------------- Treatment of gravitational softening
#INDIVIDUAL_GRAVITY_SOFTENING=4+8+16+32
#NSOFTCLASSES=4 # Number of different softening values. Normally equal to number of particle types, but can be chosen differently if DECOUPLE_TYPE_AND_SOFTTYPE is set.
#ADAPTIVE_HYDRO_SOFTENING
#--------------------------------------- SPH treatmeant and formulation
#PRESSURE_ENTROPY_SPH # enables the Hopkins 2013 pressure-entropy formulation
#OUTPUT_PRESSURE_SPH_DENSITY # output also density computed in the pressure-entropy forumulation
#GAMMA=1.4
#ISOTHERM_EQS
#REUSE_HYDRO_ACCELERATIONS_FROM_PREVIOUS_STEP
IMPROVED_VELOCITY_GRADIENTS # use higher-order gradients of the velocity according to Hu et. al (2014)
VISCOSITY_LIMITER_FOR_LARGE_TIMESTEPS #limits the acceleration due to the viscosity
#--------------------------------------- SPH kernels
CUBIC_SPLINE_KERNEL # uses the cubic spline kernel
#WENDLAND_C2_KERNEL # the Wendland C2 kernel from Dehnen & Aly 2012
#WENDLAND_C4_KERNEL # the Wendland C4 kernel from Dehnen & Aly 2012
#WENDLAND_C6_KERNEL # the Wendland C6 kernel from Dehnen & Aly 2012
WENDLAND_BIAS_CORRECTION # reduces self-contribution for Wendland kernels according to Dehnen & Aly 2012
#--------------------------------------- SPH viscosity options
#TIMEDEP_ART_VISC # Enables time dependend viscosity
#HIGH_ART_VISC_START # Start with high rather than low viscosity
#NO_SHEAR_VISCOSITY_LIMITER # Turns of the shear viscosity supression
OUTPUT_VISCOSITY_PARAMETER
#--------------------------------------- Extra physics
#COOLING
#STARFORMATION
#--------------------------------------- Time integration options
#FORCE_EQUAL_TIMESTEPS # this chooses a variable but global timestep
#---------------------------------------- Single/double precision and data types
POSITIONS_IN_32BIT # if set, use 32-integers for positions
POSITIONS_IN_64BIT # if set, use 64-integers for positions
POSITIONS_IN_128BIT # if set, use 128-integers for positions
DOUBLEPRECISION=1
DOUBLEPRECISION_FFTW
#OUTPUT_IN_DOUBLEPRECISION # output files will be written in double precision
#ENLARGE_DYNAMIC_RANGE_IN_TIME # This extends the dynamic range of the integer timeline from 32 to 64 bit
#IDS_32BIT # Selects 32-bit IDs for internal storage (default)
#IDS_48BIT # Selects 48-bit IDs for internal storage
#IDS_64BIT # Selects 64-bit IDs for internal storage
#USE_SINGLEPRECISION_INTERNALLY # reduces default double precision for most internal computations to single precision
#---------------------------------------- Output/Input options
#REDUCE_FLUSH
#OUTPUT_VELOCITY_GRADIENT
#OUTPUT_PRESSURE
#OUTPUT_ENTROPY
#OUTPUT_CHANGEOFENTROPY
#OUTPUT_POTENTIAL
#OUTPUT_ACCELERATION
#OUTPUT_TIMESTEP
#OUTPUT_DIVVEL # output velocity divergence
#OUTPUT_CURLVEL # output velocity curl
#OUTPUT_COOLHEAT # output actual energy loss/gain in cooling/heating routine
#POWERSPEC_ON_OUTPUT
#OUTPUT_NON_SYNCHRONIZED_ALLOWED
#OUTPUT_VELOCITIES_IN_HALF_PRECISION
#OUTPUT_ACCELERATIONS_IN_HALF_PRECISION
#OUTPUT_COORDINATES_AS_INTEGERS
#ALLOW_HDF5_COMPRESSION
#---------------------------------------- On the fly FOF groupfinder
#FOF # enable FoF output
#FOF_PRIMARY_LINK_TYPES=2 # 2^type for the primary dark matter type
#FOF_SECONDARY_LINK_TYPES=1+16+32 # 2^type for the types linked to nearest primaries
##FOF_GROUP_MIN_LEN=32 # default is 32
##FOF_LINKLENGTH=0.16 # Linkinglength for FoF (default=0.2)
#FOF_ALLOW_HUGE_GROUPLENGTH # if this is set, groups and subhalos may have more than 2 billion particles in length
#---------------------------------------- Subfind
SUBFIND # enables substructure finder
#SUBFIND_STORE_LOCAL_DENSITY # will calculate local densities and velocity dispersions for *all* particles
# selected by FOF primary and seconday link types (not only for particles in gropus),
# and store them in snapshots
#SUBFIND_ORPHAN_TREATMENT # creates special snapshots with formerly most bound particles
#SUBFIND_HBT # use previous subhalo catalogue instead of density excursions to define subhalo candidates
#---------------------------------------- Merger tree code
MERGERTREE # enables on-the-fly calculation of descendants, and merger tree construction from group catalogues
#---------------------------------------- On-the-fly lightcone creation
#LIGHTCONE
#LIGHTCONE_PARTICLES
#LIGHTCONE_MASSMAPS
#LIGHTCONE_PARTICLES_GROUPS
#LIGHTCONE_OUTPUT_ACCELERATIONS
#LIGHTCONE_IMAGE_COMP_HSML_VELDISP
#REARRANGE_OPTION
#--------------------------------------- IC generation
#NGENIC=256 # generate cosmological ICs, set NGENIC to the FFT grid size used for IC generation
#CREATE_GRID # start with a regular cartesian DM particle grid, instead of reading a glass file (for NGENIC)
#GENERATE_GAS_IN_ICS # add SPH particles to dark matter only ICs
#SPLIT_PARTICLE_TYPE=4+8 # particle types to be split if GENERATE_GAS_IN_ICS is activated
#NGENIC_FIX_MODE_AMPLITUDES # when activated, this leaves the mode amplitudes at sqrt(P(k)), instead of sampling from a Rayleigh distribution
#NGENIC_MIRROR_PHASES # if this is activated, all phases are turned by 180 degrees
#NGENIC_2LPT # applies 2LPT instead of just Zeldovich
#NGENIC_TEST # can be used to create ICs, measure the power spectrum, and then stop
#---------------------------------------- MPI related settings
#ISEND_IRECV_IN_DOMAIN
#USE_MPIALLTOALLV_IN_DOMAINDECOMP
#MPI_HYPERCUBE_ALLGATHERV # some MPI-libraries may use quite a bit of internal storage for MPI_Allgatherv. This uses hypercubes instead as a work-around
#MPI_MESSAGE_SIZELIMIT_IN_MB=200
#NUMPART_PER_TASK_LARGE # Set this if the number of particle per task is very large (so that more than 2GB data is comprised just by the particle data)
#MAX_NUMBER_OF_RANKS_WITH_SHARED_MEMORY=64
#NUMBER_OF_MPI_LISTENERS_PER_NODE=1
#---------------------------------------- Testing and Debugging options
DEBUG # enables core-dumps
#DEBUG_ENABLE_FPU_EXCEPTIONS # tries to enable FPU exceptions
#DEBUG_SYMTENSORS # carries out a few unit tests related to the tensor algebra routines of the code
HOST_MEMORY_REPORTING # reports after start-up the available system memory by analyzing /proc/meminfo
#FORCETEST=0.001 # calculates for given fraction of particles direct summation forces to check accuracy of tree force
#FORCETEST_FIXEDPARTICLESET # if this set, always the same particle receive a force accuracy check during a run
#FORCETEST_TESTFORCELAW=1 # Special option for measuring the effective force law, can be set to 1 or 2 for TreePM+HighRes
#VTUNE_INSTRUMENT
#DEBUG_MD5 # make MD5 check sum routines available for debugging
#SQUASH_TEST
#DOMAIN_SPECIAL_CHECK
#RECREATE_UNIQUE_IDS # Before carrying out the ID uniqueness test, this sets new IDs. Can be used if IC files contain broken IDs.
#NO_STOP_BELOW_MINTIMESTEP # do not stop when the code wants to go below minimum timestep
#TILING=2 # duplicated an IC in each dimension
#DO_NOT_PRODUCE_BIG_OUTPUT # for scaling tests, one may disable the writing of restart files and snapshot dumps
#MEASURE_TOTAL_MOMENTUM
#ENABLE_HEALTHTEST
#EWALD_TEST # a development test for the Ewald tables
#STOP_AFTER_STEP=10 # ends a simulation after the specified timestep (to simplify scalability tests)
#TREE_NO_SAFETY_BOX # when set, this disables the geometric 'near node' protection
#---------------------------------------- Postprocessing options
#LGALAXIES # Semi-analytic L-Galaxies code
# Select Target Computer
#
# Please copy this file to Makefile.systype and uncomment your
# system. Don't commit changes to this file unless you add support for
# a new system.
#SYSTYPE="Generic-gcc"
#SYSTYPE="Generic-intel"
#SYSTYPE="Generic-gcc-single"
#SYSTYPE="Generic-intel-single"
#SYSTYPE="Darwin"
#SYSTYPE="Magny"
#SYSTYPE="gcc-paranoia"
#SYSTYPE="libs"
#SYSTYPE="hydra"
#SYSTYPE="bwforcluster"
CPP = mpiicpc -std=c++11 # sets the C++-compiler
OPTIMIZE = -ggdb -O3 -march=native -Wall -Wno-format-security
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx2 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -fopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CPP = /u/vrs/Libs/openmpi-4.0.4/bin/mpicxx -std=c++11 # sets the C++-Compiler
OPTIMIZE = -ggdb -O3 -Wall -Wno-format-security
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx2 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -qopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CPP = mpiicpc -std=c++11 # sets the C++-compiler
OPTIMIZE = -ggdb -O3 -march=native -Wall -Wno-format-security
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx2 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -fopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CPP = /freya/u/vrs/Libs/openmpi-4.0.1/bin/mpicxx -std=c++11 # sets the C++-compiler
OPTIMIZE = -ggdb -O3 -march=native -Wall -Wno-format-security
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx2 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -fopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CPP = mpicxx -std=c++11 # sets the C++-compiler
OPTIMIZE = -ggdb -O3 -march=native -Wall -Wno-format-security # -Wdouble-promotion # -Wconversion
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx -fabi-version=0 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -fopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CPP = mpicxx -std=c++11 -Wwrite-strings -Wredundant-decls -Woverloaded-virtual -Wcast-qual -Wcast-align -Wpointer-arith -Wmissing-declarations # sets the C++-compiler
OPTIMIZE = -g -Wall -W -O3 -march=native
# -fopenmp
# -DDISABLE_MEMORY_MANAGER
# -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,--print-gc-sections -Wl,--demangle
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -fopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CPP = /u/vrs/Libs/openmpi-4.0.5/bin/mpicxx -std=c++11 # sets the C++-Compiler
OPTIMIZE = -ggdb -O3 -Wall -Wno-format-security
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx2 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -qopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CC = mpiicc -std=c11 # sets the C-compiler
CPP = mpiicpc -std=c++11 # sets the C++-compiler
OPTIMIZE = -ggdb -O3 -march=native -Wall -Wno-format-security
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx2 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -fopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CC = mpicc -std=c11 # sets the C-compiler
CPP = mpicxx -std=c++11 # sets the C++-compiler
OPTIMIZE = -ggdb -O3 -march=native -Wall -Wno-format-security
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx2 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -fopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
CC = mpicc -std=c11 # sets the C-compiler
CPP = mpicxx -std=c++11 # sets the C++-compiler
OPTIMIZE = -ggdb -O3 -march=native -Wall -Wno-format-security
ifeq (EXPLICIT_VECTORIZATION,$(findstring EXPLICIT_VECTORIZATION,$(CONFIGVARS)))
CFLAGS_VECTOR += -mavx2 # enables generation of AVX instructions (used through vectorclass)
CPV = $(CPP)
else
CFLAGS_VECTOR =
CPV = $(CPP)
endif
ifeq (NUM_THREADS,$(findstring NUM_THREADS,$(CONFIGVARS)))
OPTIMIZE += -fopenmp
else
OPTIMIZE += -Wno-unknown-pragmas
endif
#/*******************************************************************************
# * \copyright This file is part of the GADGET4 N-body/SPH code developed
# * \copyright by Volker Springel. Copyright (C) 2014, 2015 by Volker Springel
# * \copyright (volker.springel@h-its.org) and all contributing authors.
# *******************************************************************************/
RESULT := $(shell mkdir -p $(BUILD_DIR) )
all: $(BUILD_DIR)/gadgetconfig.h
$(BUILD_DIR)/gadgetconfig.h: $(CONFIG) buildsystem/config.py
$(PYTHON) buildsystem/config.py $(CONFIG) $(BUILD_DIR) $(CURDIR) $(SRC_DIR)
GSL_INCL = -I$(LIB_DIR)/gsl/build/include
GSL_LIBS = -L$(LIB_DIR)/gsl/build/lib
FFTW_INCL = -I$(LIB_DIR)/fftw3/build/include
FFTW_LIBS = -L$(LIB_DIR)/fftw3/build/lib
HDF5_INCL = -I$(LIB_DIR)/hdf5/build/include
HDF5_LIBS = -L$(LIB_DIR)/hdf5/build/lib
HWLOC_INCL = -I$(LIB_DIR)/hwloc/build/include
HWLOC_LIBS = -L$(LIB_DIR)/hwloc/build/lib
LIB_DIR=extlibs
FFTW_VERSION=3.3.4
GSL_VERSION=1.16
HDF5_VERSION=1.8.15-patch1
HWLOC_VERSION=1.8.6
libs: gsl fftw-single fftw-double hdf5 hwloc
SHELL=/bin/bash
$(LIB_DIR):
mkdir $(LIB_DIR)
fftw-single: $(LIB_DIR)/include/sfftw.h
fftw-double: $(LIB_DIR)/include/dfftw.h
$(LIB_DIR)/fftw-$(FFTW_VERSION).tar.gz: | $(LIB_DIR)
cd $(LIB_DIR); wget http://www.fftw.org/fftw-$(FFTW_VERSION).tar.gz
$(LIB_DIR)/fftw-$(FFTW_VERSION)/: $(LIB_DIR)/fftw-$(FFTW_VERSION).tar.gz
cd $(LIB_DIR); tar -xf fftw-$(FFTW_VERSION).tar.gz
$(LIB_DIR)/include/sfftw.h: | $(LIB_DIR)/fftw-$(FFTW_VERSION)/
cd $(LIB_DIR)/fftw-$(FFTW_VERSION); export LD_LIBRARY_PATH=$(LIB_DIR)/lib; ./configure --prefix=$(CURDIR)/$(LIB_DIR)/ --enable-float; make; make install
$(LIB_DIR)/include/dfftw.h: | $(LIB_DIR)/fftw-$(FFTW_VERSION)/
cd $(LIB_DIR)/fftw-$(FFTW_VERSION); export LD_LIBRARY_PATH=$(LIB_DIR)/lib; ./configure --prefix=$(CURDIR)/$(LIB_DIR)/ ; make; make install
gsl: $(LIB_DIR)/include/gsl/
$(LIB_DIR)/gsl-$(GSL_VERSION).tar.gz: | $(LIB_DIR)
cd $(LIB_DIR); wget http://ftpmirror.gnu.org/gsl/gsl-$(GSL_VERSION).tar.gz
$(LIB_DIR)/gsl-$(GSL_VERSION)/: $(LIB_DIR)/gsl-$(GSL_VERSION).tar.gz
cd $(LIB_DIR); tar -xf gsl-$(GSL_VERSION).tar.gz
$(LIB_DIR)/include/gsl/: | $(LIB_DIR)/gsl-$(GSL_VERSION)/
cd $(LIB_DIR)/gsl-$(GSL_VERSION);export LD_LIBRARY_PATH=$(LIB_DIR)/lib; ./configure --prefix=$(CURDIR)/$(LIB_DIR)/; make; make install
hwloc: $(LIB_DIR)/include/hwloc.h
$(LIB_DIR)/hwloc-$(HWLOC_VERSION).tar.gz: | $(LIB_DIR)
cd $(LIB_DIR); wget http://www.open-mpi.de/software/hwloc/v1.8/downloads/hwloc-$(HWLOC_VERSION).tar.gz
$(LIB_DIR)/hwloc-$(HWLOC_VERSION)/: $(LIB_DIR)/hwloc-$(HWLOC_VERSION).tar.gz
cd $(LIB_DIR); tar -xf hwloc-$(HWLOC_VERSION).tar.gz
$(LIB_DIR)/include/hwloc.h: | $(LIB_DIR)/hwloc-$(HWLOC_VERSION)/
cd $(LIB_DIR)/hwloc-$(HWLOC_VERSION); ./configure --prefix=$(CURDIR)/$(LIB_DIR)/; make; make install
hdf5: $(LIB_DIR)/include/hdf5.h
$(LIB_DIR)/hdf5-$(HDF5_VERSION).tar.gz: | $(LIB_DIR)
cd $(LIB_DIR); wget ftp://ftp.hdfgroup.org/HDF5/current/src/hdf5-$(HDF5_VERSION).tar.gz
$(LIB_DIR)/hdf5-$(HDF5_VERSION): $(LIB_DIR)/hdf5-$(HDF5_VERSION).tar.gz
cd $(LIB_DIR); tar -xf hdf5-$(HDF5_VERSION).tar.gz
$(LIB_DIR)/include/hdf5.h: | $(LIB_DIR)/hdf5-$(HDF5_VERSION)
/bin/bash -c 'cd $(LIB_DIR)/hdf5-$(HDF5_VERSION); export LD_LIBRARY_PATH=$(LIB_DIR)/lib; ./configure --prefix=$(CURDIR)/$(LIB_DIR)/ --enable-parallel; make; make install'
.PHONY = gsl fftw-single fftw-double hdf5 hwloc
GSL_INCL = -I/home/hd/hd_hd/hd_mm002/libraries/include
GSL_LIBS = -L/home/hd/hd_hd/hd_mm002/libraries/lib -Xlinker -R -Xlinker /home/hd/hd_hd/hd_mm002/libraries/lib
FFTW_INCL = -I/home/hd/hd_hd/hd_mm002/libraries/include
FFTW_LIBS = -L/home/hd/hd_hd/hd_mm002/libraries/lib -Xlinker -R -Xlinker /home/hd/hd_hd/hd_mm002/libraries/lib
HDF5_INCL = -I/home/hd/hd_hd/hd_mm002/libraries/include
HDF5_LIBS = -L/home/hd/hd_hd/hd_mm002/libraries/lib -Xlinker -R -Xlinker /home/hd/hd_hd/hd_mm002/libraries/lib
HWLOC_INCL = -I/home/hd/hd_hd/hd_mm002/libraries/include
HWLOC_LIBS = -L/home/hd/hd_hd/hd_mm002/libraries/lib -Xlinker -R -Xlinker /home/hd/hd_hd/hd_mm002/libraries/lib
MAPS_INCL = -I/home/hd/hd_hd/hd_bd123/Libs/include
MAPS_LIBS = -L/home/hd/hd_hd/hd_bd123/Libs/lib
GSL_INCL = -I$(GSL_HOME)/include
GSL_LIBS = -L$(GSL_HOME)/lib -Xlinker -R -Xlinker $(GSL_HOME)/lib
FFTW_INCL = -I$(FFTW_HOME)/include
FFTW_LIBS = -L$(FFTW_HOME)/lib -Xlinker -R -Xlinker $(FFTW_HOME)/lib
HDF5_INCL = -I$(HDF5_HOME)/include
HDF5_LIBS = -L$(HDF5_HOME)/lib -Xlinker -R -Xlinker $(HDF5_HOME)/lib
HWLOC_INCL =
HWLOC_LIBS =
MAPS_INCL = -I/u/vrs/Libs/include
MAPS_LIBS = -L/u/vrs/Libs/lib -Xlinker -R -Xlinker /u/vrs/Libs/lib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment