OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
DiscField< Dim > Class Template Reference

#include <DiscField.h>

Collaboration diagram for DiscField< Dim >:

Public Member Functions

 DiscField (const char *fname, const char *config, unsigned int numFields, const char *typestr=0)
 DiscField (const char *fname, unsigned int numFields, const char *typestr=0)
 DiscField (const char *fname, const char *config)
 DiscField (const char *fname)
 ~DiscField ()
void query (int &numRecords, int &numFields, std::vector< int > &size) const
unsigned int get_NumRecords () const
unsigned int get_NumFields () const
NDIndex< Dimget_Domain () const
unsigned int get_Dimension () const
const char * get_TypeString ()
const char * get_DiscType ()
template<class T, class M, class C>
bool read (Field< T, Dim, M, C > &f, const NDIndex< Dim > &readDomain, unsigned int varID, unsigned int record)
template<class T, class M, class C>
bool read (Field< T, Dim, M, C > &f, unsigned int varID, unsigned int record)
template<class T, class M, class C>
bool read (Field< T, Dim, M, C > &f, const NDIndex< Dim > &readDomain, unsigned int varID)
template<class T, class M, class C>
bool read (Field< T, Dim, M, C > &f, unsigned int varID)
template<class T, class M, class C>
bool read (Field< T, Dim, M, C > &f, const NDIndex< Dim > &readDomain)
template<class T, class M, class C>
bool read (Field< T, Dim, M, C > &f)
template<class T, class M, class C>
bool write (Field< T, Dim, M, C > &f, unsigned int varID)
template<class T, class M, class C>
bool write (Field< T, Dim, M, C > &f)
void printDebug (std::ostream &)
void printDebug ()

Private Types

typedef vmap< NDIndex< Dim >, int > GlobalIDList_t
typedef long long Offset_t

Private Member Functions

void initialize (const char *base, const char *config, const char *typestr, unsigned int numFields)
FILE * open_df_file (const std::string &fnm, const std::string &mode)
FILE * open_df_file (const std::string &fnm, const std::string &suffix, const std::string &mode)
int open_df_file_fd (const std::string &fnm, const std::string &suf, int flags)
bool create_files ()
unsigned int numSMPs () const
unsigned int fileSMPs () const
unsigned int mySMP () const
unsigned int myBox0 () const
unsigned int numFiles () const
unsigned int numFiles (unsigned int s) const
unsigned int pNodesPerSMP (unsigned int node) const
bool parse_config (const char *, bool)
int compute_expected (const FieldLayout< Dim > &, const NDIndex< Dim > &)
bool make_globalID (FieldLayout< Dim > &)
NDIndex< Dimchunk_domain (const NDIndex< Dim > &currblock, int chunkelems, int &msdim, bool iscompressed)
bool write_meta ()
bool read_meta ()
bool read_NDIndex (FILE *, NDIndex< Dim > &)
bool write_NDIndex (FILE *, const NDIndex< Dim > &)
bool write_layout ()
int read_layout (int record, int sf)
template<class T>
void write_offset_and_data (FILE *outputOffset, int outputDatafd, CompressedBrickIterator< T, Dim > &cbi, const NDIndex< Dim > &owned)
template<class T>
bool read_offset (unsigned int varID, unsigned int record, unsigned int sf, std::vector< DFOffsetData< Dim, T > > &offdata, int vnodes)
template<class T>
void distribute_offsets (std::vector< DFOffsetData< Dim, T > > &offdata, int &vnodes, int &maxsize, const NDIndex< Dim > &readDomain)
template<class T>
bool read_data (int outputDatafd, T *buffer, Offset_t readsize, Offset_t seekpos)
template<class T>
void offset_data_to_domain (DFOffsetData< Dim, T > &offdata, NDIndex< Dim > &domain)
template<class T>
void domain_to_offset_data (const NDIndex< Dim > &domain, DFOffsetData< Dim, T > &offdata)
 DiscField (const DiscField< Dim > &)
DiscFieldoperator= (const DiscField< Dim > &)

Private Attributes

DiscConfigConfig
bool ConfigOK
bool WritingFile
std::string BaseFile
std::string TypeString
std::string DiscType
unsigned int DataDimension
int NeedStartRecord
unsigned int NumFields
unsigned int NumRecords
unsigned int NumWritten
Offset_t CurrentOffset
NDIndex< DimSize
std::vector< bool > ValidField
std::vector< int > * VnodeTally
std::vector< int > * NumVnodes
GlobalIDList_t globalID

Detailed Description

template<unsigned Dim>
class DiscField< Dim >

Definition at line 49 of file DiscField.h.

Member Typedef Documentation

◆ GlobalIDList_t

template<unsigned Dim>
typedef vmap<NDIndex<Dim>, int> DiscField< Dim >::GlobalIDList_t
private

Definition at line 848 of file DiscField.h.

◆ Offset_t

template<unsigned Dim>
typedef long long DiscField< Dim >::Offset_t
private

Definition at line 849 of file DiscField.h.

Constructor & Destructor Documentation

◆ DiscField() [1/5]

template<unsigned Dim>
DiscField< Dim >::DiscField ( const char * fname,
const char * config,
unsigned int numFields,
const char * typestr = 0 )

Definition at line 52 of file DiscField.hpp.

References initialize().

Referenced by DiscField(), and operator=().

Here is the call graph for this function:

◆ DiscField() [2/5]

template<unsigned Dim>
DiscField< Dim >::DiscField ( const char * fname,
unsigned int numFields,
const char * typestr = 0 )

Definition at line 64 of file DiscField.hpp.

References initialize().

Here is the call graph for this function:

◆ DiscField() [3/5]

template<unsigned Dim>
DiscField< Dim >::DiscField ( const char * fname,
const char * config )

Definition at line 76 of file DiscField.hpp.

References initialize().

Here is the call graph for this function:

◆ DiscField() [4/5]

template<unsigned Dim>
DiscField< Dim >::DiscField ( const char * fname)

Definition at line 87 of file DiscField.hpp.

References initialize().

Here is the call graph for this function:

◆ ~DiscField()

template<unsigned Dim>
DiscField< Dim >::~DiscField ( )

Definition at line 142 of file DiscField.hpp.

References Config, NumVnodes, and VnodeTally.

◆ DiscField() [5/5]

template<unsigned Dim>
DiscField< Dim >::DiscField ( const DiscField< Dim > & )
private

References DiscField().

Here is the call graph for this function:

Member Function Documentation

◆ chunk_domain()

template<unsigned Dim>
NDIndex< Dim > DiscField< Dim >::chunk_domain ( const NDIndex< Dim > & currblock,
int chunkelems,
int & msdim,
bool iscompressed )
private

Definition at line 873 of file DiscField.hpp.

References Dim, and NDIndex< Dim >::size().

Referenced by distribute_offsets(), and read().

Here is the call graph for this function:

◆ compute_expected()

template<unsigned Dim>
int DiscField< Dim >::compute_expected ( const FieldLayout< Dim > & f,
const NDIndex< Dim > & readDomain )
private

Definition at line 849 of file DiscField.hpp.

References FieldLayout< Dim >::begin_iv(), FieldLayout< Dim >::end_iv(), NDIndex< Dim >::intersect(), NDIndex< Dim >::size(), and NDIndex< Dim >::touches().

Referenced by read().

Here is the call graph for this function:

◆ create_files()

template<unsigned Dim>
bool DiscField< Dim >::create_files ( )
private

Definition at line 257 of file DiscField.hpp.

References IpplInfo::abort(), Config, endl(), ERRORMSG, open_df_file(), and open_df_file_fd().

Referenced by parse_config().

Here is the call graph for this function:

◆ distribute_offsets()

template<unsigned Dim>
template<class T>
void DiscField< Dim >::distribute_offsets ( std::vector< DFOffsetData< Dim, T > > & offdata,
int & vnodes,
int & maxsize,
const NDIndex< Dim > & readDomain )
inlineprivate

Definition at line 1253 of file DiscField.h.

References IpplInfo::abort(), chunk_domain(), IpplInfo::chunkSize(), IpplInfo::Comm, Config, DF_OFFSET_TAG, DF_TAG_CYCLE, Dim, Message::get(), getMessage_iter(), myBox0(), IpplInfo::myNode(), mySMP(), offset_data_to_domain(), IpplInfo::perSMPParallelIO(), pNodesPerSMP(), Message::put(), Message::putmsg(), Message::setCopy(), Message::setDelete(), NDIndex< Dim >::size(), and NDIndex< Dim >::touches().

Referenced by read().

Here is the call graph for this function:

◆ domain_to_offset_data()

template<unsigned Dim>
template<class T>
void DiscField< Dim >::domain_to_offset_data ( const NDIndex< Dim > & domain,
DFOffsetData< Dim, T > & offdata )
inlineprivate

Definition at line 1447 of file DiscField.h.

References Dim, and DFOffsetData< Dim, T >::vnodedata.

Referenced by write_offset_and_data().

◆ fileSMPs()

template<unsigned Dim>
unsigned int DiscField< Dim >::fileSMPs ( ) const
inlineprivate

Definition at line 948 of file DiscField.h.

References Config.

Referenced by read_meta(), and write_meta().

◆ get_Dimension()

template<unsigned Dim>
unsigned int DiscField< Dim >::get_Dimension ( ) const
inline

Definition at line 108 of file DiscField.h.

References DataDimension.

◆ get_DiscType()

template<unsigned Dim>
const char * DiscField< Dim >::get_DiscType ( )
inline

Definition at line 114 of file DiscField.h.

References DiscType.

◆ get_Domain()

template<unsigned Dim>
NDIndex< Dim > DiscField< Dim >::get_Domain ( ) const
inline

Definition at line 101 of file DiscField.h.

References Size.

Referenced by read(), and write().

◆ get_NumFields()

template<unsigned Dim>
unsigned int DiscField< Dim >::get_NumFields ( ) const
inline

Definition at line 98 of file DiscField.h.

References NumFields.

◆ get_NumRecords()

template<unsigned Dim>
unsigned int DiscField< Dim >::get_NumRecords ( ) const
inline

Definition at line 95 of file DiscField.h.

References NumRecords.

◆ get_TypeString()

template<unsigned Dim>
const char * DiscField< Dim >::get_TypeString ( )
inline

Definition at line 111 of file DiscField.h.

References TypeString.

◆ initialize()

template<unsigned Dim>
void DiscField< Dim >::initialize ( const char * base,
const char * config,
const char * typestr,
unsigned int numFields )
private

Definition at line 96 of file DiscField.hpp.

References BaseFile, ConfigOK, CurrentOffset, DataDimension, Dim, DiscType, NeedStartRecord, NumFields, NumRecords, NumVnodes, NumWritten, parse_config(), read_meta(), TypeString, ValidField, VnodeTally, and WritingFile.

Referenced by DiscField(), DiscField(), DiscField(), and DiscField().

Here is the call graph for this function:

◆ make_globalID()

template<unsigned Dim>
bool DiscField< Dim >::make_globalID ( FieldLayout< Dim > & layout)
private

Definition at line 303 of file DiscField.hpp.

References FieldLayout< Dim >::begin_iv(), FieldLayout< Dim >::begin_rdv(), Config, FieldLayout< Dim >::end_iv(), FieldLayout< Dim >::end_rdv(), FieldLayout< Dim >::getDomain(), globalID, mySMP(), and Size.

Referenced by write().

Here is the call graph for this function:

◆ myBox0()

template<unsigned Dim>
unsigned int DiscField< Dim >::myBox0 ( ) const
inlineprivate

Definition at line 958 of file DiscField.h.

References Config.

Referenced by distribute_offsets(), parse_config(), query(), read(), read_meta(), and write().

◆ mySMP()

template<unsigned Dim>
unsigned int DiscField< Dim >::mySMP ( ) const
inlineprivate

Definition at line 953 of file DiscField.h.

References Config.

Referenced by distribute_offsets(), make_globalID(), and read_meta().

◆ numFiles() [1/2]

template<unsigned Dim>
unsigned int DiscField< Dim >::numFiles ( ) const
inlineprivate

Definition at line 964 of file DiscField.h.

References Config.

Referenced by parse_config(), query(), read(), read_meta(), write(), write_layout(), and write_meta().

◆ numFiles() [2/2]

template<unsigned Dim>
unsigned int DiscField< Dim >::numFiles ( unsigned int s) const
inlineprivate

Definition at line 967 of file DiscField.h.

References Config.

◆ numSMPs()

template<unsigned Dim>
unsigned int DiscField< Dim >::numSMPs ( ) const
inlineprivate

Definition at line 943 of file DiscField.h.

References Config.

◆ offset_data_to_domain()

template<unsigned Dim>
template<class T>
void DiscField< Dim >::offset_data_to_domain ( DFOffsetData< Dim, T > & offdata,
NDIndex< Dim > & domain )
inlineprivate

Definition at line 1432 of file DiscField.h.

References Dim, and DFOffsetData< Dim, T >::vnodedata.

Referenced by distribute_offsets(), and read().

◆ open_df_file() [1/2]

template<unsigned Dim>
FILE * DiscField< Dim >::open_df_file ( const std::string & fnm,
const std::string & mode )
private

Definition at line 179 of file DiscField.hpp.

References IpplInfo::abort(), endl(), ERRORMSG, and IpplInfo::myNode().

Referenced by create_files(), read_layout(), read_offset(), write(), write_layout(), and write_meta().

Here is the call graph for this function:

◆ open_df_file() [2/2]

template<unsigned Dim>
FILE * DiscField< Dim >::open_df_file ( const std::string & fnm,
const std::string & suffix,
const std::string & mode )
private

Definition at line 223 of file DiscField.hpp.

References IpplInfo::abort(), endl(), ERRORMSG, and IpplInfo::myNode().

Here is the call graph for this function:

◆ open_df_file_fd()

template<unsigned Dim>
int DiscField< Dim >::open_df_file_fd ( const std::string & fnm,
const std::string & suf,
int flags )
private

Definition at line 196 of file DiscField.hpp.

References endl(), ERRORMSG, and IpplInfo::myNode().

Referenced by create_files(), read(), and write().

Here is the call graph for this function:

◆ operator=()

template<unsigned Dim>
DiscField & DiscField< Dim >::operator= ( const DiscField< Dim > & )
private

References DiscField().

Here is the call graph for this function:

◆ parse_config()

template<unsigned Dim>
bool DiscField< Dim >::parse_config ( const char * fname,
bool writing )
private

Definition at line 373 of file DiscField.hpp.

References IpplInfo::abort(), BaseFile, Config, create_files(), endl(), ERRORMSG, myBox0(), IpplInfo::myNode(), numFiles(), NumVnodes, and VnodeTally.

Referenced by initialize().

Here is the call graph for this function:

◆ pNodesPerSMP()

template<unsigned Dim>
unsigned int DiscField< Dim >::pNodesPerSMP ( unsigned int node) const
inlineprivate

Definition at line 973 of file DiscField.h.

References Config.

Referenced by distribute_offsets().

◆ printDebug() [1/2]

template<unsigned Dim>
void DiscField< Dim >::printDebug ( )

Definition at line 414 of file DiscField.hpp.

References printDebug().

Here is the call graph for this function:

◆ printDebug() [2/2]

template<unsigned Dim>
void DiscField< Dim >::printDebug ( std::ostream & outmsg)

Definition at line 417 of file DiscField.hpp.

References BaseFile, Config, endl(), INFORM_ALL_NODES, NumFields, NumRecords, and TypeString.

Referenced by printDebug().

Here is the call graph for this function:

◆ query()

template<unsigned Dim>
void DiscField< Dim >::query ( int & numRecords,
int & numFields,
std::vector< int > & size ) const

Definition at line 160 of file DiscField.hpp.

References myBox0(), IpplInfo::myNode(), NumFields, numFiles(), NumRecords, and NumVnodes.

Here is the call graph for this function:

◆ read() [1/6]

template<unsigned Dim>
template<class T, class M, class C>
bool DiscField< Dim >::read ( Field< T, Dim, M, C > & f)
inline

Definition at line 593 of file DiscField.h.

References FieldLayout< Dim >::getDomain(), BareField< T, Dim >::getLayout(), and read().

Here is the call graph for this function:

◆ read() [2/6]

template<unsigned Dim>
template<class T, class M, class C>
bool DiscField< Dim >::read ( Field< T, Dim, M, C > & f,
const NDIndex< Dim > & readDomain )
inline

Definition at line 588 of file DiscField.h.

References read().

Here is the call graph for this function:

◆ read() [3/6]

template<unsigned Dim>
template<class T, class M, class C>
bool DiscField< Dim >::read ( Field< T, Dim, M, C > & f,
const NDIndex< Dim > & readDomain,
unsigned int varID )
inline

Definition at line 577 of file DiscField.h.

References read().

Here is the call graph for this function:

◆ read() [4/6]

template<unsigned Dim>
template<class T, class M, class C>
bool DiscField< Dim >::read ( Field< T, Dim, M, C > & f,
const NDIndex< Dim > & readDomain,
unsigned int varID,
unsigned int record )
inline

◆ read() [5/6]

template<unsigned Dim>
template<class T, class M, class C>
bool DiscField< Dim >::read ( Field< T, Dim, M, C > & f,
unsigned int varID )
inline

Definition at line 583 of file DiscField.h.

References FieldLayout< Dim >::getDomain(), BareField< T, Dim >::getLayout(), and read().

Here is the call graph for this function:

◆ read() [6/6]

template<unsigned Dim>
template<class T, class M, class C>
bool DiscField< Dim >::read ( Field< T, Dim, M, C > & f,
unsigned int varID,
unsigned int record )
inline

Definition at line 572 of file DiscField.h.

References FieldLayout< Dim >::getDomain(), BareField< T, Dim >::getLayout(), and read().

Here is the call graph for this function:

◆ read_data()

template<unsigned Dim>
template<class T>
bool DiscField< Dim >::read_data ( int outputDatafd,
T * buffer,
Offset_t readsize,
Offset_t seekpos )
inlineprivate

Definition at line 1383 of file DiscField.h.

References IpplInfo::abort(), Timer::clear(), Timer::clock_time(), endl(), ERRORMSG, PAssert, PAssert_EQ, PAssert_GE, PAssert_GT, read(), DiscBuffer::readbytes, DiscBuffer::readtime, Timer::start(), and Timer::stop().

Referenced by read().

Here is the call graph for this function:

◆ read_layout()

template<unsigned Dim>
int DiscField< Dim >::read_layout ( int record,
int sf )
private

Definition at line 799 of file DiscField.hpp.

References IpplInfo::abort(), Config, Dim, endl(), ERRORMSG, open_df_file(), and VnodeTally.

Referenced by read().

Here is the call graph for this function:

◆ read_meta()

template<unsigned Dim>
bool DiscField< Dim >::read_meta ( )
private

Definition at line 493 of file DiscField.hpp.

References IpplInfo::abort(), begin(), DiscMeta::begin(), IpplInfo::Comm, Config, DataDimension, DF_READ_META_TAG, DF_TAG_CYCLE, Dim, DiscMeta::end(), end(), endl(), ERRORMSG, fileSMPs(), Message::get(), getMessage(), myBox0(), IpplInfo::myNode(), mySMP(), NumFields, numFiles(), NumRecords, NumVnodes, PAssert, Message::put(), putMessage(), Size, DiscMeta::size(), TypeString, and VnodeTally.

Referenced by initialize().

Here is the call graph for this function:

◆ read_NDIndex()

template<unsigned Dim>
bool DiscField< Dim >::read_NDIndex ( FILE * f,
NDIndex< Dim > & ndi )
private

Definition at line 679 of file DiscField.hpp.

References IpplInfo::abort(), Dim, endl(), and ERRORMSG.

Here is the call graph for this function:

◆ read_offset()

template<unsigned Dim>
template<class T>
bool DiscField< Dim >::read_offset ( unsigned int varID,
unsigned int record,
unsigned int sf,
std::vector< DFOffsetData< Dim, T > > & offdata,
int vnodes )
inlineprivate

Definition at line 1166 of file DiscField.h.

References IpplInfo::abort(), Config, endl(), ERRORMSG, NumFields, NumVnodes, open_df_file(), and VnodeTally.

Referenced by read().

Here is the call graph for this function:

◆ write() [1/2]

template<unsigned Dim>
template<class T, class M, class C>
bool DiscField< Dim >::write ( Field< T, Dim, M, C > & f)
inline

Definition at line 833 of file DiscField.h.

References write().

Here is the call graph for this function:

◆ write() [2/2]

◆ write_layout()

template<unsigned Dim>
bool DiscField< Dim >::write_layout ( )
private

Definition at line 760 of file DiscField.hpp.

References IpplInfo::abort(), Config, endl(), ERRORMSG, globalID, numFiles(), NumRecords, open_df_file(), and write_NDIndex().

Referenced by write().

Here is the call graph for this function:

◆ write_meta()

template<unsigned Dim>
bool DiscField< Dim >::write_meta ( )
private

Definition at line 447 of file DiscField.hpp.

References Config, Dim, fileSMPs(), NumFields, numFiles(), NumRecords, NumVnodes, open_df_file(), Size, TypeString, and VnodeTally.

Referenced by write().

Here is the call graph for this function:

◆ write_NDIndex()

template<unsigned Dim>
bool DiscField< Dim >::write_NDIndex ( FILE * f,
const NDIndex< Dim > & ndi )
private

Definition at line 712 of file DiscField.hpp.

References Dim.

Referenced by write_layout().

◆ write_offset_and_data()

template<unsigned Dim>
template<class T>
void DiscField< Dim >::write_offset_and_data ( FILE * outputOffset,
int outputDatafd,
CompressedBrickIterator< T, Dim > & cbi,
const NDIndex< Dim > & owned )
inlineprivate

Member Data Documentation

◆ BaseFile

template<unsigned Dim>
std::string DiscField< Dim >::BaseFile
private

Definition at line 863 of file DiscField.h.

Referenced by initialize(), parse_config(), and printDebug().

◆ Config

◆ ConfigOK

template<unsigned Dim>
bool DiscField< Dim >::ConfigOK
private

Definition at line 857 of file DiscField.h.

Referenced by initialize(), read(), and write().

◆ CurrentOffset

template<unsigned Dim>
Offset_t DiscField< Dim >::CurrentOffset
private

Definition at line 887 of file DiscField.h.

Referenced by initialize(), and write_offset_and_data().

◆ DataDimension

template<unsigned Dim>
unsigned int DiscField< Dim >::DataDimension
private

Definition at line 868 of file DiscField.h.

Referenced by get_Dimension(), initialize(), read(), and read_meta().

◆ DiscType

template<unsigned Dim>
std::string DiscField< Dim >::DiscType
private

Definition at line 865 of file DiscField.h.

Referenced by get_DiscType(), and initialize().

◆ globalID

template<unsigned Dim>
GlobalIDList_t DiscField< Dim >::globalID
private

Definition at line 914 of file DiscField.h.

Referenced by make_globalID(), write(), and write_layout().

◆ NeedStartRecord

template<unsigned Dim>
int DiscField< Dim >::NeedStartRecord
private

Definition at line 877 of file DiscField.h.

Referenced by initialize(), and write().

◆ NumFields

template<unsigned Dim>
unsigned int DiscField< Dim >::NumFields
private

◆ NumRecords

template<unsigned Dim>
unsigned int DiscField< Dim >::NumRecords
private

◆ NumVnodes

template<unsigned Dim>
std::vector<int>* DiscField< Dim >::NumVnodes
private

◆ NumWritten

template<unsigned Dim>
unsigned int DiscField< Dim >::NumWritten
private

Definition at line 883 of file DiscField.h.

Referenced by initialize(), and write().

◆ Size

template<unsigned Dim>
NDIndex<Dim> DiscField< Dim >::Size
private

Definition at line 890 of file DiscField.h.

Referenced by get_Domain(), make_globalID(), read_meta(), and write_meta().

◆ TypeString

template<unsigned Dim>
std::string DiscField< Dim >::TypeString
private

Definition at line 864 of file DiscField.h.

Referenced by get_TypeString(), initialize(), printDebug(), read_meta(), and write_meta().

◆ ValidField

template<unsigned Dim>
std::vector<bool> DiscField< Dim >::ValidField
private

Definition at line 893 of file DiscField.h.

Referenced by initialize(), and write().

◆ VnodeTally

template<unsigned Dim>
std::vector<int>* DiscField< Dim >::VnodeTally
private

◆ WritingFile

template<unsigned Dim>
bool DiscField< Dim >::WritingFile
private

Definition at line 860 of file DiscField.h.

Referenced by initialize(), read(), and write().


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