![]() |
Shamrock 2025.10.0
Astrophysical Code
|
#include "shambase/narrowing.hpp"#include "shamalgs/collective/indexing.hpp"#include "shambackends/SyclMpiTypes.hpp"#include "shambackends/typeAliasVec.hpp"#include "shamcomm/mpiErrorCheck.hpp"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. | |
| void | shamalgs::collective::write_at_large (MPI_File fh, const u8 *buf, size_t len, u64 file_head_ptr) |
| Writes a large byte buffer 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. | |
| void | shamalgs::collective::read_at_large (MPI_File fh, u8 *buf, size_t len, u64 file_head_ptr) |
| Reads a large byte buffer 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. | |
Definition in file io.hpp.
|
inline |
|
inline |
Reads a large byte buffer at a given offset in a file using MPI.
This function splits the transfer into chunks of at most 1 GiB and delegates each chunk to read_at<u8>. Use this instead of read_at when len may exceed the range safely representable as an MPI count (read_at narrows len to int).
| fh | MPI file handle |
| buf | pointer to the buffer that should receive the bytes |
| len | number of bytes to read |
| file_head_ptr | offset in the file where the data should be read |
|
inline |
|
inline |
|
inline |
| 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.
| T | The type of data to be written. |
| fh | The MPI file handle. |
| ptr_data | Pointer to the data to be written. |
| data_cnt | Number of elements of type T to be written. |
| file_head_ptr | The current file head pointer, which is updated after the write operation. |
| 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.
| T | The type of data to be written. |
| fh | The MPI file handle. |
| ptr_data | Pointer to the data to be written. |
| data_cnt | Number of elements of type T to be written. |
| total_cnt | Total number of elements of type T in the file. |
| file_head_ptr | The current file head pointer, which is updated after the write operation. |
|
inline |
|
inline |
Writes a large byte buffer at a given offset in a file using MPI.
This function splits the transfer into chunks of at most 1 GiB and delegates each chunk to write_at<u8>. Use this instead of write_at when len may exceed the range safely representable as an MPI count (write_at narrows len to int).
| fh | MPI file handle |
| buf | pointer to the bytes to be written |
| len | number of bytes to write |
| file_head_ptr | offset in the file where the data should be written |
|
inline |
|
inline |
|
inline |