SDDSlib
|
SDDS MPI Input Initialization and Data Broadcasting Functions. More...
Go to the source code of this file.
Classes | |
struct | ELEMENT_DEF |
Structure defining an element with various attributes. More... | |
struct | ASSOCIATE_DEF |
Structure defining an associate with various attributes. More... | |
struct | OTHER_DEF |
Structure defining additional layout information. More... | |
struct | STRING_DEF |
Structure defining a string with fixed maximum length. More... | |
Macros | |
#define | STRING_COL_LENGTH 40 |
Defines the maximum length of strings in arrays or columns. | |
Functions | |
int32_t | SDDS_MPI_ReadPage (SDDS_DATASET *SDDS_dataset) |
Reads a page from an SDDS dataset using MPI. | |
int32_t | SDDS_MPI_BroadcastLayout (SDDS_DATASET *SDDS_dataset) |
Broadcasts the layout of an SDDS dataset to all MPI processes. | |
int32_t | SDDS_MPI_InitializeInput (SDDS_DATASET *SDDS_dataset, char *filename) |
Initializes an SDDS dataset for input using MPI. | |
int32_t | SDDS_MPI_InitializeInputFromSearchPath (SDDS_DATASET *SDDS_dataset, char *file) |
Initializes an SDDS dataset for input by searching the provided search path using MPI. | |
int32_t | SDDS_Master_InitializeInputFromSearchPath (SDDS_DATASET *SDDS_dataset, MPI_DATASET *MPI_dataset, char *file) |
Initializes an SDDS dataset for input from a search path on the master MPI process. | |
int32_t | SDDS_Master_InitializeInput (SDDS_DATASET *SDDS_dataset, MPI_DATASET *MPI_dataset, char *file) |
Initializes an SDDS dataset for input on the master MPI process. | |
int32_t | SDDS_Master_ReadPage (SDDS_DATASET *SDDS_dataset) |
Reads a single page of data from an SDDS dataset on the master MPI process and broadcasts it. | |
SDDS MPI Input Initialization and Data Broadcasting Functions.
This file implements the core functionalities for initializing and reading Self Describing Data Sets (SDDS) in a parallel computing environment using MPI. It includes definitions of essential data structures and functions that handle various data formats, manage layout information, and facilitate the broadcasting of data across multiple MPI processes.
Definition in file SDDSmpi_input.c.
#define STRING_COL_LENGTH 40 |
Defines the maximum length of strings in arrays or columns.
The string length in arrays or columns should be less than 40 characters.
Definition at line 95 of file SDDSmpi_input.c.
int32_t SDDS_Master_InitializeInput | ( | SDDS_DATASET * | SDDS_dataset, |
MPI_DATASET * | MPI_dataset, | ||
char * | file ) |
Initializes an SDDS dataset for input on the master MPI process.
This function initializes the SDDS_DATASET
structure for reading from a specified file using MPI. It is intended to be called by the master (root) process, which performs the dataset initialization and then broadcasts the layout to all other MPI processes. Non-master processes prepare their datasets based on the received layout information.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be initialized. |
[in] | MPI_dataset | Pointer to the MPI_DATASET structure containing MPI-related information such as the communicator and process ID. |
[in] | file | The name of the file to be opened and initialized for reading. |
1
on successful initialization and layout broadcast.0
if initialization fails or layout broadcasting fails.The function performs the following steps:
SDDS_InitializeInput
.SDDS_DATASET
structures to prepare for receiving the layout.parallel_io
flag to 0
and assigns the MPI_dataset
.SDDS_MPI_BroadcastLayout
.Definition at line 877 of file SDDSmpi_input.c.
int32_t SDDS_Master_InitializeInputFromSearchPath | ( | SDDS_DATASET * | SDDS_dataset, |
MPI_DATASET * | MPI_dataset, | ||
char * | file ) |
Initializes an SDDS dataset for input from a search path on the master MPI process.
This function is designed to be called by the master (root) process in an MPI environment. It searches for the specified file within the search paths, initializes the SDDS_DATASET
structure, and broadcasts the layout information to all other MPI processes. Non-master processes receive the broadcasted layout and prepare their datasets accordingly.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be initialized. |
[in] | MPI_dataset | Pointer to the MPI_DATASET structure containing MPI-related information such as the communicator and process ID. |
[in] | file | The name of the file to search for and initialize. The function searches for this file in the configured search paths. |
1
on successful initialization and layout broadcast.0
if the file is not found, initialization fails, or layout broadcasting fails.The function performs the following steps:
SDDS_InitializeInput
.SDDS_DATASET
structures to prepare for receiving the layout.parallel_io
flag to 0
and assigns the MPI_dataset
.SDDS_MPI_BroadcastLayout
.Definition at line 816 of file SDDSmpi_input.c.
int32_t SDDS_Master_ReadPage | ( | SDDS_DATASET * | SDDS_dataset | ) |
Reads a single page of data from an SDDS dataset on the master MPI process and broadcasts it.
This function is intended to be called by the master (root) MPI process. It reads a single page of data from the SDDS input file, counts the number of rows of interest, and then broadcasts the data to all other MPI processes. Non-master processes allocate memory for the received data and populate their datasets accordingly.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure from which the page will be read and into which the data will be stored. |
The function performs the following steps:
SDDS_ReadPage
.SDDS_CountRowsOfInterest
.Definition at line 928 of file SDDSmpi_input.c.
int32_t SDDS_MPI_BroadcastLayout | ( | SDDS_DATASET * | SDDS_dataset | ) |
Broadcasts the layout of an SDDS dataset to all MPI processes.
This function creates MPI data types for the layout structures, broadcasts the layout information from the root process to all other processes, and defines columns, parameters, arrays, and associates on non-root processes based on the received layout information. It ensures that all MPI processes have a consistent view of the dataset layout.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
1
on successful broadcast and layout definition.0
if an error occurs during memory allocation, MPI operations, or layout definition.The function performs the following steps:
Definition at line 171 of file SDDSmpi_input.c.
int32_t SDDS_MPI_InitializeInput | ( | SDDS_DATASET * | SDDS_dataset, |
char * | filename ) |
Initializes an SDDS dataset for input using MPI.
This function initializes the provided SDDS_DATASET
structure for reading data from a specified file. It handles various file formats, including plain, gzip, and LZMA-compressed files. The function sets up necessary layout information, allocates memory for columns and related structures, and prepares the dataset for parallel I/O operations using MPI.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be initialized. |
[in] | filename | The name of the file to be opened for reading. If filename is NULL , the function will attempt to read from the standard input (stdin ). |
1
on successful initialization.0
if an error occurs during initialization, such as memory allocation failures, file opening issues, or layout reading errors.The function performs the following steps:
SDDS_DATASET
structure..gz
, .lzma
, .xz
).MASTER_READTITLE_ONLY
is defined.MASTER_READTITLE_ONLY
is defined, only the root process reads the title.Definition at line 601 of file SDDSmpi_input.c.
int32_t SDDS_MPI_InitializeInputFromSearchPath | ( | SDDS_DATASET * | SDDS_dataset, |
char * | file ) |
Initializes an SDDS dataset for input by searching the provided search path using MPI.
This function searches for the specified file within predefined search paths and initializes the SDDS_DATASET
structure for reading using MPI. It leverages SDDS_MPI_InitializeInput
to perform the actual initialization once the file is found.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be initialized. |
[in] | file | The name of the file to search for and initialize. The function searches for this file in the configured search paths. |
1
on successful initialization.0
if the file is not found in the search paths or if initialization fails.The function performs the following steps:
findFileInSearchPath
.SDDS_MPI_InitializeInput
to initialize the dataset.Definition at line 767 of file SDDSmpi_input.c.
int32_t SDDS_MPI_ReadPage | ( | SDDS_DATASET * | SDDS_dataset | ) |
Reads a page from an SDDS dataset using MPI.
This function checks the validity of the provided SDDS dataset and ensures that the dataset is connected and in binary mode before attempting to read a page. If the dataset is in ASCII mode or disconnected, appropriate errors are set and the function returns 0. On successful reading of a binary page, the function returns 1.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
1
on successful page read.0
if the dataset is invalid, disconnected, in ASCII mode, or an unrecognized data mode.Definition at line 125 of file SDDSmpi_input.c.