SDDSlib
|
Implementation of SDDS MPI Functions. More...
Go to the source code of this file.
Functions | |
int32_t | SDDS_SetDefaultReadBufferSize (int32_t newSize) |
Set the default read buffer size for SDDS. | |
int32_t | SDDS_SetDefaultWriteBufferSize (int32_t newSize) |
Set the default write buffer size for SDDS. | |
int32_t | SDDS_SetDefaultTitleBufferSize (int32_t newSize) |
Set the default title buffer size for SDDS. | |
int32_t | SDDS_CheckStringTruncated (void) |
Check the number of truncated strings. | |
void | SDDS_StringTuncated (void) |
Increment the truncated strings counter. | |
int32_t | SDDS_SetDefaultStringLength (int32_t newValue) |
Set the default string length for SDDS. | |
int32_t | SDDS_MPI_WriteBinaryPage (SDDS_DATASET *SDDS_dataset) |
Write an SDDS binary page using MPI. | |
int32_t | SDDS_MPI_WriteBinaryString (SDDS_DATASET *SDDS_dataset, char *string) |
Write a binary string to an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_WriteNonNativeBinaryString (SDDS_DATASET *SDDS_dataset, char *string) |
Write a non-native binary string to an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_WriteBinaryParameters (SDDS_DATASET *SDDS_dataset) |
Write binary parameters of an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_WriteNonNativeBinaryParameters (SDDS_DATASET *SDDS_dataset) |
Write non-native binary parameters of an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_WriteBinaryArrays (SDDS_DATASET *SDDS_dataset) |
Write binary arrays of an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_WriteNonNativeBinaryArrays (SDDS_DATASET *SDDS_dataset) |
Write non-native binary arrays of an SDDS dataset using MPI. | |
void | SDDS_MPI_SetWriteKludgeUsleep (long value) |
Set the write kludge usleep duration. | |
void | SDDS_MPI_SetFileSync (short value) |
Set the file synchronization flag. | |
int32_t | SDDS_MPI_WriteBinaryRow (SDDS_DATASET *SDDS_dataset, int64_t row) |
Write a binary row to an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_WriteNonNativeBinaryRow (SDDS_DATASET *SDDS_dataset, int64_t row) |
Write a non-native binary row to an SDDS dataset using MPI. | |
MPI_Offset | SDDS_MPI_Get_Column_Size (SDDS_DATASET *SDDS_dataset) |
Get the total size of all columns in an SDDS dataset. | |
int32_t | SDDS_MPI_BufferedWrite (void *target, int64_t targetSize, SDDS_DATASET *SDDS_dataset) |
Buffered write to an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_BufferedWriteAll (void *target, int64_t targetSize, SDDS_DATASET *SDDS_dataset) |
Buffered write all to an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_FlushBuffer (SDDS_DATASET *SDDS_dataset) |
Flush the buffer by writing any remaining data to the MPI file. | |
int64_t | SDDS_MPI_CountRowsOfInterest (SDDS_DATASET *SDDS_dataset, int64_t start_row, int64_t end_row) |
Count the number of rows marked as "of interest" within a specified range. | |
int64_t | SDDS_MPI_GetTotalRows (SDDS_DATASET *SDDS_dataset) |
Get the total number of rows across all MPI processes. | |
int32_t | SDDS_MPI_WriteNonNativeBinaryPage (SDDS_DATASET *SDDS_dataset) |
Write a non-native binary page of the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_WriteContinuousBinaryPage (SDDS_DATASET *SDDS_dataset) |
Write a continuous binary page of the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_BufferedRead (void *target, int64_t targetSize, SDDS_DATASET *SDDS_dataset, SDDS_FILEBUFFER *fBuffer) |
Buffered read from an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_BufferedReadAll (void *target, int64_t targetSize, SDDS_DATASET *SDDS_dataset, SDDS_FILEBUFFER *fBuffer) |
Buffered read all from an SDDS dataset using MPI. | |
char * | SDDS_MPI_ReadBinaryString (SDDS_DATASET *SDDS_dataset, SDDS_FILEBUFFER *fBuffer, int32_t skip) |
Read a binary string from the SDDS dataset using MPI. | |
char * | SDDS_MPI_ReadNonNativeBinaryString (SDDS_DATASET *SDDS_dataset, SDDS_FILEBUFFER *fBuffer, int32_t skip) |
Read a non-native binary string from the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_ReadBinaryParameters (SDDS_DATASET *SDDS_dataset, SDDS_FILEBUFFER *fBuffer) |
Read binary parameters from the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_ReadBinaryRow (SDDS_DATASET *SDDS_dataset, int64_t row, int32_t skip) |
Read a binary row from the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_ReadBinaryArrays (SDDS_DATASET *SDDS_dataset, SDDS_FILEBUFFER *fBuffer) |
Read binary arrays from the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_ReadNonNativeBinaryParameters (SDDS_DATASET *SDDS_dataset, SDDS_FILEBUFFER *fBuffer) |
Read non-native binary parameters from the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_ReadNonNativeBinaryArrays (SDDS_DATASET *SDDS_dataset, SDDS_FILEBUFFER *fBuffer) |
Reads non-native binary arrays from a binary file buffer into the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_ReadNonNativeBinaryRow (SDDS_DATASET *SDDS_dataset, int64_t row, int32_t skip) |
Reads a single non-native binary row from a binary file buffer into the SDDS dataset using MPI. | |
int32_t | SDDS_MPI_BroadcastTitleData (SDDS_DATASET *SDDS_dataset) |
Broadcasts the title data (parameters and arrays) of the SDDS dataset to all MPI processes. | |
int32_t | SDDS_MPI_ReadBinaryPage (SDDS_DATASET *SDDS_dataset) |
Reads a binary page from an SDDS dataset using MPI parallel I/O. | |
int32_t | SDDS_MPI_ReadNonNativePage (SDDS_DATASET *SDDS_dataset) |
Reads a non-native binary page from an SDDS dataset using MPI parallel I/O. | |
int32_t | SDDS_MPI_ReadNonNativePageSparse (SDDS_DATASET *SDDS_dataset, uint32_t mode) |
Reads a sparse non-native binary page from an SDDS dataset using MPI parallel I/O. | |
int32_t | SDDS_MPI_ReadNonNativeBinaryPage (SDDS_DATASET *SDDS_dataset) |
Reads a non-native binary page from an SDDS dataset using MPI parallel I/O. | |
int32_t | SDDS_MPI_BufferedReadNonNativeBinaryTitle (SDDS_DATASET *SDDS_dataset) |
Buffers and reads the non-native binary title data from an SDDS dataset using MPI. | |
MPI_Offset | SDDS_MPI_GetTitleOffset (SDDS_DATASET *SDDS_dataset) |
Calculates the byte offset for the title section in a non-native binary SDDS dataset. | |
int32_t | SDDS_MPI_BufferedReadBinaryTitle (SDDS_DATASET *SDDS_dataset) |
Buffers and reads the binary title data from an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_CollectiveWriteByRow (SDDS_DATASET *SDDS_dataset) |
Writes SDDS dataset rows collectively by row using MPI parallel I/O. | |
int32_t | SDDS_MPI_CollectiveWriteNonNativeByRow (SDDS_DATASET *SDDS_dataset) |
Writes non-native binary SDDS dataset rows collectively by row using MPI parallel I/O. | |
int32_t | SDDS_MPI_CollectiveReadByRow (SDDS_DATASET *SDDS_dataset) |
Reads SDDS dataset rows collectively by row using MPI parallel I/O. | |
Variables | |
static int32_t | defaultStringLength = SDDS_MPI_STRING_COLUMN_LEN |
static int32_t | number_of_string_truncated = 0 |
static int32_t | defaultTitleBufferSize = 2400000 |
static int32_t | defaultReadBufferSize = 4000000 |
static int32_t | defaultWriteBufferSize = 0 |
static long | SDDS_MPI_write_kludge_usleep = 0 |
static short | SDDS_MPI_force_file_sync = 0 |
Implementation of SDDS MPI Functions.
This source file contains the implementation of functions responsible for reading SDDS (Self Describing Data Set) datasets in binary format using MPI (Message Passing Interface). It handles both native and non-native byte orders, ensuring compatibility across different machine architectures. The functions manage buffer operations, memory allocation, and MPI communication to facilitate efficient and accurate data retrieval in parallel processing environments.
Definition in file SDDS_MPI_binary.c.
int32_t SDDS_CheckStringTruncated | ( | void | ) |
Check the number of truncated strings.
This function returns the number of strings that have been truncated due to exceeding the default string length.
Definition at line 103 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_BroadcastTitleData | ( | SDDS_DATASET * | SDDS_dataset | ) |
Broadcasts the title data (parameters and arrays) of the SDDS dataset to all MPI processes.
This function gathers the title data from the master process and broadcasts it to all other MPI processes. It handles the total number of rows, parameters, and array definitions, ensuring that each process has consistent dataset metadata.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the title data to broadcast. |
Definition at line 1784 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_BufferedRead | ( | void * | target, |
int64_t | targetSize, | ||
SDDS_DATASET * | SDDS_dataset, | ||
SDDS_FILEBUFFER * | fBuffer ) |
Buffered read from an SDDS dataset using MPI.
This function reads data from the SDDS dataset using a buffer. It handles cases where sufficient data is already in the buffer and cases where additional data needs to be read from the MPI file. It also manages end-of-file conditions.
target | Pointer to the buffer where the read data will be stored. |
targetSize | The size of the data to read, in bytes. |
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
fBuffer | Pointer to the SDDS_FILEBUFFER structure managing the buffer. |
1
on successful read.0
on partial read or failure.-1
if end-of-file is reached. Definition at line 1160 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_BufferedReadAll | ( | void * | target, |
int64_t | targetSize, | ||
SDDS_DATASET * | SDDS_dataset, | ||
SDDS_FILEBUFFER * | fBuffer ) |
Buffered read all from an SDDS dataset using MPI.
This function reads all requested data from the SDDS dataset using a buffer, ensuring that the entire requested data is read unless end-of-file is reached. It handles buffer management and MPI collective I/O operations.
target | Pointer to the buffer where the read data will be stored. |
targetSize | The size of the data to read, in bytes. |
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
fBuffer | Pointer to the SDDS_FILEBUFFER structure managing the buffer. |
1
on successful read of all requested data.0
on partial read or failure.-1
if end-of-file is reached. Definition at line 1261 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_BufferedReadBinaryTitle | ( | SDDS_DATASET * | SDDS_dataset | ) |
Buffers and reads the binary title data from an SDDS dataset using MPI.
This function initializes and manages a buffered read for the title section of a native binary SDDS dataset. It reads the total number of rows, parameters, and arrays from the binary file buffer. The function handles memory allocation for the buffer and initializes the SDDS page structure.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the title data will be stored. |
1
on successful read, 0
on failure, and -1
if the end of the file is reached. Definition at line 2399 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_BufferedReadNonNativeBinaryTitle | ( | SDDS_DATASET * | SDDS_dataset | ) |
Buffers and reads the non-native binary title data from an SDDS dataset using MPI.
This function initializes and manages a buffered read for the title section of a non-native binary SDDS dataset. It reads the total number of rows, parameters, and arrays from the binary file buffer. The function handles memory allocation for the buffer, byte swapping for endianness, and initializes the SDDS page structure.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the title data will be stored. |
1
on successful read, 0
on failure, and -1
if the end of the file is reached. Definition at line 2283 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_BufferedWrite | ( | void * | target, |
int64_t | targetSize, | ||
SDDS_DATASET * | SDDS_dataset ) |
Buffered write to an SDDS dataset using MPI.
This function writes data to the SDDS dataset using a buffer. If the buffer has sufficient space, the data is copied into the buffer. Otherwise, the buffer is flushed to the file, and the new data is either written directly or stored in the buffer.
target | Pointer to the data to write. |
targetSize | The size of the data to write, in bytes. |
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
Definition at line 611 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_BufferedWriteAll | ( | void * | target, |
int64_t | targetSize, | ||
SDDS_DATASET * | SDDS_dataset ) |
Buffered write all to an SDDS dataset using MPI.
This function writes all data to the SDDS dataset using a buffer, ensuring that all data is written even if the buffer needs to be flushed multiple times.
target | Pointer to the data to write. |
targetSize | The size of the data to write, in bytes. |
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
Definition at line 683 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_CollectiveReadByRow | ( | SDDS_DATASET * | SDDS_dataset | ) |
Reads SDDS dataset rows collectively by row using MPI parallel I/O.
This function performs a collective read operation where each MPI process reads its assigned rows of the SDDS dataset. It handles buffering of row data, ensures synchronization among MPI processes, and manages error handling. The function supports only binary string types for non-string data and flushes the buffer upon completion.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the data will be stored. |
1
on successful read, 0
on failure. Definition at line 2581 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_CollectiveWriteByRow | ( | SDDS_DATASET * | SDDS_dataset | ) |
Writes SDDS dataset rows collectively by row using MPI parallel I/O.
This function performs a collective write operation where each MPI process writes its assigned rows of the SDDS dataset. It handles buffering of row data, ensures synchronization among MPI processes, and manages error handling. The function supports only binary string types for non-string data and flushes the buffer upon completion.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the data to be written. |
1
on successful write, 0
on failure. Definition at line 2459 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_CollectiveWriteNonNativeByRow | ( | SDDS_DATASET * | SDDS_dataset | ) |
Writes non-native binary SDDS dataset rows collectively by row using MPI parallel I/O.
This function performs a collective write operation for non-native binary SDDS datasets, where each MPI process writes its assigned rows. It handles buffering of row data, ensures synchronization among MPI processes, and manages error handling. The function supports only binary string types for non-string data and flushes the buffer upon completion.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the data to be written. |
1
on successful write, 0
on failure. Definition at line 2520 of file SDDS_MPI_binary.c.
int64_t SDDS_MPI_CountRowsOfInterest | ( | SDDS_DATASET * | SDDS_dataset, |
int64_t | start_row, | ||
int64_t | end_row ) |
Count the number of rows marked as "of interest" within a specified range.
This function iterates through the rows of the SDDS dataset from start_row
to end_row
and counts how many rows have their row_flag
set to indicate they are of interest.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
start_row | The starting row index (inclusive) to begin counting. |
end_row | The ending row index (exclusive) to stop counting. |
Definition at line 800 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_FlushBuffer | ( | SDDS_DATASET * | SDDS_dataset | ) |
Flush the buffer by writing any remaining data to the MPI file.
This function ensures that any data remaining in the buffer is written to the MPI file. It handles error checking and resets the buffer pointers upon successful write.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
1
on successful flush.0
on failure. Definition at line 755 of file SDDS_MPI_binary.c.
MPI_Offset SDDS_MPI_Get_Column_Size | ( | SDDS_DATASET * | SDDS_dataset | ) |
Get the total size of all columns in an SDDS dataset.
This function calculates the total size in bytes required to store all columns of the SDDS dataset in binary format. For string columns, it includes space for the string length and the fixed maximum string length.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
Definition at line 582 of file SDDS_MPI_binary.c.
MPI_Offset SDDS_MPI_GetTitleOffset | ( | SDDS_DATASET * | SDDS_dataset | ) |
Calculates the byte offset for the title section in a non-native binary SDDS dataset.
This function computes the total byte offset required to read the number of rows, parameters, and arrays defined in the SDDS dataset. It accounts for different data types, including strings, and variable-length parameters and arrays. The calculated offset is used to position the MPI file view correctly for reading.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the dataset layout and data. |
Definition at line 2345 of file SDDS_MPI_binary.c.
int64_t SDDS_MPI_GetTotalRows | ( | SDDS_DATASET * | SDDS_dataset | ) |
Get the total number of rows across all MPI processes.
This function uses MPI_Reduce to sum the number of rows (n_rows
) from all processes and returns the total number of rows to the root process (process 0).
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
Definition at line 820 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadBinaryArrays | ( | SDDS_DATASET * | SDDS_dataset, |
SDDS_FILEBUFFER * | fBuffer ) |
Read binary arrays from the SDDS dataset using MPI.
This function reads all arrays defined in the SDDS dataset in binary format using MPI. It handles reading array dimensions, allocating memory for array data, and reading the actual array data. For string arrays, it reads each string individually.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
fBuffer | Pointer to the SDDS_FILEBUFFER structure managing the buffer. |
1
on successful read of all arrays.0
on failure to read any part of the arrays. Definition at line 1523 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadBinaryPage | ( | SDDS_DATASET * | SDDS_dataset | ) |
Reads a binary page from an SDDS dataset using MPI parallel I/O.
This function reads a page of data from a binary SDDS file in parallel using MPI. It handles reading the page title, distributing the rows among MPI processes, and reading the column or row data depending on the dataset's data mode. It also manages error handling and supports read recovery.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the page data will be stored. |
Definition at line 1891 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadBinaryParameters | ( | SDDS_DATASET * | SDDS_dataset, |
SDDS_FILEBUFFER * | fBuffer ) |
Read binary parameters from the SDDS dataset using MPI.
This function reads all non-fixed parameters from the SDDS dataset in binary format using MPI. It iterates through each parameter, handling string parameters by reading them as binary strings, and other types by reading their binary representations directly into the dataset's parameter storage.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
fBuffer | Pointer to the SDDS_FILEBUFFER structure managing the buffer. |
1
on successful read of all parameters.0
on failure to read any parameter. Definition at line 1420 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadBinaryRow | ( | SDDS_DATASET * | SDDS_dataset, |
int64_t | row, | ||
int32_t | skip ) |
Read a binary row from the SDDS dataset using MPI.
This function reads a specific row of data from the SDDS dataset in binary format using MPI. It handles different column types, including strings and fixed-size data types. If the skip
parameter is set, string data is read and discarded.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
row | The row index to read. |
skip | If non-zero, string data in the row is read but not stored. |
1
on successful read of the row.0
on failure to read any part of the row. Definition at line 1471 of file SDDS_MPI_binary.c.
char * SDDS_MPI_ReadBinaryString | ( | SDDS_DATASET * | SDDS_dataset, |
SDDS_FILEBUFFER * | fBuffer, | ||
int32_t | skip ) |
Read a binary string from the SDDS dataset using MPI.
This function reads a string from the SDDS dataset in binary format using MPI. It first reads the length of the string, allocates memory for the string, and then reads the string data itself. If the skip
parameter is set, the string data is read and discarded.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
fBuffer | Pointer to the SDDS_FILEBUFFER structure managing the buffer. |
skip | If non-zero, the string data is read and skipped (not stored). |
0
if reading the length fails or if the length is negative.NULL
if memory allocation fails or reading the string data fails. Definition at line 1361 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadNonNativeBinaryArrays | ( | SDDS_DATASET * | SDDS_dataset, |
SDDS_FILEBUFFER * | fBuffer ) |
Reads non-native binary arrays from a binary file buffer into the SDDS dataset using MPI.
This function validates the provided SDDS dataset and reads array definitions and data from a non-native binary file buffer. It handles byte swapping for endianness, allocates memory for array dimensions and data, and processes string arrays individually.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the arrays will be stored. |
[in] | fBuffer | Pointer to the SDDS_FILEBUFFER structure containing the binary data to be read. |
Definition at line 1654 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadNonNativeBinaryPage | ( | SDDS_DATASET * | SDDS_dataset | ) |
Reads a non-native binary page from an SDDS dataset using MPI parallel I/O.
This function reads a page of data from a non-native binary SDDS file in parallel using MPI. It manages reading the title data, distributing the rows among MPI processes, and reading the column or row data depending on the dataset's data mode. It also handles byte swapping for endianness and error management.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the page data will be stored. |
Definition at line 2115 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadNonNativeBinaryParameters | ( | SDDS_DATASET * | SDDS_dataset, |
SDDS_FILEBUFFER * | fBuffer ) |
Read non-native binary parameters from the SDDS dataset using MPI.
This function reads all non-fixed parameters from the SDDS dataset in non-native binary format using MPI. It handles byte swapping for parameter data to match the non-native byte order. String parameters are read as non-native binary strings, and other types are read directly into the dataset's parameter storage.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
fBuffer | Pointer to the SDDS_FILEBUFFER structure managing the buffer. |
1
on successful read of all parameters.0
on failure to read any parameter. Definition at line 1606 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadNonNativeBinaryRow | ( | SDDS_DATASET * | SDDS_dataset, |
int64_t | row, | ||
int32_t | skip ) |
Reads a single non-native binary row from a binary file buffer into the SDDS dataset using MPI.
This function reads the data for a specific row from the binary file buffer. It handles different data types, including strings, and can optionally skip reading the row data. If skipping, it advances the file buffer without storing the data.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the row data will be stored. |
[in] | row | The index of the row to read. |
[in] | skip | If non-zero, the function will skip reading the row data without storing it. |
Definition at line 1735 of file SDDS_MPI_binary.c.
char * SDDS_MPI_ReadNonNativeBinaryString | ( | SDDS_DATASET * | SDDS_dataset, |
SDDS_FILEBUFFER * | fBuffer, | ||
int32_t | skip ) |
Read a non-native binary string from the SDDS dataset using MPI.
This function reads a string from the SDDS dataset in non-native binary format using MPI. It handles byte swapping for the string length to match the non-native byte order. After reading the length, it allocates memory for the string and reads the string data. If the skip
parameter is set, the string data is read and discarded.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
fBuffer | Pointer to the SDDS_FILEBUFFER structure managing the buffer. |
skip | If non-zero, the string data is read and skipped (not stored). |
0
if reading the length fails or if the length is negative.NULL
if memory allocation fails or reading the string data fails. Definition at line 1390 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadNonNativePage | ( | SDDS_DATASET * | SDDS_dataset | ) |
Reads a non-native binary page from an SDDS dataset using MPI parallel I/O.
This function is a wrapper that calls SDDS_MPI_ReadNonNativePageSparse with mode set to 0, facilitating the reading of non-native binary pages.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the page data will be stored. |
Definition at line 2063 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_ReadNonNativePageSparse | ( | SDDS_DATASET * | SDDS_dataset, |
uint32_t | mode ) |
Reads a sparse non-native binary page from an SDDS dataset using MPI parallel I/O.
This function reads a page of data from a non-native binary SDDS file in parallel using MPI. The mode
parameter allows for future expansion. It handles reading the title data, broadcasting it to all MPI processes, and reading the column or row data based on the dataset's data mode.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure where the page data will be stored. |
[in] | mode | Mode flag to support future expansion (currently unused). |
Definition at line 2078 of file SDDS_MPI_binary.c.
void SDDS_MPI_SetFileSync | ( | short | value | ) |
Set the file synchronization flag.
This function enables or disables forced file synchronization after writing binary rows. This can help prevent data corruption by ensuring data is flushed to the file system.
value | A short integer where non-zero enables file synchronization, and zero disables it. |
Definition at line 437 of file SDDS_MPI_binary.c.
void SDDS_MPI_SetWriteKludgeUsleep | ( | long | value | ) |
Set the write kludge usleep duration.
This function sets the duration (in microseconds) for the write kludge sleep operation. This is used to fix write issues in certain test cases by introducing a delay after writing a binary row.
value | The number of microseconds to sleep after writing a row. |
Definition at line 422 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteBinaryArrays | ( | SDDS_DATASET * | SDDS_dataset | ) |
Write binary arrays of an SDDS dataset using MPI.
This function writes all arrays of the SDDS dataset in binary format using MPI. It handles different types of arrays, including strings and fixed-size data types.
Only the master processor should call this function to write SDDS headers, parameters, and arrays.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
Definition at line 310 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteBinaryPage | ( | SDDS_DATASET * | SDDS_dataset | ) |
Write an SDDS binary page using MPI.
This function writes an SDDS dataset as a binary page using MPI. If MPI_DEBUG is enabled, it logs debugging information.
SDDS_dataset | Pointer to the SDDS_DATASET structure to write. |
Definition at line 144 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteBinaryParameters | ( | SDDS_DATASET * | SDDS_dataset | ) |
Write binary parameters of an SDDS dataset using MPI.
This function writes all non-fixed parameters of the SDDS dataset in binary format using MPI. String parameters are written using SDDS_MPI_WriteBinaryString, and other types are written directly to the buffer.
Only the master processor should call this function to write SDDS headers, parameters, and arrays.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
Definition at line 226 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteBinaryRow | ( | SDDS_DATASET * | SDDS_dataset, |
int64_t | row ) |
Write a binary row to an SDDS dataset using MPI.
This function writes a specific row of data from the SDDS dataset in binary format using MPI. It handles different column types, including strings with truncation based on the default string length. Optional write kludge delays and file synchronization can be applied based on configuration.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
row | The row index to write. |
Definition at line 453 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteBinaryString | ( | SDDS_DATASET * | SDDS_dataset, |
char * | string ) |
Write a binary string to an SDDS dataset using MPI.
This function writes a string to the SDDS dataset in binary format using MPI. If the provided string is NULL, a dummy empty string is written instead.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
string | The string to write. If NULL, an empty string is written. |
Definition at line 162 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteContinuousBinaryPage | ( | SDDS_DATASET * | SDDS_dataset | ) |
Write a continuous binary page of the SDDS dataset using MPI.
This function writes an SDDS dataset page in binary format, handling both native and non-native byte orders based on the environment variable SDDS_OUTPUT_ENDIANESS
. It manages buffer allocation, byte swapping, and coordinates writing across MPI processes.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
1
on successful write.0
on failure. Definition at line 997 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteNonNativeBinaryArrays | ( | SDDS_DATASET * | SDDS_dataset | ) |
Write non-native binary arrays of an SDDS dataset using MPI.
This function writes all arrays of the SDDS dataset in non-native binary format using MPI, handling byte swapping as necessary. It handles different types of arrays, including strings and fixed-size data types.
Only the master processor should call this function to write SDDS headers, parameters, and arrays.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
Definition at line 364 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteNonNativeBinaryPage | ( | SDDS_DATASET * | SDDS_dataset | ) |
Write a non-native binary page of the SDDS dataset using MPI.
This function handles the writing of an entire SDDS dataset page in non-native binary format. It manages buffer allocation, handles byte swapping for non-native formats, and ensures that all parameters and arrays are correctly written. It also coordinates writing across multiple MPI processes.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
1
on successful write.0
on failure. Definition at line 839 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteNonNativeBinaryParameters | ( | SDDS_DATASET * | SDDS_dataset | ) |
Write non-native binary parameters of an SDDS dataset using MPI.
This function writes all non-fixed parameters of the SDDS dataset in non-native binary format using MPI, handling byte swapping as necessary. String parameters are written using SDDS_MPI_WriteNonNativeBinaryString, and other types are written directly to the buffer.
Only the master processor should call this function to write SDDS headers, parameters, and arrays.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
Definition at line 266 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteNonNativeBinaryRow | ( | SDDS_DATASET * | SDDS_dataset, |
int64_t | row ) |
Write a non-native binary row to an SDDS dataset using MPI.
This function writes a specific row of data from the SDDS dataset in non-native binary format using MPI, handling byte swapping as necessary. It manages different column types, including strings with truncation based on the default string length. Optional write kludge delays and file synchronization can be applied based on configuration.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
row | The row index to write. |
Definition at line 519 of file SDDS_MPI_binary.c.
int32_t SDDS_MPI_WriteNonNativeBinaryString | ( | SDDS_DATASET * | SDDS_dataset, |
char * | string ) |
Write a non-native binary string to an SDDS dataset using MPI.
This function writes a string to the SDDS dataset in non-native binary format using MPI, handling byte swapping as necessary. If the provided string is NULL, a dummy empty string is written instead.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
string | The string to write. If NULL, an empty string is written. |
Definition at line 192 of file SDDS_MPI_binary.c.
int32_t SDDS_SetDefaultReadBufferSize | ( | int32_t | newSize | ) |
Set the default read buffer size for SDDS.
This function updates the default buffer size used for reading SDDS binary data.
newSize | The new buffer size to set. Must be greater than zero. If newSize is less than or equal to zero, the current default read buffer size is returned without modifying it. |
Definition at line 48 of file SDDS_MPI_binary.c.
int32_t SDDS_SetDefaultStringLength | ( | int32_t | newValue | ) |
Set the default string length for SDDS.
This function updates the default maximum length for string columns in SDDS.
newValue | The new string length to set. Must be non-negative. If newValue is negative, the current default string length is returned without modifying it. |
Definition at line 126 of file SDDS_MPI_binary.c.
int32_t SDDS_SetDefaultTitleBufferSize | ( | int32_t | newSize | ) |
Set the default title buffer size for SDDS.
This function updates the default buffer size used for storing SDDS titles.
newSize | The new buffer size to set. Must be greater than zero. If newSize is less than or equal to zero, the current default title buffer size is returned without modifying it. |
Definition at line 86 of file SDDS_MPI_binary.c.
int32_t SDDS_SetDefaultWriteBufferSize | ( | int32_t | newSize | ) |
Set the default write buffer size for SDDS.
This function updates the default buffer size used for writing SDDS binary data.
newSize | The new buffer size to set. Must be greater than zero. If newSize is less than or equal to zero, the current default write buffer size is returned without modifying it. |
Definition at line 67 of file SDDS_MPI_binary.c.
void SDDS_StringTuncated | ( | void | ) |
Increment the truncated strings counter.
This function increments the count of strings that have been truncated.
Definition at line 112 of file SDDS_MPI_binary.c.
|
static |
Definition at line 31 of file SDDS_MPI_binary.c.
|
static |
Definition at line 28 of file SDDS_MPI_binary.c.
|
static |
Definition at line 30 of file SDDS_MPI_binary.c.
|
static |
Definition at line 32 of file SDDS_MPI_binary.c.
|
static |
Definition at line 29 of file SDDS_MPI_binary.c.
|
static |
Definition at line 426 of file SDDS_MPI_binary.c.
|
static |
Definition at line 412 of file SDDS_MPI_binary.c.