|
MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
parallel FoF group finder More...
#include <mpi.h>#include <stdio.h>#include <stdlib.h>#include <stddef.h>#include <string.h>#include <math.h>#include <sys/stat.h>#include <sys/types.h>#include <gsl/gsl_math.h>#include <inttypes.h>#include <omp.h>#include "utils.h"#include "utils/mpsort.h"#include "walltime.h"#include "sfr_eff.h"#include "blackhole.h"#include "domain.h"#include "winds.h"#include "forcetree.h"#include "treewalk.h"#include "slotsmanager.h"#include "partmanager.h"#include "densitykernel.h"#include "fof.h"Go to the source code of this file.
Classes | |
| struct | FOFParams |
| struct | fof_particle_list |
| struct | TreeWalkQueryFOF |
| struct | TreeWalkResultFOF |
| struct | TreeWalkNgbIterFOF |
| struct | FOFPrimaryPriv |
| struct | FOFSecondaryPriv |
Macros | |
| #define | LARGE 1e29 |
| #define | MAXITER 400 |
| #define | FOF_PRIMARY_GET_PRIV(tw) ((struct FOFPrimaryPriv *) (tw->priv)) |
| #define | FOF_SECONDARY_GET_PRIV(tw) ((struct FOFSecondaryPriv *) (tw->priv)) |
Functions | |
| void | set_fof_params (ParameterSet *ps) |
| void | fof_init (double DMMeanSeparation) |
| static double | fof_periodic (double x, double BoxSize) |
| static double | fof_periodic_wrap (double x, double BoxSize) |
| static void | fof_label_secondary (struct fof_particle_list *HaloLabel, ForceTree *tree) |
| static int | fof_compare_HaloLabel_MinID (const void *a, const void *b) |
| static int | fof_compare_Group_MinIDTask (const void *a, const void *b) |
| static int | fof_compare_Group_OriginalIndex (const void *a, const void *b) |
| static int | fof_compare_Group_MinID (const void *a, const void *b) |
| static void | fof_reduce_groups (void *groups, int nmemb, size_t elsize, void(*reduce_group)(void *gdst, void *gsrc), MPI_Comm Comm) |
| static void | fof_finish_group_properties (FOFGroups *fof, double BoxSize) |
| static int | fof_compile_base (struct BaseGroup *base, int NgroupsExt, struct fof_particle_list *HaloLabel, MPI_Comm Comm) |
| static void | fof_compile_catalogue (FOFGroups *fof, const int NgroupsExt, struct fof_particle_list *HaloLabel, MPI_Comm Comm) |
| static struct Group * | fof_alloc_group (const struct BaseGroup *base, const int NgroupsExt) |
| static void | fof_assign_grnr (struct BaseGroup *base, const int NgroupsExt, MPI_Comm Comm) |
| void | fof_label_primary (struct fof_particle_list *HaloLabel, ForceTree *tree, MPI_Comm Comm) |
| FOFGroups | fof_fof (DomainDecomp *ddecomp, const int StoreGrNr, MPI_Comm Comm) |
| void | fof_finish (FOFGroups *fof) |
| static int | HEADl (int stop, int i, const int *const Head) |
| static void | update_root (int i, const int r, int *Head) |
| static int | HEAD (int i, const int *const Head) |
| static void | fof_primary_copy (int place, TreeWalkQueryFOF *I, TreeWalk *tw) |
| static int | fof_primary_haswork (int n, TreeWalk *tw) |
| static void | fof_primary_ngbiter (TreeWalkQueryFOF *I, TreeWalkResultFOF *O, TreeWalkNgbIterFOF *iter, LocalTreeWalk *lv) |
| static void | fofp_merge (int target, int other, TreeWalk *tw) |
| static void | fof_reduce_base_group (void *pdst, void *psrc) |
| static void | fof_reduce_group (void *pdst, void *psrc) |
| static void | add_particle_to_group (struct Group *gdst, int i, int ThisTask) |
| static void | fof_radix_Group_TotalCountTaskDiffMinID (const void *a, void *radix, void *arg) |
| static void | fof_radix_Group_OriginalTaskMinID (const void *a, void *radix, void *arg) |
| void | fof_save_groups (FOFGroups *fof, const char *OutputDir, const char *FOFFileBase, int num, Cosmology *CP, double atime, const double *MassTable, int MetalReturnOn, int BlackholeOn, MPI_Comm Comm) |
| static void | fof_secondary_copy (int place, TreeWalkQueryFOF *I, TreeWalk *tw) |
| static int | fof_secondary_haswork (int n, TreeWalk *tw) |
| static void | fof_secondary_reduce (int place, TreeWalkResultFOF *O, enum TreeWalkReduceMode mode, TreeWalk *tw) |
| static void | fof_secondary_ngbiter (TreeWalkQueryFOF *I, TreeWalkResultFOF *O, TreeWalkNgbIterFOF *iter, LocalTreeWalk *lv) |
| static void | fof_secondary_postprocess (int p, TreeWalk *tw) |
| static int | cmp_seed_task (const void *c1, const void *c2) |
| static void | fof_seed_make_one (struct Group *g, int ThisTask, const double atime) |
| void | fof_seed (FOFGroups *fof, ActiveParticles *act, double atime, MPI_Comm Comm) |
Variables | |
| struct FOFParams | fof_params |
| static int | _fof_compare_Group_MinIDTask_ThisTask |
| static MPI_Datatype | MPI_TYPE_GROUP |
parallel FoF group finder
Definition in file fof.c.
| #define FOF_PRIMARY_GET_PRIV | ( | tw | ) | ((struct FOFPrimaryPriv *) (tw->priv)) |
| #define FOF_SECONDARY_GET_PRIV | ( | tw | ) | ((struct FOFSecondaryPriv *) (tw->priv)) |
|
static |
Definition at line 634 of file fof.c.
References Group::base, Group::BH_Mass, Group::BH_Mdot, BHP, part_manager_type::BoxSize, Group::CM, crossproduct(), BaseGroup::FirstPos, fof_periodic(), Group::GasMetalElemMass, Group::GasMetalMass, Group::Imom, Group::Jmom, Group::Length, Group::LenType, Group::Mass, Group::MassHeIonized, Group::MassType, Group::MaxDens, NMETALS, P, PartManager, Group::seed_index, Group::seed_task, Group::Sfr, SPHP, STARP, Group::StellarMetalElemMass, Group::StellarMetalMass, ThisTask, Group::Vel, and winds_is_particle_decoupled().
Referenced by fof_compile_catalogue().
|
static |
Definition at line 1282 of file fof.c.
References Group::seed_task.
Referenced by fof_seed().
|
static |
Definition at line 819 of file fof.c.
References Group::base, and mymalloc2.
Referenced by fof_fof().
|
static |
Definition at line 1062 of file fof.c.
References fof_radix_Group_OriginalTaskMinID(), fof_radix_Group_TotalCountTaskDiffMinID(), BaseGroup::GrNr, BaseGroup::MinIDTask, MPI_INT64, mpsort_mpi, NTask, BaseGroup::OriginalTask, ta_free, ta_malloc, and ThisTask.
Referenced by fof_fof().
|
static |
Definition at line 1415 of file fof.c.
Referenced by fof_reduce_groups().
|
static |
Definition at line 1427 of file fof.c.
References _fof_compare_Group_MinIDTask_ThisTask, and BaseGroup::MinIDTask.
Referenced by fof_reduce_groups().
|
static |
Definition at line 1442 of file fof.c.
Referenced by fof_reduce_groups().
|
static |
|
static |
Definition at line 761 of file fof.c.
References Group::base, BaseGroup::FirstPos, fof_params, fof_reduce_base_group(), fof_reduce_groups(), FOFParams::FOFHaloMinLength, BaseGroup::Length, Group::Length, fof_particle_list::MinID, BaseGroup::MinID, fof_particle_list::MinIDTask, BaseGroup::MinIDTask, part_manager_type::NumPart, P, PartManager, and fof_particle_list::Pindex.
Referenced by fof_fof().
|
static |
Definition at line 835 of file fof.c.
References add_particle_to_group(), Group::base, part_manager_type::BoxSize, endrun(), fof_finish_group_properties(), fof_params, fof_reduce_group(), fof_reduce_groups(), FOFParams::FOFHaloMinLength, FOFGroups::Group, BaseGroup::Length, Group::Length, Group::Mass, message(), BaseGroup::MinID, BaseGroup::MinIDTask, MPI_INT64, FOFGroups::Ngroups, part_manager_type::NumPart, PartManager, fof_particle_list::Pindex, sumup_large_ints(), ThisTask, and FOFGroups::TotNgroups.
Referenced by fof_fof().
| void fof_finish | ( | FOFGroups * | fof | ) |
Definition at line 257 of file fof.c.
References FOFGroups::Group, message(), MPI_TYPE_GROUP, myfree, mymalloc_usedbytes, and walltime_measure.
Referenced by run(), runfof(), and test_fof().
|
static |
Definition at line 709 of file fof.c.
References Group::base, Group::CM, crossproduct(), BaseGroup::FirstPos, fof_periodic(), fof_periodic_wrap(), FOFGroups::Group, Group::Imom, Group::Jmom, Group::Mass, FOFGroups::Ngroups, and Group::Vel.
Referenced by fof_compile_catalogue().
| FOFGroups fof_fof | ( | DomainDecomp * | ddecomp, |
| const int | StoreGrNr, | ||
| MPI_Comm | Comm | ||
| ) |
Definition at line 151 of file fof.c.
References fof_alloc_group(), fof_assign_grnr(), fof_compare_HaloLabel_MinID(), fof_compile_base(), fof_compile_catalogue(), fof_label_primary(), fof_label_secondary(), fof_params, FOFParams::FOFHaloComovingLinkingLength, FOFParams::FOFPrimaryLinkTypes, force_tree_free(), force_tree_rebuild_mask(), BaseGroup::GrNr, FOFGroups::Group, message(), fof_particle_list::MinID, BaseGroup::MinID, MPI_TYPE_GROUP, MPIU_Barrier, myfree, mymalloc, mymalloc_usedbytes, part_manager_type::NumPart, P, PartManager, fof_particle_list::Pindex, qsort_openmp, and walltime_measure.
Referenced by run(), runfof(), and test_fof().
| void fof_init | ( | double | DMMeanSeparation | ) |
Definition at line 66 of file fof.c.
References fof_params, FOFParams::FOFHaloComovingLinkingLength, and FOFParams::FOFHaloLinkingLength.
Referenced by init().
| void fof_label_primary | ( | struct fof_particle_list * | HaloLabel, |
| ForceTree * | tree, | ||
| MPI_Comm | Comm | ||
| ) |
Definition at line 369 of file fof.c.
References TreeWalk::ev_label, TreeWalk::fill, fof_primary_copy(), FOF_PRIMARY_GET_PRIV, fof_primary_haswork(), fof_primary_ngbiter(), free_spinlocks(), FOFPrimaryPriv::HaloLabel, TreeWalk::haswork, FOFPrimaryPriv::Head, HEAD(), init_spinlocks(), lock_spinlock(), message(), fof_particle_list::MinID, fof_particle_list::MinIDTask, MPI_INT64, myfree, mymalloc, mymalloc_usedbytes, TreeWalk::ngbiter, TreeWalk::ngbiter_type_elsize, part_manager_type::NumPart, FOFPrimaryPriv::OldMinID, P, PartManager, FOFPrimaryPriv::PrimaryActive, TreeWalk::priv, TreeWalk::query_type_elsize, TreeWalk::reduce, TreeWalk::result_type_elsize, second(), FOFPrimaryPriv::spin, spin, ThisTask, TreeWalk::tree, TREEWALK_ALL, treewalk_run(), treewalk_visit_ngbiter(), TreeWalk::type, unlock_spinlock(), and TreeWalk::visit.
Referenced by fof_fof().
|
static |
Definition at line 1207 of file fof.c.
References FOFSecondaryPriv::distance, endrun(), TreeWalk::ev_label, TreeWalk::fill, fof_params, fof_secondary_copy(), FOF_SECONDARY_GET_PRIV, fof_secondary_haswork(), fof_secondary_ngbiter(), fof_secondary_postprocess(), fof_secondary_reduce(), FOFParams::FOFHaloComovingLinkingLength, FOFSecondaryPriv::HaloLabel, TreeWalk::haswork, FOFSecondaryPriv::hsml, LARGE, MAXITER, message(), myfree, mymalloc, mymalloc_usedbytes, TreeWalk::ngbiter, TreeWalk::ngbiter_type_elsize, TreeWalk::Niteration, FOFSecondaryPriv::npleft, part_manager_type::NumPart, P, PartManager, TreeWalk::postprocess, TreeWalk::priv, TreeWalk::query_type_elsize, TreeWalk::reduce, TreeWalk::result_type_elsize, sumup_large_ints(), ta_free, ta_malloc, TreeWalk::tree, TREEWALK_ALL, treewalk_run(), treewalk_visit_nolist_ngbiter(), TreeWalk::type, and TreeWalk::visit.
Referenced by fof_fof().
|
static |
Definition at line 71 of file fof.c.
Referenced by add_particle_to_group(), and fof_finish_group_properties().
|
static |
Definition at line 81 of file fof.c.
Referenced by fof_finish_group_properties().
|
static |
Definition at line 342 of file fof.c.
References TreeWalkQueryFOF::base, ForceTree::firstnode, FOF_PRIMARY_GET_PRIV, HEAD(), TreeWalkQueryFOF::MinID, TreeWalkQueryFOF::MinIDTask, TreeWalkQueryBase::NodeList, and TreeWalk::tree.
Referenced by fof_label_primary().
|
static |
Definition at line 357 of file fof.c.
References fof_params, FOF_PRIMARY_GET_PRIV, FOFParams::FOFPrimaryLinkTypes, and P.
Referenced by fof_label_primary().
|
static |
Definition at line 546 of file fof.c.
References TreeWalkNgbIterFOF::base, fof_params, FOF_PRIMARY_GET_PRIV, FOFParams::FOFHaloComovingLinkingLength, fofp_merge(), FOFParams::FOFPrimaryLinkTypes, HEAD(), TreeWalkNgbIterBase::Hsml, lock_spinlock(), TreeWalkNgbIterBase::mask, fof_particle_list::MinID, TreeWalkQueryFOF::MinID, fof_particle_list::MinIDTask, TreeWalkQueryFOF::MinIDTask, LocalTreeWalk::mode, NGB_TREEFIND_ASYMMETRIC, TreeWalkNgbIterBase::other, spin, TreeWalkNgbIterBase::symmetric, LocalTreeWalk::target, LocalTreeWalk::tw, and unlock_spinlock().
Referenced by fof_label_primary().
|
static |
Definition at line 1456 of file fof.c.
References BaseGroup::MinID, and BaseGroup::OriginalTask.
Referenced by fof_assign_grnr().
|
static |
Definition at line 1448 of file fof.c.
References BaseGroup::Length, BaseGroup::MinID, BaseGroup::MinIDTask, and BaseGroup::OriginalTask.
Referenced by fof_assign_grnr().
|
static |
Definition at line 584 of file fof.c.
References BaseGroup::Length.
Referenced by fof_compile_base().
|
static |
Definition at line 591 of file fof.c.
References Group::BH_Mass, Group::BH_Mdot, Group::CM, Group::GasMetalElemMass, Group::GasMetalMass, Group::Imom, Group::Jmom, Group::Length, Group::LenType, Group::Mass, Group::MassHeIonized, Group::MassType, Group::MaxDens, NMETALS, Group::seed_index, Group::seed_task, Group::Sfr, Group::StellarMetalElemMass, Group::StellarMetalMass, and Group::Vel.
Referenced by fof_compile_catalogue().
|
static |
Definition at line 907 of file fof.c.
References _fof_compare_Group_MinIDTask_ThisTask, endrun(), fof_compare_Group_MinID(), fof_compare_Group_MinIDTask(), fof_compare_Group_OriginalIndex(), BaseGroup::MinID, BaseGroup::MinIDTask, MPI_Alltoallv_smart(), myfree, mymalloc, NTask, BaseGroup::OriginalIndex, qsort_openmp, ta_free, ta_malloc, and ThisTask.
Referenced by fof_compile_base(), and fof_compile_catalogue().
| void fof_save_groups | ( | FOFGroups * | fof, |
| const char * | OutputDir, | ||
| const char * | FOFFileBase, | ||
| int | num, | ||
| Cosmology * | CP, | ||
| double | atime, | ||
| const double * | MassTable, | ||
| int | MetalReturnOn, | ||
| int | BlackholeOn, | ||
| MPI_Comm | Comm | ||
| ) |
Definition at line 1113 of file fof.c.
References CP, fof_params, fof_save_particles(), and FOFParams::FOFSaveParticles.
Referenced by run(), and runfof().
|
static |
Definition at line 1128 of file fof.c.
References FOF_SECONDARY_GET_PRIV, TreeWalkQueryFOF::Hsml, TreeWalkQueryFOF::MinID, and TreeWalkQueryFOF::MinIDTask.
Referenced by fof_label_secondary().
|
static |
Definition at line 1135 of file fof.c.
References fof_params, FOF_SECONDARY_GET_PRIV, FOFParams::FOFSecondaryLinkTypes, LARGE, and P.
Referenced by fof_label_secondary().
|
static |
Definition at line 1153 of file fof.c.
References TreeWalkNgbIterFOF::base, TreeWalkResultFOF::Distance, fof_params, FOF_SECONDARY_GET_PRIV, FOFParams::FOFPrimaryLinkTypes, TreeWalkQueryFOF::Hsml, TreeWalkNgbIterBase::Hsml, LARGE, TreeWalkNgbIterBase::mask, TreeWalkQueryFOF::MinID, TreeWalkResultFOF::MinID, TreeWalkQueryFOF::MinIDTask, TreeWalkResultFOF::MinIDTask, NGB_TREEFIND_ASYMMETRIC, TreeWalkNgbIterBase::other, TreeWalkNgbIterBase::r, TreeWalkNgbIterBase::symmetric, and LocalTreeWalk::tw.
Referenced by fof_label_secondary().
|
static |
Definition at line 1181 of file fof.c.
References fof_params, FOF_SECONDARY_GET_PRIV, FOFParams::FOFHaloComovingLinkingLength, and LARGE.
Referenced by fof_label_secondary().
|
static |
Definition at line 1143 of file fof.c.
References TreeWalkResultFOF::Distance, FOF_SECONDARY_GET_PRIV, LARGE, TreeWalkResultFOF::MinID, and TreeWalkResultFOF::MinIDTask.
Referenced by fof_label_secondary().
| void fof_seed | ( | FOFGroups * | fof, |
| ActiveParticles * | act, | ||
| double | atime, | ||
| MPI_Comm | Comm | ||
| ) |
Definition at line 1290 of file fof.c.
References ActiveParticles::ActiveParticle, cmp_seed_task(), fof_params, fof_seed_make_one(), FOFGroups::Group, slots_manager_type::info, Group::LenType, Group::Mass, Group::MassType, part_manager_type::MaxPart, slot_info::maxsize, message(), FOFParams::MinFoFMassForNewSeed, FOFParams::MinMStarForNewSeed, MPI_Alltoallv_smart(), MPI_TYPE_GROUP, myfree, mymalloc, mymalloc2, FOFGroups::Ngroups, NTask, ActiveParticles::NumActiveParticle, part_manager_type::NumPart, PartManager, qsort_openmp, Group::seed_index, Group::seed_task, slot_info::size, slots_reserve(), SlotsManager, ta_free, ta_malloc, ThisTask, and walltime_measure.
Referenced by run().
|
static |
Definition at line 1396 of file fof.c.
References blackhole_make_one(), endrun(), Group::seed_index, Group::seed_task, and ThisTask.
Referenced by fof_seed().
|
static |
Definition at line 483 of file fof.c.
References FOF_PRIMARY_GET_PRIV, FOFPrimaryPriv::Head, HEADl(), lock_spinlock(), fof_particle_list::MinID, fof_particle_list::MinIDTask, spin, unlock_spinlock(), and update_root().
Referenced by fof_primary_ngbiter().
|
static |
Definition at line 333 of file fof.c.
Referenced by fof_label_primary(), fof_primary_copy(), and fof_primary_ngbiter().
|
static |
Definition at line 291 of file fof.c.
Referenced by fofp_merge().
| void set_fof_params | ( | ParameterSet * | ps | ) |
Definition at line 50 of file fof.c.
References fof_params, FOFParams::FOFHaloLinkingLength, FOFParams::FOFHaloMinLength, FOFParams::FOFPrimaryLinkTypes, FOFParams::FOFSaveParticles, FOFParams::FOFSecondaryLinkTypes, FOFParams::MinFoFMassForNewSeed, FOFParams::MinMStarForNewSeed, param_get_double(), param_get_int(), and ThisTask.
Referenced by read_parameter_file().
|
static |
Definition at line 314 of file fof.c.
Referenced by fofp_merge().
|
static |
Definition at line 99 of file fof.c.
Referenced by fof_compare_Group_MinIDTask(), and fof_reduce_groups().
| struct FOFParams fof_params |
|
static |
Definition at line 142 of file fof.c.
Referenced by fof_finish(), fof_fof(), and fof_seed().