MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
Go to the source code of this file.
Macros | |
#define | SLOTS_ENABLED(ptype, sman) (sman->info[ptype].enabled) |
#define | GARBAGE(i, ptype, pman, sman) (sman ? BASESLOT_PI(i,ptype, sman)->ReverseLink > pman->MaxPart : pman->Base[i].IsGarbage) |
#define | PART(i, ptype, pman, sman) (sman ? (void *) BASESLOT_PI(i, ptype, sman) : (void *) &pman->Base[i]) |
Functions | |
static int | slots_gc_base (struct part_manager_type *pman) |
static int | slots_gc_slots (int *compact_slots, struct part_manager_type *pman, struct slots_manager_type *sman) |
static void | slots_connect_new_slot (int i, int pi, int type, struct part_manager_type *pman, struct slots_manager_type *sman) |
int | slots_convert (int parent, int ptype, int placement, struct part_manager_type *pman, struct slots_manager_type *sman) |
int | slots_split_particle (int parent, double childmass, struct part_manager_type *pman) |
int | slots_gc (int *compact_slots, struct part_manager_type *pman, struct slots_manager_type *sman) |
static int | slots_find_next_garbage (int start, int used, int ptype, struct part_manager_type *pman, struct slots_manager_type *sman) |
static int | slots_find_next_nongarbage (int start, int used, int ptype, struct part_manager_type *pman, struct slots_manager_type *sman) |
static int | slots_gc_compact (const int used, int ptype, struct part_manager_type *pman, struct slots_manager_type *sman) |
static int | slot_cmp_reverse_link (const void *b1in, const void *b2in) |
static int | slots_gc_mark (const struct part_manager_type *pman, const struct slots_manager_type *sman) |
static int | slots_gc_sweep (int ptype, struct part_manager_type *pman, struct slots_manager_type *sman) |
static void | slots_gc_collect (int ptype, struct part_manager_type *pman, struct slots_manager_type *sman) |
static int | order_by_type_and_key (const void *a, const void *b) |
int | slots_get_last_garbage (int nfirst, int nlast, int ptype, const struct part_manager_type *pman, const struct slots_manager_type *sman) |
void | slots_gc_sorted (struct part_manager_type *pman, struct slots_manager_type *sman) |
size_t | slots_reserve (int where, int64_t atleast[6], struct slots_manager_type *sman) |
void | slots_init (double increase, struct slots_manager_type *sman) |
void | slots_set_enabled (int ptype, size_t elsize, struct slots_manager_type *sman) |
void | slots_free (struct slots_manager_type *sman) |
void | slots_mark_garbage (int i, struct part_manager_type *pman, struct slots_manager_type *sman) |
void | slots_check_id_consistency (struct part_manager_type *pman, struct slots_manager_type *sman) |
void | slots_setup_topology (struct part_manager_type *pman, int64_t *NLocal, struct slots_manager_type *sman) |
void | slots_setup_id (const struct part_manager_type *pman, struct slots_manager_type *sman) |
Variables | |
struct slots_manager_type | SlotsManager [1] |
MPI_Datatype | MPI_TYPE_PARTICLE = 0 |
MPI_Datatype | MPI_TYPE_PLAN_ENTRY = 0 |
MPI_Datatype | MPI_TYPE_SLOT [6] = {0} |
static struct sph_particle_data * | GDB_SphP |
static struct star_particle_data * | GDB_StarP |
static struct bh_particle_data * | GDB_BhP |
#define GARBAGE | ( | i, | |
ptype, | |||
pman, | |||
sman | |||
) | (sman ? BASESLOT_PI(i,ptype, sman)->ReverseLink > pman->MaxPart : pman->Base[i].IsGarbage) |
Definition at line 164 of file slotsmanager.c.
#define PART | ( | i, | |
ptype, | |||
pman, | |||
sman | |||
) | (sman ? (void *) BASESLOT_PI(i, ptype, sman) : (void *) &pman->Base[i]) |
Definition at line 165 of file slotsmanager.c.
Definition at line 9 of file slotsmanager.c.
|
static |
Definition at line 388 of file slotsmanager.c.
References particle_data::IsGarbage, particle_data::Key, and particle_data::Type.
Referenced by slots_gc_sorted().
|
static |
Definition at line 255 of file slotsmanager.c.
References particle_data_ext::ReverseLink.
Referenced by slots_gc_sorted().
void slots_check_id_consistency | ( | struct part_manager_type * | pman, |
struct slots_manager_type * | sman | ||
) |
Definition at line 587 of file slotsmanager.c.
References part_manager_type::Base, BASESLOT_PI, slot_info::enabled, endrun(), particle_data::ID, slots_manager_type::info, particle_data::IsGarbage, message(), MPI_INT64, part_manager_type::NumPart, particle_data::PI, ptype, slot_info::size, and particle_data::Type.
Referenced by domain_exchange_once(), slots_gc_slots(), slots_gc_sorted(), test_exchange(), test_exchange_uneven(), test_exchange_with_garbage(), test_exchange_zero_slots(), test_slots_gc(), and test_slots_gc_sorted().
|
static |
Definition at line 29 of file slotsmanager.c.
References part_manager_type::Base, BASESLOT_PI, slot_info::elsize, particle_data::ID, slots_manager_type::info, and particle_data::PI.
Referenced by slots_convert().
int slots_convert | ( | int | parent, |
int | ptype, | ||
int | placement, | ||
struct part_manager_type * | pman, | ||
struct slots_manager_type * | sman | ||
) |
Definition at line 60 of file slotsmanager.c.
References atomic_fetch_and_add_64(), part_manager_type::Base, BASESLOT_PI, endrun(), slots_manager_type::info, part_manager_type::MaxPart, slot_info::maxsize, particle_data::PI, ptype, slot_info::size, slots_connect_new_slot(), SLOTS_ENABLED, and particle_data::Type.
Referenced by blackhole_make_one(), make_particle_star(), test_slots_convert(), and test_slots_fork().
|
static |
Definition at line 169 of file slotsmanager.c.
References GARBAGE, and ptype.
Referenced by slots_gc_compact().
|
static |
Definition at line 183 of file slotsmanager.c.
References GARBAGE, and ptype.
Referenced by slots_gc_compact().
void slots_free | ( | struct slots_manager_type * | sman | ) |
Definition at line 570 of file slotsmanager.c.
References slots_manager_type::Base, and myfree.
Referenced by teardown_particles().
int slots_gc | ( | int * | compact_slots, |
struct part_manager_type * | pman, | ||
struct slots_manager_type * | sman | ||
) |
Definition at line 145 of file slotsmanager.c.
References slots_gc_base(), and slots_gc_slots().
Referenced by domain_exchange_once(), run(), test_slots_gc(), and test_slots_zero().
|
static |
Definition at line 234 of file slotsmanager.c.
References message(), MPI_INT64, part_manager_type::NumPart, and slots_gc_compact().
Referenced by slots_gc().
|
static |
Definition at line 322 of file slotsmanager.c.
References part_manager_type::Base, BASESLOT_PI, endrun(), slots_manager_type::info, part_manager_type::MaxPart, particle_data::PI, ptype, particle_data_ext::ReverseLink, slot_info::size, and SLOTS_ENABLED.
Referenced by slots_gc_slots(), and slots_gc_sorted().
|
static |
Definition at line 197 of file slotsmanager.c.
References slot_info::elsize, endrun(), slots_manager_type::info, PART, ptype, slots_find_next_garbage(), and slots_find_next_nongarbage().
Referenced by slots_gc_base(), and slots_gc_sweep().
|
static |
Definition at line 262 of file slotsmanager.c.
References part_manager_type::Base, slot_info::elsize, slot_info::enabled, endrun(), slots_manager_type::info, particle_data::IsGarbage, part_manager_type::MaxPart, part_manager_type::NumPart, particle_data::PI, slot_info::ptr, ptype, particle_data_ext::ReverseLink, slot_info::size, and particle_data::Type.
Referenced by slots_gc_slots(), and slots_gc_sorted().
|
static |
Definition at line 345 of file slotsmanager.c.
References slots_manager_type::info, message(), MPI_INT64, ptype, slot_info::size, slots_check_id_consistency(), slots_gc_collect(), slots_gc_mark(), and slots_gc_sweep().
Referenced by slots_gc().
void slots_gc_sorted | ( | struct part_manager_type * | pman, |
struct slots_manager_type * | sman | ||
) |
Definition at line 442 of file slotsmanager.c.
References part_manager_type::Base, slot_info::elsize, slots_manager_type::info, part_manager_type::NumPart, order_by_type_and_key(), slot_info::ptr, ptype, qsort_openmp, slot_info::size, slot_cmp_reverse_link(), slots_check_id_consistency(), SLOTS_ENABLED, slots_gc_collect(), slots_gc_mark(), slots_get_last_garbage(), and SlotsManager.
Referenced by domain_decompose_full(), test_slots_gc_sorted(), and test_slots_zero().
|
static |
Definition at line 308 of file slotsmanager.c.
References slots_manager_type::info, ptype, slot_info::size, SLOTS_ENABLED, and slots_gc_compact().
Referenced by slots_gc_slots().
int slots_get_last_garbage | ( | int | nfirst, |
int | nlast, | ||
int | ptype, | ||
const struct part_manager_type * | pman, | ||
const struct slots_manager_type * | sman | ||
) |
Definition at line 414 of file slotsmanager.c.
References GARBAGE, and ptype.
Referenced by slots_gc_sorted().
void slots_init | ( | double | increase, |
struct slots_manager_type * | sman | ||
) |
Definition at line 550 of file slotsmanager.c.
References slots_manager_type::increase, and MPI_TYPE_PARTICLE.
Referenced by begrun(), setup_density(), and setup_particles().
void slots_mark_garbage | ( | int | i, |
struct part_manager_type * | pman, | ||
struct slots_manager_type * | sman | ||
) |
Definition at line 577 of file slotsmanager.c.
References part_manager_type::Base, BASESLOT_PI, particle_data::IsGarbage, part_manager_type::MaxPart, particle_data::PI, SLOTS_ENABLED, and particle_data::Type.
Referenced by blackhole_feedback_ngbiter(), domain_exchange_once(), test_exchange_with_garbage(), test_slots_gc(), test_slots_gc_sorted(), and test_slots_zero().
size_t slots_reserve | ( | int | where, |
int64_t | atleast[6], | ||
struct slots_manager_type * | sman | ||
) |
Definition at line 475 of file slotsmanager.c.
References add, slots_manager_type::Base, slot_info::elsize, GDB_BhP, GDB_SphP, GDB_StarP, slots_manager_type::increase, slots_manager_type::info, slot_info::maxsize, message(), mymalloc, myrealloc, slot_info::ptr, ptype, slot_info::size, and SLOTS_ENABLED.
Referenced by domain_exchange_once(), fof_distribute_particles(), fof_seed(), init_alloc_particle_slot_memory(), setup_density(), setup_particles(), sfr_reserve_slots(), and test_slots_reserve().
void slots_set_enabled | ( | int | ptype, |
size_t | elsize, | ||
struct slots_manager_type * | sman | ||
) |
Definition at line 560 of file slotsmanager.c.
References slot_info::elsize, slot_info::enabled, slots_manager_type::info, MPI_TYPE_SLOT, and ptype.
Referenced by begrun(), setup_density(), and setup_particles().
void slots_setup_id | ( | const struct part_manager_type * | pman, |
struct slots_manager_type * | sman | ||
) |
Definition at line 653 of file slotsmanager.c.
References part_manager_type::Base, slot_info::elsize, slot_info::enabled, endrun(), particle_data::ID, particle_data_ext::ID, slots_manager_type::info, part_manager_type::NumPart, particle_data::PI, slot_info::ptr, particle_data_ext::ReverseLink, slot_info::size, and particle_data::Type.
Referenced by petaio_read_snapshot(), and setup_particles().
void slots_setup_topology | ( | struct part_manager_type * | pman, |
int64_t * | NLocal, | ||
struct slots_manager_type * | sman | ||
) |
Definition at line 624 of file slotsmanager.c.
References part_manager_type::Base, slot_info::enabled, slots_manager_type::info, particle_data::IsGarbage, particle_data::PI, ptype, slot_info::size, and particle_data::Type.
Referenced by init_alloc_particle_slot_memory(), and setup_particles().
int slots_split_particle | ( | int | parent, |
double | childmass, | ||
struct part_manager_type * | pman | ||
) |
When a new additional star particle is created, we can put it into the tree at the position of the spawning gas particle. Multipole moments of tree nodes need not be changed.
Definition at line 103 of file slotsmanager.c.
References atomic_fetch_and_add_64(), part_manager_type::Base, endrun(), event_emit(), EventSlotsFork, particle_data::Generation, particle_data::ID, particle_data::Mass, part_manager_type::MaxPart, part_manager_type::NumPart, EISlotsFork::parent, and particle_data::PI.
Referenced by get_sfr_eeqos(), and test_slots_fork().
|
static |
Definition at line 17 of file slotsmanager.c.
Referenced by slots_reserve().
|
static |
Definition at line 15 of file slotsmanager.c.
Referenced by slots_reserve().
|
static |
Definition at line 16 of file slotsmanager.c.
Referenced by slots_reserve().
MPI_Datatype MPI_TYPE_PARTICLE = 0 |
Definition at line 11 of file slotsmanager.c.
Referenced by domain_exchange_once(), and slots_init().
MPI_Datatype MPI_TYPE_PLAN_ENTRY = 0 |
Definition at line 12 of file slotsmanager.c.
MPI_Datatype MPI_TYPE_SLOT[6] = {0} |
Definition at line 13 of file slotsmanager.c.
Referenced by domain_exchange_once(), and slots_set_enabled().
struct slots_manager_type SlotsManager[1] |
Definition at line 1 of file slotsmanager.c.
Referenced by begrun(), blackhole(), blackhole_feedback_ngbiter(), blackhole_make_one(), check_density_entropy(), cooling_and_starformation(), density(), do_density_test(), domain_decompose_full(), domain_maintain(), drift_all_particles(), fof_distribute_particles(), fof_seed(), force_tree_create_nodes(), gas_ionization_fraction(), hydro_force(), init(), init_alloc_particle_slot_memory(), make_particle_star(), metal_return(), metal_return_init(), petaio_build_buffer(), petaio_read_snapshot(), petaio_readout_buffer(), petaio_save_snapshot(), run(), runfof(), setup_density(), setup_density_indep_entropy(), setup_particles(), setup_smoothinglengths(), sfr_reserve_slots(), slots_gc_sorted(), stellar_density(), teardown_particles(), test_exchange(), test_exchange_uneven(), test_exchange_with_garbage(), test_exchange_zero_slots(), test_slots_convert(), test_slots_fork(), test_slots_gc(), test_slots_gc_sorted(), test_slots_reserve(), test_slots_zero(), turn_on_quasars(), and winds_find_weights().