Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
io.hpp File Reference
#include "shamalgs/collective/indexing.hpp"
#include "shambackends/SyclMpiTypes.hpp"
#include "shambackends/typeAliasVec.hpp"
#include "shamcomm/mpiErrorCheck.hpp"
+ Include dependency graph for io.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shamalgs
 namespace to contain everything implemented by shamalgs
 

Functions

template<class T >
void shamalgs::collective::viewed_write_all_fetch (MPI_File fh, T *ptr_data, u64 data_cnt, u64 &file_head_ptr)
 Writes data to an MPI file in a collective manner.
 
template<class T >
void shamalgs::collective::viewed_write_all_fetch_known_total_size (MPI_File fh, T *ptr_data, u64 data_cnt, u64 total_cnt, u64 &file_head_ptr)
 Writes data to an MPI file in a collective manner and updates the file head pointer.
 
void shamalgs::collective::write_header_raw (MPI_File fh, std::string s, u64 &file_head_ptr)
 Writes a string to a file using MPI and updates the file head pointer.
 
std::string shamalgs::collective::read_header_raw (MPI_File fh, size_t len, u64 &file_head_ptr)
 Reads a string of length len from a file using MPI and updates the file head pointer.
 
void shamalgs::collective::write_header_val (MPI_File fh, size_t val, u64 &file_head_ptr)
 Writes a size_t to a file using MPI and updates the file head pointer.
 
template<class T >
void shamalgs::collective::write_at (MPI_File fh, const void *buf, size_t len, u64 file_head_ptr)
 Writes data at a given offset in a file using MPI.
 
template<class T >
void shamalgs::collective::read_at (MPI_File fh, void *buf, size_t len, u64 file_head_ptr)
 Reads data at a given offset in a file using MPI.
 
size_t shamalgs::collective::read_header_val (MPI_File fh, u64 &file_head_ptr)
 Reads a size_t from a file using MPI and updates the file head pointer.
 
void shamalgs::collective::write_header (MPI_File fh, std::string s, u64 &file_head_ptr)
 Writes a string to a file using MPI and updates the file head pointer. The string is preceded by its length.
 
std::string shamalgs::collective::read_header (MPI_File fh, u64 &file_head_ptr)
 Reads a string from a file using MPI and updates the file head pointer. The string is preceded by its length.
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file io.hpp.

Function Documentation

◆ read_at()

template<class T >
void shamalgs::collective::read_at ( MPI_File  fh,
void *  buf,
size_t  len,
u64  file_head_ptr 
)
inline

Reads data at a given offset in a file using MPI.

Parameters
fhMPI file handle
bufpointer to the data that should be read
lennumber of elements of type T to be read
file_head_ptroffset in the file where the data should be read

Definition at line 172 of file io.hpp.

+ Here is the call graph for this function:

◆ read_header()

std::string shamalgs::collective::read_header ( MPI_File  fh,
u64 file_head_ptr 
)
inline

Reads a string from a file using MPI and updates the file head pointer. The string is preceded by its length.

Parameters
fhMPI file handle
file_head_ptrfile head pointer
Returns
string read from file

Definition at line 220 of file io.hpp.

+ Here is the call graph for this function:

◆ read_header_raw()

std::string shamalgs::collective::read_header_raw ( MPI_File  fh,
size_t  len,
u64 file_head_ptr 
)
inline

Reads a string of length len from a file using MPI and updates the file head pointer.

Parameters
fhMPI file handle
lenlength of string to read
file_head_ptrfile head pointer
Returns
string read from file

Definition at line 115 of file io.hpp.

+ Here is the call graph for this function:

◆ read_header_val()

size_t shamalgs::collective::read_header_val ( MPI_File  fh,
u64 file_head_ptr 
)
inline

Reads a size_t from a file using MPI and updates the file head pointer.

Parameters
fhMPI file handle
file_head_ptrfile head pointer
Returns
size_t read from file

Definition at line 185 of file io.hpp.

+ Here is the call graph for this function:

◆ viewed_write_all_fetch()

template<class T >
void shamalgs::collective::viewed_write_all_fetch ( MPI_File  fh,
T *  ptr_data,
u64  data_cnt,
u64 file_head_ptr 
)

Writes data to an MPI file in a collective manner.

Template Parameters
TThe type of data to be written.
Parameters
fhThe MPI file handle.
ptr_dataPointer to the data to be written.
data_cntNumber of elements of type T to be written.
file_head_ptrThe current file head pointer, which is updated after the write operation.

Definition at line 38 of file io.hpp.

+ Here is the call graph for this function:

◆ viewed_write_all_fetch_known_total_size()

template<class T >
void shamalgs::collective::viewed_write_all_fetch_known_total_size ( MPI_File  fh,
T *  ptr_data,
u64  data_cnt,
u64  total_cnt,
u64 file_head_ptr 
)

Writes data to an MPI file in a collective manner and updates the file head pointer.

Template Parameters
TThe type of data to be written.
Parameters
fhThe MPI file handle.
ptr_dataPointer to the data to be written.
data_cntNumber of elements of type T to be written.
total_cntTotal number of elements of type T in the file.
file_head_ptrThe current file head pointer, which is updated after the write operation.

Definition at line 68 of file io.hpp.

+ Here is the call graph for this function:

◆ write_at()

template<class T >
void shamalgs::collective::write_at ( MPI_File  fh,
const void *  buf,
size_t  len,
u64  file_head_ptr 
)
inline

Writes data at a given offset in a file using MPI.

Parameters
fhMPI file handle
bufpointer to the data to be written
lennumber of elements of type T to be written
file_head_ptroffset in the file where the data should be written

Definition at line 157 of file io.hpp.

+ Here is the call graph for this function:

◆ write_header()

void shamalgs::collective::write_header ( MPI_File  fh,
std::string  s,
u64 file_head_ptr 
)
inline

Writes a string to a file using MPI and updates the file head pointer. The string is preceded by its length.

Parameters
fhMPI file handle
sstring to write
file_head_ptrfile head pointer

Definition at line 206 of file io.hpp.

+ Here is the call graph for this function:

◆ write_header_raw()

void shamalgs::collective::write_header_raw ( MPI_File  fh,
std::string  s,
u64 file_head_ptr 
)
inline

Writes a string to a file using MPI and updates the file head pointer.

Note that all processes should call this function with the same content

Parameters
fhMPI file handle
sstring to write
file_head_ptrfile head pointer

Definition at line 95 of file io.hpp.

+ Here is the call graph for this function:

◆ write_header_val()

void shamalgs::collective::write_header_val ( MPI_File  fh,
size_t  val,
u64 file_head_ptr 
)
inline

Writes a size_t to a file using MPI and updates the file head pointer.

Parameters
fhMPI file handle
valvalue to write
file_head_ptrfile head pointer

Definition at line 136 of file io.hpp.

+ Here is the call graph for this function: