#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <mpi.h>
#include "allvars.h"
#include "proto.h"
Go to the source code of this file.
Defines | |
#define | SKIP {my_fread(&blksize1,sizeof(int),1,fd);} |
#define | SKIP2 {my_fread(&blksize2,sizeof(int),1,fd);} |
Functions | |
void | read_ic (char *fname) |
void | empty_read_buffer (enum iofields blocknr, int offset, int pc, int type) |
void | read_file (char *fname, int readTask, int lastTask) |
int | find_files (char *fname) |
void | distribute_file (int nfiles, int firstfile, int firsttask, int lasttask, int *filenr, int *master, int *last) |
void | read_header_attributes_in_hdf5 (char *fname) |
Definition in file read_ic.c.
|
|
|
|
|
This function assigns a certain number of files to processors, such that each processor is exactly assigned to one file, and the number of cpus per file is as homogenous as possible. The number of files may at most be equal to the number of processors. Definition at line 725 of file read_ic.c. References ThisTask. Referenced by read_ic(), and savepositions(). |
|
This function reads out the buffer that was filled with particle data, and stores it at the appropriate place in the particle structures. Definition at line 168 of file read_ic.c. References sph_particle_data::Density, sph_particle_data::Entropy, sph_particle_data::Hsml, particle_data::ID, IO_ACCEL, IO_DTENTR, IO_HSML, IO_ID, IO_MASS, IO_POS, IO_POT, IO_RHO, IO_TSTP, IO_U, IO_VEL, particle_data::Mass, P, particle_data::Pos, SphP, particle_data::Type, and particle_data::Vel. Referenced by read_file(). |
|
This function determines onto how many files a given snapshot is distributed. Definition at line 616 of file read_ic.c. References All, endrun(), header, global_data_all_processes::ICFormat, io_header::num_files, read_header_attributes_in_hdf5(), and ThisTask. Referenced by read_ic(). |
|
|
This function reads the header information in case the HDF5 file format is used. Definition at line 765 of file read_ic.c. References io_header::flag_entropy_instead_u, header, io_header::mass, io_header::npart, io_header::npartTotal, io_header::npartTotalHighWord, and io_header::num_files. Referenced by find_files(), and read_file(). |
|
This function reads initial conditions, in one of the three possible file formats currently supported by Gadget. Note: When a snapshot file is started from initial conditions (start-option 0), not all the information in the header is used, in particular, the STARTING TIME needs to be set in the parameterfile. Also, for gas particles, only the internal energy is read, the density and mean molecular weight will be recomputed by the code. When InitGasTemp>0 is given, the gas temperature will be initialzed to this value assuming a mean colecular weight either corresponding to complete neutrality, or full ionization. However, when the code is started with start-option 2, then all the this data in the snapshot files is preserved, i.e. this is also the way to resume a simulation from a snapshot file in case a regular restart file is not available. < adiabatic index of simulated gas < mass fraction of hydrogen, relevant only for radiative cooling < mass fraction of hydrogen, relevant only for radiative cooling Definition at line 31 of file read_ic.c. References All, BOLTZMANN, distribute_file(), dmax(), sph_particle_data::Entropy, fill_Tab_IO_Labels(), find_files(), global_data_all_processes::ICFormat, global_data_all_processes::InitGasTemp, particle_data::Mass, global_data_all_processes::MassTable, global_data_all_processes::MinEgySpec, N_gas, NTask, global_data_all_processes::NumFilesWrittenInParallel, NumPart, P, read_file(), RestartFlag, SphP, ThisTask, global_data_all_processes::TotNumPart, particle_data::Type, global_data_all_processes::UnitEnergy_in_cgs, and global_data_all_processes::UnitMass_in_g. Referenced by init(). |