17#ifdef LIGHTCONE_PARTICLES
21#include "../data/simparticles.h"
22#include "../fof/fof.h"
23#include "../io/io_streamcount.h"
24#include "../mpi_utils/setcomm.h"
27#define DATASETNAME_LEN 256
90#ifdef FOF_ALLOW_HUGE_GROUPLENGTH
134 file_format = format;
145 virtual void fill_file_header(
int writeTask,
int lastTask,
long long *nloc_part,
long long *npart) = 0;
146 virtual void read_file_header(
const char *fname,
int filenr,
int readTask,
int lastTask,
long long *nloc_part,
long long *npart,
160 void *pointer_to_field,
void (*io_func)(
IO_Def *,
int,
int,
void *,
int),
int typelist_bitmask,
int hasunits,
161 double a,
double h,
double L,
double M,
double V,
double c,
bool compression_on =
false);
163 int find_files(
const char *fname,
const char *fname_multiple);
165 void write_multiple_files(
char *fname,
int numfilesperdump,
int append_flag = 0,
int chunk_size = 0);
167 void read_segment(
const char *fname,
int type,
long long offset,
long long count,
int numfiles);
169 long long storage_offset,
int numfiles);
179#if defined(MERGERTREE)
180 typedef fof<simparticles>::treehalo_t treehalo_type;
195 int values_per_block;
200 void (*io_func)(
IO_Def *, int, int,
void *, int);
216 void write_file(
char *fname,
int writeTask,
int lastTask,
void *CommBuffer,
int numfilesperdump,
int chunksize);
217 void read_file(
const char *fname,
int filenr,
int readTask,
int lastTask,
void *CommBuffer);
218 void append_file(
char *fname,
int writeTask,
int lastTask,
void *CommBuffer,
int numfilesperdump,
int chunksize);
220 int get_values_per_blockelement(
int blocknr);
221 void get_dataset_name(
int blocknr,
char *buf);
222 long long get_particles_in_block(
int blocknr,
long long *npartinfile,
int *typelist);
223 int get_bytes_per_memory_blockelement(
int blocknr,
int mode);
224 hid_t get_hdf5_outputtype_of_block(
int blocknr);
225 hid_t get_hdf5_memorytype_of_block(
int blocknr);
226 void get_Tab_IO_Label(
int blocknr,
char *label);
227 void type_cast_data(
char *src,
int src_bytes_per_element,
char *target,
int target_bytes_per_element,
int len,
int blocknr);
228 void distribute_file(
int nfiles,
int *filenr,
int *master,
int *last);
229 void share_particle_number_in_file(
const char *fname,
int filenr,
int readTask,
int lastTask);
230 void find_block(
char *label, FILE *fd);
231 void fill_write_buffer(
int blocknr,
int *startindex,
int pc,
int type,
void *CommBuffer);
232 void empty_read_buffer(
int blocknr,
int offset,
int pc,
int type,
long long nprevious,
void *CommBuffer);
234 void write_dataset_attributes(hid_t hdf5_dataset,
int blocknr);
235 void write_parameters_attributes_in_hdf5(hid_t handle);
236 void rename_file_to_bak_if_it_exists(
char *fname);
238 void polling(
int numfilesperdump);
251 if(rankinnode < b.rankinnode)
253 if(rankinnode > b.rankinnode)
255 if(thisnode < b.thisnode)
257 if(thisnode > b.thisnode)
259 return thistask < b.thistask;
266#define NTYPES_HEADER 6
268#define NTYPES_HEADER NTYPES
271#define FLAG_ZELDOVICH_ICS 1
272#define FLAG_SECOND_ORDER_ICS 2
virtual int get_filenr_from_header(void)=0
void alloc_and_read_ntype_in_files(const char *fname, int num_files)
void write_multiple_files(char *fname, int numfilesperdump, int append_flag=0, int chunk_size=0)
long long * ntype_in_files
virtual void * get_base_address_of_structure(enum arrays array, int index)=0
void read_segment(const char *fname, int type, long long offset, long long count, int numfiles)
virtual void set_type_of_element(int index, int type)=0
virtual void read_increase_numbers(int type, int n_for_this_task)=0
virtual void fill_file_header(int writeTask, int lastTask, long long *nloc_part, long long *npart)=0
void init_field(const char *label, const char *datasetname, enum types_in_memory type_in_memory, enum types_in_file type_in_file_output, enum read_flags read_flag, int values_per_block, enum arrays array, void *pointer_to_field, void(*io_func)(IO_Def *, int, int, void *, int), int typelist_bitmask, int hasunits, double a, double h, double L, double M, double V, double c, bool compression_on=false)
virtual void read_header_fields(const char *fname)=0
virtual void read_file_header(const char *fname, int filenr, int readTask, int lastTask, long long *nloc_part, long long *npart, int *nstart)=0
virtual void set_filenr_in_header(int)=0
enum file_contents type_of_file
virtual void write_header_fields(hid_t)=0
IO_Def(MPI_Comm comm, int format)
void read_files_driver(const char *fname, int rep, int numfiles)
virtual void get_datagroup_name(int grnr, char *gname)=0
void read_single_file_segment(const char *fname, int filenr, int type, long long offset, unsigned long long count, long long storage_offset, int numfiles)
virtual int get_type_of_element(int index)=0
int find_files(const char *fname, const char *fname_multiple)
This function determines on how many files a given snapshot or group/desc catalogue is distributed.
void write_compile_time_options_in_hdf5(hid_t handle)
void determine_compute_nodes(void)
bool operator<(const location &left, const location &right)
const types_in_memory mem_len_type
const types_in_file file_len_type