MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
Go to the source code of this file.
Classes | |
struct | NodeChild |
struct | NODE |
struct | ForceTree |
Macros | |
#define | NMAXCHILD 8 |
#define | PARTICLE_NODE_TYPE 0 |
#define | NODE_NODE_TYPE 1 |
#define | PSEUDO_NODE_TYPE 2 |
#define | ALLMASK (1<<30)-1 |
#define | GASMASK (1) |
#define | DMMASK (2) |
#define | STARMASK (1<<4) |
#define | BHMASK (1<<5) |
Typedefs | |
typedef struct ForceTree | ForceTree |
Functions | |
void | init_forcetree_params (const int FastParticleType) |
int | force_tree_allocated (const ForceTree *tt) |
void | force_update_hmax (int *activeset, int size, ForceTree *tt, DomainDecomp *ddecomp) |
void | force_tree_rebuild (ForceTree *tree, DomainDecomp *ddecomp, const int HybridNuGrav, const int DoMoments, const char *EmergencyOutputDir) |
void | force_tree_rebuild_mask (ForceTree *tree, DomainDecomp *ddecomp, int mask, const int HybridNuGrav, const char *EmergencyOutputDir) |
void | force_tree_free (ForceTree *tt) |
void | dump_particles (void) |
static int | node_is_pseudo_particle (int no, const ForceTree *tree) |
static int | node_is_particle (int no, const ForceTree *tree) |
static int | node_is_node (int no, const ForceTree *tree) |
int | force_get_father (int no, const ForceTree *tt) |
int | force_tree_create_nodes (const ForceTree tb, const int npart, int mask, DomainDecomp *ddecomp, const int HybridNuGrav) |
ForceTree | force_treeallocate (int64_t maxnodes, int64_t maxpart, DomainDecomp *ddecomp) |
void | force_update_node_parallel (const ForceTree *tree, const DomainDecomp *ddecomp) |
#define ALLMASK (1<<30)-1 |
Definition at line 20 of file forcetree.h.
#define BHMASK (1<<5) |
Definition at line 24 of file forcetree.h.
#define DMMASK (2) |
Definition at line 22 of file forcetree.h.
#define GASMASK (1) |
Definition at line 21 of file forcetree.h.
#define NMAXCHILD 8 |
Definition at line 12 of file forcetree.h.
#define NODE_NODE_TYPE 1 |
Definition at line 16 of file forcetree.h.
#define PARTICLE_NODE_TYPE 0 |
Definition at line 15 of file forcetree.h.
#define PSEUDO_NODE_TYPE 2 |
Definition at line 17 of file forcetree.h.
#define STARMASK (1<<4) |
Definition at line 23 of file forcetree.h.
void dump_particles | ( | void | ) |
int force_get_father | ( | int | no, |
const ForceTree * | tt | ||
) |
Definition at line 905 of file forcetree.c.
References NODE::father, ForceTree::Father, ForceTree::firstnode, and ForceTree::Nodes.
Referenced by _prepare(), check_moments(), check_tree(), effhsml(), force_tree_eh_slots_fork(), ngb_treefind_threads(), set_init_hsml(), and setup_smoothinglengths().
int force_tree_allocated | ( | const ForceTree * | tt | ) |
Definition at line 134 of file forcetree.c.
References ForceTree::tree_allocated_flag.
Referenced by _prepare(), force_tree_free(), force_tree_rebuild(), force_tree_rebuild_mask(), sfr_reserve_slots(), and treewalk_run().
int force_tree_create_nodes | ( | const ForceTree | tb, |
const int | npart, | ||
int | mask, | ||
DomainDecomp * | ddecomp, | ||
const int | HybridNuGrav | ||
) |
Does initial creation of the nodes for the gravitational oct-tree. mask is a bitfield: Only types whose bit is set are added.
Definition at line 661 of file forcetree.c.
References add_particle_to_tree(), part_manager_type::BoxSize, NODE::center, NODE::ChildType, NODE::cofm, NODE::DependsOnLocalMass, domain_get_topleaf(), slot_info::enabled, task_data::EndLeaf, endrun(), NODE::f, NODE::father, ForceTree::firstnode, force_create_node_for_topnode(), NODE::hmax, slots_manager_type::info, inside_node(), NODE::InternalTopLevel, ForceTree::lastnode, NODE::len, NODE::mass, merge_partial_force_trees(), NODE::mom, NMAXCHILD, NodeCache::nnext_thread, NodeChild::noccupied, NODECACHE_SIZE, ForceTree::Nodes, NodeCache::nrem_thread, part_manager_type::NumPart, P, PARTICLE_NODE_TYPE, PartManager, NODE::s, NODE::sibling, slot_info::size, SlotsManager, task_data::StartLeaf, NodeChild::suns, ta_free, ta_malloc, DomainDecomp::Tasks, ThisTask, DomainDecomp::TopLeaves, NODE::TopLevel, topleaf_data::treenode, NodeChild::Types, and NODE::unused.
Referenced by do_tree_test(), and force_tree_build().
void force_tree_free | ( | ForceTree * | tree | ) |
This function frees the memory allocated for the tree, i.e. it frees the space allocated by the function force_treeallocate().
Definition at line 1409 of file forcetree.c.
References event_unlisten(), EventSlotsFork, ForceTree::Father, force_tree_allocated(), force_tree_eh_slots_fork(), myfree, ForceTree::Nodes_base, and ForceTree::tree_allocated_flag.
Referenced by _prepare(), do_density_test(), do_force_test(), fof_fof(), force_tree_build(), force_tree_rebuild(), force_tree_rebuild_mask(), metal_return(), run(), run_gravity_test(), runfof(), runpower(), setup_smoothinglengths(), test_rebuild_close(), test_rebuild_flat(), test_rebuild_random(), and turn_on_quasars().
void force_tree_rebuild | ( | ForceTree * | tree, |
DomainDecomp * | ddecomp, | ||
const int | HybridNuGrav, | ||
const int | DoMoments, | ||
const char * | EmergencyOutputDir | ||
) |
Definition at line 140 of file forcetree.c.
References ALLMASK, event_listen(), EventSlotsFork, ForceTree::firstnode, force_tree_allocated(), force_tree_build(), force_tree_eh_slots_fork(), force_tree_free(), ForceTree::lastnode, message(), ForceTree::moments_computed_flag, MPIU_Barrier, mymalloc_usedbytes, ForceTree::NTopLeaves, ForceTree::numnodes, part_manager_type::NumPart, PartManager, and walltime_measure.
Referenced by do_density_test(), do_force_test(), run(), run_gravity_test(), runfof(), runpower(), and setup_smoothinglengths().
void force_tree_rebuild_mask | ( | ForceTree * | tree, |
DomainDecomp * | ddecomp, | ||
int | mask, | ||
const int | HybridNuGrav, | ||
const char * | EmergencyOutputDir | ||
) |
Definition at line 161 of file forcetree.c.
References ForceTree::firstnode, force_tree_allocated(), force_tree_build(), force_tree_free(), ForceTree::lastnode, message(), MPIU_Barrier, ForceTree::NTopLeaves, ForceTree::numnodes, part_manager_type::NumPart, PartManager, and walltime_measure.
Referenced by fof_fof(), metal_return(), and turn_on_quasars().
ForceTree force_treeallocate | ( | int64_t | maxnodes, |
int64_t | maxpart, | ||
DomainDecomp * | ddecomp | ||
) |
This function allocates the memory used for storage of the tree and of auxiliary arrays needed for tree-walk and link-lists. Usually, maxnodes approximately equal to 0.7*maxpart is sufficient to store the tree for up to maxpart particles.
Definition at line 1381 of file forcetree.c.
References endrun(), ForceTree::Father, ForceTree::firstnode, ForceTree::lastnode, mymalloc, ForceTree::nfather, ForceTree::Nodes, ForceTree::Nodes_base, DomainDecomp::NTopLeaves, ForceTree::NTopLeaves, ForceTree::numnodes, DomainDecomp::TopLeaves, ForceTree::TopLeaves, and ForceTree::tree_allocated_flag.
Referenced by force_tree_build(), test_rebuild_close(), test_rebuild_flat(), and test_rebuild_random().
void force_update_hmax | ( | int * | activeset, |
int | size, | ||
ForceTree * | tree, | ||
DomainDecomp * | ddecomp | ||
) |
This function updates the hmax-values in tree nodes that hold SPH particles. Since the Hsml-values are potentially changed for active particles in the SPH-density computation, force_update_hmax() should be carried out just before the hydrodynamical SPH forces are computed, i.e. after density().
The purpose of the hmax node is for a symmetric treewalk (currently only the hydro). Particles where P[i].Pos + Hsml pokes beyond the exterior of the tree node may mean that a tree node should be included when it would normally be culled. Therefore we don't really want hmax, we want the maximum amount P[i].Pos + Hsml pokes beyond the tree node.
Definition at line 1271 of file forcetree.c.
References NODE::center, DMAX, task_data::EndLeaf, NODE::father, ForceTree::Father, NODE::hmax, ForceTree::hmax_computed_flag, NODE::len, NODE::mom, myfree, mymalloc, ForceTree::Nodes, NTask, DomainDecomp::NTopLeaves, part_manager_type::NumPart, P, PartManager, task_data::StartLeaf, DomainDecomp::Tasks, ThisTask, DomainDecomp::TopLeaves, topleaf_data::treenode, and walltime_measure.
Referenced by run().
void force_update_node_parallel | ( | const ForceTree * | tree, |
const DomainDecomp * | ddecomp | ||
) |
This routine determines the multipole moments for a given internal node and all its subnodes in parallel, assigning the recursive algorithm to different threads using openmp's task api. The result is stored in tb.Nodes in the sequence of this tree-walk.
Definition at line 1081 of file forcetree.c.
References NODE::ChildType, endrun(), NODE::f, force_update_node_recursive(), force_update_particle_node(), NODE_NODE_TYPE, ForceTree::Nodes, PARTICLE_NODE_TYPE, PSEUDO_NODE_TYPE, NODE::sibling, task_data::StartLeaf, DomainDecomp::Tasks, ThisTask, DomainDecomp::TopLeaves, and topleaf_data::treenode.
Referenced by do_tree_test(), and force_tree_build().
void init_forcetree_params | ( | const int | FastParticleType | ) |
Definition at line 43 of file forcetree.c.
References forcetree_params::FastParticleType, ForceTreeParams, and forcetree_params::TreeAllocFactor.
Referenced by begrun(), setup_density(), setup_tree(), and test_fof().
|
inlinestatic |
Definition at line 145 of file forcetree.h.
References ForceTree::firstnode, and ForceTree::numnodes.
|
inlinestatic |
Definition at line 139 of file forcetree.h.
References ForceTree::firstnode.
Referenced by ngb_treefind_threads().
|
inlinestatic |
Definition at line 133 of file forcetree.h.
References ForceTree::lastnode.
Referenced by ngb_treefind_threads().