GADGET-4
|
#include <io.h>
Inherits io_streamcount, and setcomm.
Inherited by fof_io< partset >, and snap_io.
Public Member Functions | |
IO_Def (MPI_Comm comm, int format) | |
virtual | ~IO_Def () |
virtual void | fill_file_header (int writeTask, int lastTask, long long *nloc_part, long long *npart)=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 | get_datagroup_name (int grnr, char *gname)=0 |
virtual void | write_header_fields (hid_t)=0 |
virtual void | read_header_fields (const char *fname)=0 |
virtual void | read_increase_numbers (int type, int n_for_this_task)=0 |
virtual int | get_filenr_from_header (void)=0 |
virtual void | set_filenr_in_header (int)=0 |
virtual void * | get_base_address_of_structure (enum arrays array, int index)=0 |
virtual int | get_type_of_element (int index)=0 |
virtual void | set_type_of_element (int index, int type)=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) |
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. More... | |
void | read_files_driver (const char *fname, int rep, int numfiles) |
void | write_multiple_files (char *fname, int numfilesperdump, int append_flag=0, int chunk_size=0) |
void | write_compile_time_options_in_hdf5 (hid_t handle) |
void | read_segment (const char *fname, int type, long long offset, long long count, int numfiles) |
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) |
void | alloc_and_read_ntype_in_files (const char *fname, int num_files) |
Public Member Functions inherited from io_streamcount | |
size_t | my_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream) |
A wrapper for the fwrite() function. More... | |
size_t | my_fread (void *ptr, size_t size, size_t nmemb, FILE *stream) |
A wrapper for the fread() function. More... | |
void | reset_io_byte_count (void) |
long long | get_io_byte_count (void) |
Public Member Functions inherited from setcomm | |
setcomm (MPI_Comm Comm) | |
setcomm (const char *str) | |
void | initcomm (MPI_Comm Comm) |
void | mpi_printf (const char *fmt,...) |
void | determine_compute_nodes (void) |
Public Attributes | |
int | N_DataGroups = 0 |
int | N_IO_Fields = 0 |
int | Max_IO_Fields = 0 |
size_t | header_size |
void * | header_buf |
long long * | ntype_in_files |
char | info [100] |
enum file_contents | type_of_file |
Public Attributes inherited from io_streamcount | |
long long | byte_count = 0 |
Public Attributes inherited from setcomm | |
MPI_Comm | Communicator |
int | NTask |
int | ThisTask |
int | PTask |
int | ThisNode |
int | NumNodes = 0 |
int | TasksInThisNode |
int | RankInThisNode |
int | MinTasksPerNode |
int | MaxTasksPerNode |
long long | MemoryOnNode |
long long | SharedMemoryOnNode |
void alloc_and_read_ntype_in_files | ( | const char * | fname, |
int | num_files | ||
) |
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
int find_files | ( | const char * | fname, |
const char * | fname_multiple | ||
) |
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
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_Def *, int, int, void *, int) | io_func, | ||
int | typelist_bitmask, | ||
int | flagunit, | ||
double | a, | ||
double | h, | ||
double | L, | ||
double | M, | ||
double | V, | ||
double | c, | ||
bool | compression_on = false |
||
) |
field | Specifies the field as an enumeration type iofields (io_private.h), e.g. IO_POS. |
label | The label of the dataset (4 characters, for obsolete old format=2) |
datasetname | The name of the hdf5 dataset (maximum 256 characters, for format=3) |
type_in_memory | The type of the field in the memory |
type_in_file_output | The output type in the file if it is written (upon read, the type found will be converted to the memory type) |
read_flag | This flags whether the field should be ignored upon read on (use SKIP_ON_READ, else READ_IF_PRESENT). |
values_per_block | The number of values per field, e.g. 1 for mass, 3 for velocities |
array | The array in which the value is stored |
pointer_to_field | A Pointer to the field in one of the global arrays, e.g. &SphP[0].Density, or &P[0].Vel[0] |
io_func | Alternatively, if the value to output/input is not a simple field, you can define a function which handles i/o |
typelist_bitmask | Specifies for which particle type the field is present, e.g. 1+2+8 => field present for particle types 0,1,3 (or use ALL_TYPES, GAS_ONLY,...) |
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
void read_files_driver | ( | const char * | fname, |
int | rep, | ||
int | numfiles | ||
) |
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
void read_segment | ( | const char * | fname, |
int | type, | ||
long long | offset, | ||
long long | count, | ||
int | numfiles | ||
) |
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 | ||
) |
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
void write_compile_time_options_in_hdf5 | ( | hid_t | handle | ) |
|
pure virtual |
Implemented in fof_io< partset >, and snap_io.
void write_multiple_files | ( | char * | fname, |
int | numfilesperdump, | ||
int | append_flag = 0 , |
||
int | chunk_size = 0 |
||
) |
enum file_contents type_of_file |