LAMA
lama::StorageIO< T > Class Template Reference

#include <StorageIO.hpp>

Inheritance diagram for lama::StorageIO< T >:

Public Types

typedef T ValueType
 This is the type of the matrix values.

Static Public Member Functions

static void writeCSRToFile (const PartitionId size, const PartitionId rank, const LAMAArray< IndexType > &csrIA, const IndexType numColumns, const LAMAArray< IndexType > &csrJA, const LAMAArray< ValueType > &csrValues, const std::string &fileName, const File::FileType &fileType, const File::DataType &dataType, const File::IndexDataType indexDataTypeIA, const File::IndexDataType indexDataTypeJA)
 General version of writing CSR storage to a file.
static void writeCSRToFormattedFile (const LAMAArray< IndexType > &csrIA, const LAMAArray< IndexType > &csrJA, const LAMAArray< ValueType > &csrValues, const std::string &fileName)
static void writeCSRToBinaryFile (const LAMAArray< IndexType > &csrIA, const LAMAArray< IndexType > &csrJA, const LAMAArray< ValueType > &csrValues, const std::string &fileName, const long indexDataTypeSizeIA, const long indexDataTypeSizeJA, const long dataTypeSize)
static void writeCSRToXDRFile (const LAMAArray< IndexType > &csrIA, const LAMAArray< IndexType > &csrJA, const LAMAArray< ValueType > &csrValues, const std::string &fileName, const long indexDataTypeSizeIA, const long indexDataTypeSizeJA, const long dataTypeSize)
static void writeCSRToMMFile (const LAMAArray< IndexType > &csrIA, const IndexType numColumns, const LAMAArray< IndexType > &csrJA, const LAMAArray< ValueType > &csrValues, const std::string &fileName, const File::DataType &dataType)
static void readCSRFromFile (LAMAArray< IndexType > &csrIA, IndexType &numColumns, LAMAArray< IndexType > &csrJA, LAMAArray< ValueType > &csrValues, const std::string &fileName)
static void readCSRFromFormattedFile (LAMAArray< IndexType > &csrIA, LAMAArray< IndexType > &csrJA, LAMAArray< ValueType > &csrValues, const std::string &fileName, const IndexType numRows)
static void readCSRFromBinaryFile (LAMAArray< IndexType > &csrIA, LAMAArray< IndexType > &csrJA, LAMAArray< ValueType > &csrValues, const std::string &fileName, const IndexType numRows)
 Reading storage data from a binary file.
static void readCSRFromXDRFile (LAMAArray< IndexType > &csrIA, LAMAArray< IndexType > &csrJA, LAMAArray< ValueType > &csrValues, const std::string &fileName, const IndexType numRows)
static void readCSRFromMMFile (LAMAArray< IndexType > &csrIA, IndexType &numColumns, LAMAArray< IndexType > &csrJA, LAMAArray< ValueType > &csrValues, const std::string &fileName)
static size_t getDataTypeSize (const File::DataType dataType)
static void writeCSRHeader (const IndexType numRows, const IndexType numValues, const File::FileType &fileType, const std::string &fileName, const PartitionId size, const PartitionId rank)
 This method writes a header file for a CSR storage.
static void readCSRHeader (IndexType &numRows, IndexType &numColumns, IndexType &numValues, PartitionId &size, PartitionId &rank, File::FileType &fileType, const std::string &fileName)
static size_t getIndexDataTypeSize (const File::IndexDataType indexDataType)

Protected Member Functions

 LAMA_LOG_DECL_STATIC_LOGGER (logger)
 logger for Storage IO

template<typename T>
class lama::StorageIO< T >


Member Typedef Documentation

template<typename T >
typedef T lama::StorageIO< T >::ValueType

This is the type of the matrix values.


Member Function Documentation

size_t lama::_StorageIO::getIndexDataTypeSize ( const File::IndexDataType  indexDataType) [static, inherited]
lama::_StorageIO::LAMA_LOG_DECL_STATIC_LOGGER ( logger  ) [protected, inherited]

logger for Storage IO

template<typename ValueType >
void lama::StorageIO< ValueType >::readCSRFromBinaryFile ( LAMAArray< IndexType > &  csrIA,
LAMAArray< IndexType > &  csrJA,
LAMAArray< ValueType > &  csrValues,
const std::string &  fileName,
const IndexType  numRows 
) [static]

Reading storage data from a binary file.

Be careful: no implicit conversions are supported here, so the binary file must contain data of exact the same type as needed.

References lama::WriteAccess< T >::get(), and lama::readBinaryData().

template<typename ValueType >
void lama::StorageIO< ValueType >::readCSRFromFile ( LAMAArray< IndexType > &  csrIA,
IndexType numColumns,
LAMAArray< IndexType > &  csrJA,
LAMAArray< ValueType > &  csrValues,
const std::string &  fileName 
) [static]
template<typename ValueType >
void lama::StorageIO< ValueType >::readCSRFromFormattedFile ( LAMAArray< IndexType > &  csrIA,
LAMAArray< IndexType > &  csrJA,
LAMAArray< ValueType > &  csrValues,
const std::string &  fileName,
const IndexType  numRows 
) [static]

References LAMA_THROWEXCEPTION.

template<typename ValueType >
void lama::StorageIO< ValueType >::readCSRFromXDRFile ( LAMAArray< IndexType > &  csrIA,
LAMAArray< IndexType > &  csrJA,
LAMAArray< ValueType > &  csrValues,
const std::string &  fileName,
const IndexType  numRows 
) [static]
void lama::_StorageIO::readCSRHeader ( IndexType numRows,
IndexType numColumns,
IndexType numValues,
PartitionId size,
PartitionId rank,
File::FileType fileType,
const std::string &  fileName 
) [static, inherited]
void lama::_StorageIO::writeCSRHeader ( const IndexType  numRows,
const IndexType  numValues,
const File::FileType fileType,
const std::string &  fileName,
const PartitionId  size,
const PartitionId  rank 
) [static, inherited]

This method writes a header file for a CSR storage.

Parameters:
[in]numRowsis number of rows of the storage
[in]numValuesis number of values of the storage
[in]fileTypespecifies the type of representation (e.g. binary)
[in]filenameis the name of the header file to write
[in]sizestands for number of partitions, is CSR storage is part of a distributed matrix
[in]rankstands for the rank of the partition.

Note: for distributed CSR matrices each partition has its own header file. #row and #non-zero values are the values for each local part.

References lama::File::BINARY, lama::File::FORMATTED, LAMA_THROWEXCEPTION, lama::_StorageIO::mIversion, VERSION_ID, and lama::File::XDR.

template<typename ValueType >
void lama::StorageIO< ValueType >::writeCSRToBinaryFile ( const LAMAArray< IndexType > &  csrIA,
const LAMAArray< IndexType > &  csrJA,
const LAMAArray< ValueType > &  csrValues,
const std::string &  fileName,
const long  indexDataTypeSizeIA,
const long  indexDataTypeSizeJA,
const long  dataTypeSize 
) [static]
template<typename ValueType >
void lama::StorageIO< ValueType >::writeCSRToFile ( const PartitionId  size,
const PartitionId  rank,
const LAMAArray< IndexType > &  csrIA,
const IndexType  numColumns,
const LAMAArray< IndexType > &  csrJA,
const LAMAArray< ValueType > &  csrValues,
const std::string &  fileName,
const File::FileType fileType,
const File::DataType dataType,
const File::IndexDataType  indexDataTypeIA,
const File::IndexDataType  indexDataTypeJA 
) [static]

General version of writing CSR storage to a file.

Parameters:
[in]size,rankheader information in case of distributed matrices
[in]csrIA,csrJA,csrValuesare the CSR arrays
[in]numColumnsnumber of (global) columns
[in]fileNamename of output file
[in]fileTypetype of file
[in]dataTypespecifies precision of real values
[in]indexDataTypeIAspecifies precision of IA array
[in]indexDataTypeJAspecifies precision of JA array

References lama::File::BINARY, lama::File::FORMATTED, LAMA_THROWEXCEPTION, lama::File::MATRIX_MARKET, lama::_LAMAArray::size(), and lama::File::XDR.

template<typename ValueType >
void lama::StorageIO< ValueType >::writeCSRToFormattedFile ( const LAMAArray< IndexType > &  csrIA,
const LAMAArray< IndexType > &  csrJA,
const LAMAArray< ValueType > &  csrValues,
const std::string &  fileName 
) [static]
template<typename ValueType >
void lama::StorageIO< ValueType >::writeCSRToXDRFile ( const LAMAArray< IndexType > &  csrIA,
const LAMAArray< IndexType > &  csrJA,
const LAMAArray< ValueType > &  csrValues,
const std::string &  fileName,
const long  indexDataTypeSizeIA,
const long  indexDataTypeSizeJA,
const long  dataTypeSize 
) [static]

The documentation for this class was generated from the following files: