MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
iterates over timesteps, main loop More...
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <ctype.h>
#include <omp.h>
#include "utils.h"
#include "walltime.h"
#include "gravity.h"
#include "density.h"
#include "domain.h"
#include "run.h"
#include "init.h"
#include "cooling.h"
#include "checkpoint.h"
#include "petaio.h"
#include "petapm.h"
#include "timestep.h"
#include "drift.h"
#include "forcetree.h"
#include "blackhole.h"
#include "hydra.h"
#include "sfr_eff.h"
#include "metal_return.h"
#include "slotsmanager.h"
#include "hci.h"
#include "fof.h"
#include "cooling_qso_lightup.h"
#include "lightcone.h"
#include "timefac.h"
#include "neutrinos_lra.h"
#include "stats.h"
Go to the source code of this file.
Classes | |
struct | run_params |
Functions | |
void | set_all_global_params (ParameterSet *ps) |
int | find_last_snapshot (void) |
inttime_t | begrun (const int RestartSnapNum, struct header_data *head) |
static int | use_pairwise_gravity (ActiveParticles *Act, struct part_manager_type *PartManager) |
void | run (const int RestartSnapNum, const inttime_t ti_init, const struct header_data *header) |
void | runtests (const int RestartSnapNum, const inttime_t Ti_Current, const struct header_data *header) |
void | runfof (const int RestartSnapNum, const inttime_t Ti_Current, const struct header_data *header) |
void | runpower (const struct header_data *header) |
Variables | |
static struct ClockTable | Clocks |
static struct run_params | All |
iterates over timesteps, main loop
Definition in file run.c.
inttime_t begrun | ( | const int | RestartSnapNum, |
struct header_data * | head | ||
) |
This function performs the initial set-up of the simulation. First, the parameterfile is set, then routines for setting units, reading ICs/restart-files are called, auxialiary memory is allocated, etc.
Definition at line 194 of file run.c.
References All, run_params::Asmth, run_params::BlackHoleOn, header_data::BoxSize, check_density_entropy(), check_units(), Clocks, CM_PER_MPC, run_params::CoolingOn, run_params::CP, domain_decompose_full(), domain_free(), run_params::FastParticleType, fastpm_strdup_printf(), get_MinEgySpec(), get_unitsystem(), gravshort_fill_ntab(), init(), init_cooling_and_star_formation(), init_cosmology(), init_forcetree_params(), init_neutrinos_lra(), init_timeline(), lightcone_init(), run_params::LightconeOn, Cosmology::MassiveNuLinRespOn, header_data::MassTable, part_manager_type::MaxPart, MPIU_write_pids(), myfree, header_data::neutrinonk, run_params::Nmesh, header_data::NTotal, header_data::NTotalInit, Cosmology::Omega0, Cosmology::ONu, run_params::OutputDir, PartManager, petaio_init(), petaio_read_header(), petapm_module_init(), run_params::RandomSeed, set_random_numbers(), setup_smoothinglengths(), run_params::ShortRangeForceWindowType, slots_init(), slots_set_enabled(), run_params::SlotsIncreaseFactor, SlotsManager, run_params::SnapshotWithFOF, run_params::StarformationOn, header_data::TimeIC, run_params::TimeMax, header_data::TimeSnapshot, UnitSystem::UnitInternalEnergy_in_cgs, header_data::UnitLength_in_cm, header_data::UnitMass_in_g, Cosmology::UnitTime_in_s, header_data::UnitVelocity_in_cm_per_s, and walltime_init().
Referenced by main().
int find_last_snapshot | ( | void | ) |
Definition at line 182 of file run.c.
References All, find_last_snapnum(), message(), and run_params::OutputDir.
Referenced by main().
void run | ( | const int | RestartSnapNum, |
const inttime_t | ti_init, | ||
const struct header_data * | header | ||
) |
This routine contains the main simulation loop that iterates over single timesteps. The loop terminates when the cpu-time limit is reached, when a ‘stop’ file is found in the output directory, or when the simulation ends because we arrived at TimeMax.
Definition at line 284 of file run.c.
References ActiveParticles::ActiveParticle, All, apply_half_kick(), apply_PM_half_kick(), run_params::Asmth, run_params::AutoSnapshotTime, blackhole(), run_params::BlackHoleOn, part_manager_type::BoxSize, Clocks, close_outputfiles(), cooling_and_starformation(), run_params::CoolingOn, DriftData::CP, run_params::CP, density(), DensityIndependentSphOn(), run_params::DensityOn, do_heiii_reionization(), domain_decompose_full(), domain_maintain(), drift_all_particles(), dump_snapshot(), during_helium_reionization(), ClockTable::ElapsedTime, slot_info::enabled, endrun(), energy_statistics(), run_params::FastParticleType, OutputFD::FdBlackholeDetails, OutputFD::FdBlackHoles, OutputFD::FdCPU, OutputFD::FdEnergy, OutputFD::FdHelium, OutputFD::FdSfr, find_current_sync_point(), find_next_kick(), find_next_sync_point(), find_timesteps(), fof_finish(), fof_fof(), fof_save_groups(), fof_seed(), run_params::FOFFileBase, force_tree_free(), force_tree_rebuild(), force_update_hmax(), free_activelist(), get_atime(), get_dloga_for_bin(), get_gravshort_treepar(), get_MinEgySpec(), get_unitsystem(), grav_short_pair(), grav_short_tree(), Cosmology::GravInternal, gravpm_force(), gravpm_init_periodic(), hci_action_init(), hci_init(), hci_query(), HCI_TERMINATE, HCI_TIMEOUT, Cosmology::Hubble, hybrid_nu_tracer(), hydro_force(), run_params::HydroOn, slots_manager_type::info, init_driftkicktime(), is_PM_timestep(), is_timebin_active(), lightcone_compute(), run_params::LightconeOn, header_data::MassTable, run_params::MaxDomainTimeBinDepth, message(), metal_return(), run_params::MetalReturnOn, DriftKickTimes::mintimebin, MPIU_Barrier, myfree, mymalloc2, need_change_helium_ionization_fraction(), run_params::Nmesh, header_data::NTotalInit, ActiveParticles::NumActiveParticle, part_manager_type::NumPart, Cosmology::Omega0, Cosmology::OmegaBaryon, open_outputfiles(), run_params::OutputDebugFields, run_params::OutputDir, PartManager, run_params::RandomParticleOffset, run_params::RandomSeed, gravshort_tree_params::Rcut, rebuild_activelist(), report_memory_usage, set_random_numbers(), sfr_need_to_compute_sph_grad_rho(), slot_info::size, slots_allocate_sph_pred_data(), slots_free_sph_pred_data(), slots_gc(), SlotsManager, run_params::SnapshotWithFOF, run_params::StarformationOn, DriftData::ti0, DriftData::ti1, DriftKickTimes::Ti_Current, run_params::TimeBetweenSeedingSearch, header_data::TimeIC, run_params::TimeLimitCPU, header_data::TimeSnapshot, run_params::TreeGravOn, HCIAction::type, UnitSystem::UnitInternalEnergy_in_cgs, header_data::UnitLength_in_cm, UnitSystem::UnitLength_in_cm, header_data::UnitMass_in_g, header_data::UnitVelocity_in_cm_per_s, update_lastactive_drift(), update_random_offset(), use_pairwise_gravity(), walltime_measure, write_checkpoint(), write_cpu_log(), HCIAction::write_fof, SyncPoint::write_fof, HCIAction::write_snapshot, and SyncPoint::write_snapshot.
Referenced by main().
void runfof | ( | const int | RestartSnapNum, |
const inttime_t | Ti_Current, | ||
const struct header_data * | header | ||
) |
Definition at line 652 of file run.c.
References All, run_params::Asmth, run_params::BlackHoleOn, part_manager_type::BoxSize, cooling_and_starformation(), run_params::CP, density(), domain_decompose_full(), fof_finish(), fof_fof(), fof_save_groups(), run_params::FOFFileBase, force_tree_free(), force_tree_rebuild(), get_MinEgySpec(), Cosmology::GravInternal, gravpm_init_periodic(), hybrid_nu_tracer(), slots_manager_type::info, init_driftkicktime(), header_data::MassTable, run_params::MetalReturnOn, myfree, mymalloc2, run_params::Nmesh, ActiveParticles::NumActiveParticle, part_manager_type::NumPart, run_params::OutputDir, PartManager, sfr_need_to_compute_sph_grad_rho(), slot_info::size, slots_allocate_sph_pred_data(), slots_free_sph_pred_data(), SlotsManager, run_params::StarformationOn, and header_data::TimeSnapshot.
Referenced by main().
void runpower | ( | const struct header_data * | header | ) |
Definition at line 691 of file run.c.
References All, run_params::Asmth, part_manager_type::BoxSize, run_params::CP, domain_decompose_full(), run_params::FastParticleType, force_tree_free(), force_tree_rebuild(), Cosmology::GravInternal, gravpm_force(), gravpm_init_periodic(), hybrid_nu_tracer(), run_params::Nmesh, run_params::OutputDir, PartManager, header_data::TimeSnapshot, and header_data::UnitLength_in_cm.
Referenced by main().
void runtests | ( | const int | RestartSnapNum, |
const inttime_t | Ti_Current, | ||
const struct header_data * | header | ||
) |
Definition at line 646 of file run.c.
References All, run_params::Asmth, run_params::CP, run_params::FastParticleType, run_params::Nmesh, run_params::OutputDir, and run_gravity_test().
Referenced by main().
void set_all_global_params | ( | ParameterSet * | ps | ) |
Definition at line 106 of file run.c.
References All, run_params::Asmth, run_params::AutoSnapshotTime, run_params::BlackHoleOn, Cosmology::CMBTemperature, run_params::CoolingOn, run_params::CP, run_params::DensityOn, endrun(), run_params::FastParticleType, run_params::FOFFileBase, Cosmology::HubbleParam, Cosmology::HybridNeutrinosOn, Cosmology::HybridNuPartTime, Cosmology::HybridVcrit, run_params::HydroOn, run_params::LightconeOn, Cosmology::MassiveNuLinRespOn, run_params::MaxDomainTimeBinDepth, run_params::MetalReturnOn, Cosmology::MNu, run_params::Nmesh, Cosmology::Omega0, Cosmology::Omega_fld, Cosmology::Omega_ur, Cosmology::OmegaBaryon, Cosmology::OmegaLambda, run_params::OutputDebugFields, run_params::OutputDir, run_params::PairwiseActiveFraction, param_get_double(), param_get_enum(), param_get_int(), param_get_string2(), Cosmology::RadiationOn, run_params::RandomParticleOffset, run_params::RandomSeed, run_params::ShortRangeForceWindowType, run_params::SlotsIncreaseFactor, run_params::SnapshotWithFOF, run_params::StarformationOn, ThisTask, run_params::TimeBetweenSeedingSearch, run_params::TimeLimitCPU, run_params::TimeMax, run_params::TreeGravOn, Cosmology::w0_fld, and Cosmology::wa_fld.
Referenced by read_parameter_file().
|
static |
Definition at line 267 of file run.c.
References All, MPI_INT64, ActiveParticles::NumActiveParticle, part_manager_type::NumPart, run_params::PairwiseActiveFraction, and PartManager.
Referenced by run().
|
static |
Referenced by begrun(), find_last_snapshot(), run(), runfof(), runpower(), runtests(), set_all_global_params(), and use_pairwise_gravity().