SpM Handbook 1.2.4
Loading...
Searching...
No Matches
spm_io.c File Reference
#include "common.h"

Go to the source code of this file.

Functions

static int readArrayOfInteger (FILE *stream, spm_int_t n, spm_int_t *array)
 Read an array of integer.
 
static int readArrayOfComplex64 (FILE *stream, spm_int_t n, spm_complex64_t *array)
 Read an array of 64bits complex.
 
static int readArrayOfComplex32 (FILE *stream, spm_int_t n, spm_complex32_t *array)
 Read an array of 32bits complex.
 
static int readArrayOfDouble (FILE *stream, spm_int_t n, double *array)
 Read an array of double.
 
static int readArrayOfFloat (FILE *stream, spm_int_t n, float *array)
 Read an array of float.
 
static int spm_load_local (spmatrix_t *spm, const char *filename)
 Load the spm structure from a file (internal format). One node only.
 
static int writeArrayOfComplex64 (FILE *outfile, spm_int_t n, const spm_complex64_t *array)
 write an array of 64bits complex.
 
static int writeArrayOfComplex32 (FILE *outfile, spm_int_t n, const spm_complex32_t *array)
 write an array of 32bits complex.
 
static int writeArrayOfDouble (FILE *outfile, spm_int_t n, const double *array)
 write an array of double.
 
static int writeArrayOfFloat (FILE *outfile, spm_int_t n, const float *array)
 write an array of float.
 
static int spm_save_local (const spmatrix_t *spm, const char *filename)
 Save the global spm structure into a file (internal format).
 
SPM IO subroutines
int spmLoadDist (spmatrix_t *spm, const char *filename, SPM_Comm comm)
 Load the spm structure from a file (internal format).
 
int spmLoad (spmatrix_t *spm, const char *filename)
 Load the spm structure from a file (internal format).
 
int spmSave (const spmatrix_t *spm, const char *filename)
 Save the spm structure into a file (internal format).
 

Detailed Description

SParse Matrix package I/O routines.

Version
1.2.4
Author
Pierre Ramet
Mathieu Faverge
Matias Hastaran
Tony Delarue
Alycia Lisito
Date
2024-06-26

Definition in file spm_io.c.

Function Documentation

◆ readArrayOfInteger()

static int readArrayOfInteger ( FILE *  stream,
spm_int_t  n,
spm_int_t array 
)
static

Read an array of integer.

Parameters
[in]streamThe opened file in which the spm is stored.
[in]nNumber of elements.
[out]arrayArray of results.
Return values
SPM_SUCCESSif the read happened successfully,
SPM_ERR_FILEif the input format is incorrect.

Definition at line 46 of file spm_io.c.

References SPM_ERR_FILE, and SPM_SUCCESS.

Referenced by spm_load_local().

◆ readArrayOfComplex64()

static int readArrayOfComplex64 ( FILE *  stream,
spm_int_t  n,
spm_complex64_t *  array 
)
static

Read an array of 64bits complex.

Parameters
[in]streamThe opened file in which the spm is stored.
[in]nNumber of elements.
[out]arrayArray of results.
Return values
SPM_SUCCESSif the read happened successfully,
SPM_ERR_FILEif the input format is incorrect.

Definition at line 127 of file spm_io.c.

References SPM_ERR_FILE, and SPM_SUCCESS.

Referenced by spm_load_local().

◆ readArrayOfComplex32()

static int readArrayOfComplex32 ( FILE *  stream,
spm_int_t  n,
spm_complex32_t array 
)
static

Read an array of 32bits complex.

Parameters
[in]streamThe opened file in which the spm is stored.
[in]nNumber of elements.
[out]arrayArray of results.
Return values
SPM_SUCCESSif the read happened successfully,
SPM_ERR_FILEif the input format is incorrect.

Definition at line 213 of file spm_io.c.

References SPM_ERR_FILE, and SPM_SUCCESS.

Referenced by spm_load_local().

◆ readArrayOfDouble()

static int readArrayOfDouble ( FILE *  stream,
spm_int_t  n,
double *  array 
)
static

Read an array of double.

Parameters
[in]streamThe opened file in which the spm is stored.
[in]nNumber of elements.
[out]arrayArray of results.
Return values
SPM_SUCCESSif the read happened successfully,
SPM_ERR_FILEif the input format is incorrect.

Definition at line 299 of file spm_io.c.

References SPM_ERR_FILE, and SPM_SUCCESS.

Referenced by spm_load_local().

◆ readArrayOfFloat()

static int readArrayOfFloat ( FILE *  stream,
spm_int_t  n,
float *  array 
)
static

Read an array of float.

Parameters
[in]streamThe opened file in which the spm is stored.
[in]nNumber of elements.
[out]arrayArray of results.
Return values
SPM_SUCCESSif the read happened successfully,
SPM_ERR_FILEif the input format is incorrect.

Definition at line 383 of file spm_io.c.

References SPM_ERR_FILE, and SPM_SUCCESS.

Referenced by spm_load_local().

◆ writeArrayOfComplex64()

static int writeArrayOfComplex64 ( FILE *  outfile,
spm_int_t  n,
const spm_complex64_t *  array 
)
static

write an array of 64bits complex.

Parameters
[in]outfileThe opened file in which to store the spm.
[in]nnumbers of elements.
[in]arrayarray to write.
Returns
SPM_SUCCESS if the write happened successfully.

Definition at line 779 of file spm_io.c.

References SPM_SUCCESS.

Referenced by spm_save_local().

◆ writeArrayOfComplex32()

static int writeArrayOfComplex32 ( FILE *  outfile,
spm_int_t  n,
const spm_complex32_t array 
)
static

write an array of 32bits complex.

Parameters
[in]outfileThe opened file in which to store the spm.
[in]nnumbers of elements.
[in]arrayarray to write.
Returns
SPM_SUCCESS if the write happened successfully.

Definition at line 820 of file spm_io.c.

References SPM_SUCCESS.

Referenced by spm_save_local().

◆ writeArrayOfDouble()

static int writeArrayOfDouble ( FILE *  outfile,
spm_int_t  n,
const double *  array 
)
static

write an array of double.

Parameters
[in]outfileThe opened file in which to store the spm.
[in]nnumbers of elements.
[in]arrayarray to write.
Returns
SPM_SUCCESS if the write happened successfully.

Definition at line 861 of file spm_io.c.

References SPM_SUCCESS.

Referenced by spm_save_local().

◆ writeArrayOfFloat()

static int writeArrayOfFloat ( FILE *  outfile,
spm_int_t  n,
const float *  array 
)
static

write an array of float.

Parameters
[in]outfileThe opened file in which to store the spm.
[in]nnumbers of elements.
[in]arrayarray to write.
Returns
SPM_SUCCESS if the write happened successfully.

Definition at line 902 of file spm_io.c.

References SPM_SUCCESS.

Referenced by spm_save_local().