OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DiscField< Dim > Class Template Reference

#include <DiscField.h>

Collaboration diagram for DiscField< Dim >:
Collaboration graph
[legend]

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 61 of file DiscField.h.

Member Typedef Documentation

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

Definition at line 1007 of file DiscField.h.

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

Definition at line 1008 of file DiscField.h.

Constructor & Destructor Documentation

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

Definition at line 53 of file DiscField.hpp.

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

Definition at line 65 of file DiscField.hpp.

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

Definition at line 77 of file DiscField.hpp.

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

Definition at line 88 of file DiscField.hpp.

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

Definition at line 147 of file DiscField.hpp.

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

Member Function Documentation

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

Definition at line 980 of file DiscField.hpp.

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

Referenced by DiscField< Dim >::distribute_offsets(), and DiscField< Dim >::read().

Here is the call graph for this function:

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

Definition at line 300 of file DiscField.hpp.

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

Here is the call graph for this function:

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
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 1723 of file DiscField.h.

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

Referenced by DiscField< Dim >::write_offset_and_data().

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

Definition at line 1113 of file DiscField.h.

References DiscField< Dim >::Config, and DiscConfig::fileSMPs().

Here is the call graph for this function:

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

Definition at line 120 of file DiscField.h.

References DiscField< Dim >::DataDimension.

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

Definition at line 126 of file DiscField.h.

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

Definition at line 113 of file DiscField.h.

References DiscField< Dim >::Size.

Referenced by DiscField< Dim >::read(), and DiscField< Dim >::write().

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

Definition at line 110 of file DiscField.h.

References DiscField< Dim >::NumFields.

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

Definition at line 107 of file DiscField.h.

References DiscField< Dim >::NumRecords.

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

Definition at line 123 of file DiscField.h.

References DiscField< Dim >::TypeString.

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

Definition at line 97 of file DiscField.hpp.

References Dim.

template<unsigned Dim>
bool DiscField< Dim >::make_globalID ( FieldLayout< Dim > &  layout)
private
template<unsigned Dim>
unsigned int DiscField< Dim >::myBox0 ( ) const
inlineprivate

Definition at line 1123 of file DiscField.h.

References DiscField< Dim >::Config, and DiscConfig::getSMPBox0().

Referenced by DiscField< Dim >::distribute_offsets(), DiscField< Dim >::read(), and DiscField< Dim >::write().

Here is the call graph for this function:

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

Definition at line 1118 of file DiscField.h.

References DiscField< Dim >::Config, and DiscConfig::mySMP().

Referenced by DiscField< Dim >::distribute_offsets().

Here is the call graph for this function:

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

Definition at line 1129 of file DiscField.h.

References DiscField< Dim >::Config, and DiscConfig::getNumFiles().

Referenced by DiscField< Dim >::read(), and DiscField< Dim >::write().

Here is the call graph for this function:

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

Definition at line 1132 of file DiscField.h.

References DiscField< Dim >::Config, and DiscConfig::getNumFiles().

Here is the call graph for this function:

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

Definition at line 1108 of file DiscField.h.

References DiscField< Dim >::Config, and DiscConfig::numSMPs().

Here is the call graph for this function:

template<unsigned Dim>
template<class T >
void DiscField< Dim >::offset_data_to_domain ( DFOffsetData< Dim, T > &  offdata,
NDIndex< Dim > &  domain 
)
inlineprivate
template<unsigned Dim>
FILE * DiscField< Dim >::open_df_file ( const std::string &  fnm,
const std::string &  mode 
)
private

Definition at line 184 of file DiscField.hpp.

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

Referenced by DiscField< Dim >::read_offset(), and DiscField< Dim >::write().

Here is the call graph for this function:

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 266 of file DiscField.hpp.

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

Here is the call graph for this function:

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

Definition at line 201 of file DiscField.hpp.

References DFDBG, endl(), ERRORMSG, INFORM_ALL_NODES, IpplInfo::myNode(), and IpplInfo::useDirectIO.

Referenced by DiscField< Dim >::read(), and DiscField< Dim >::write().

Here is the call graph for this function:

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

Definition at line 416 of file DiscField.hpp.

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

Here is the call graph for this function:

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

Definition at line 1138 of file DiscField.h.

References DiscField< Dim >::Config, and DiscConfig::pNodesPerSMP().

Referenced by DiscField< Dim >::distribute_offsets().

Here is the call graph for this function:

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

Definition at line 460 of file DiscField.hpp.

References endl(), and INFORM_ALL_NODES.

Here is the call graph for this function:

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

Definition at line 457 of file DiscField.hpp.

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

Definition at line 165 of file DiscField.hpp.

References IpplInfo::myNode().

Here is the call graph for this function:

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

Definition at line 152 of file DiscField.h.

References IpplInfo::abort(), Communicate::barrier(), LField< T, Dim >::begin(), BareField< T, Dim >::begin_if(), DiscField< Dim >::chunk_domain(), IpplInfo::chunkSize(), IpplInfo::Comm, COMM_ANY_TAG, LField< T, Dim >::Compress(), BareField< T, Dim >::Compress(), BareField< T, Dim >::compressible(), DiscField< Dim >::compute_expected(), DiscField< Dim >::Config, DiscField< Dim >::ConfigOK, NDIndex< Dim >::contains(), DiscField< Dim >::DataDimension, DF_READ_TAG, DF_TAG_CYCLE, DFDBG, Dim, DiscField< Dim >::distribute_offsets(), BareField< T, Dim >::end_if(), endl(), ERRORMSG, BareField< T, Dim >::fillGuardCellsIfNotDirty(), DiscField< Dim >::get_Domain(), LField< T, Dim >::getAllocated(), DiscConfig::getConfigFile(), FieldLayout< Dim >::getDomain(), DiscConfig::getFilename(), BareField< T, Dim >::getLayout(), NDIndex< Dim >::getMessage(), LField< T, Dim >::getOwned(), IpplTimings::getTimer(), INFORM_ALL_NODES, NDIndex< Dim >::intersect(), LField< T, Dim >::IsCompressed(), DiscField< Dim >::myBox0(), IpplInfo::myNode(), TagMaker::next_tag(), DiscField< Dim >::NumFields, DiscField< Dim >::numFiles(), DiscField< Dim >::NumRecords, DiscField< Dim >::offset_data_to_domain(), DiscField< Dim >::open_df_file_fd(), PAssert_EQ, PAssert_GE, PETE_apply(), NDIndex< Dim >::putMessage(), DiscField< Dim >::read_data(), DiscField< Dim >::read_layout(), DiscField< Dim >::read_offset(), Communicate::receive_block(), DiscBuffer::resize(), Communicate::send(), BareField< T, Dim >::setDirtyFlag(), DiscBuffer::size(), NDIndex< Dim >::size(), IpplTimings::startTimer(), IpplTimings::stopTimer(), T, FieldLayout< Dim >::touch_range_rdv(), NDIndex< Dim >::touches(), LField< T, Dim >::Uncompress(), and DiscField< Dim >::WritingFile.

Referenced by DiscField< Dim >::read(), and DiscField< Dim >::read_data().

Here is the call graph for this function:

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 711 of file DiscField.h.

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

Here is the call graph for this function:

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 716 of file DiscField.h.

References DiscField< Dim >::read().

Here is the call graph for this function:

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 722 of file DiscField.h.

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

Here is the call graph for this function:

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 727 of file DiscField.h.

References DiscField< Dim >::read().

Here is the call graph for this function:

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

Definition at line 732 of file DiscField.h.

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

Here is the call graph for this function:

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

Definition at line 879 of file DiscField.hpp.

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

Referenced by DiscField< Dim >::read().

Here is the call graph for this function:

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

Definition at line 759 of file DiscField.hpp.

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

Here is the call graph for this function:

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
template<unsigned Dim>
template<class T , class M , class C >
bool DiscField< Dim >::write ( Field< T, Dim, M, C > &  f,
unsigned int  varID 
)
inline
template<unsigned Dim>
template<class T , class M , class C >
bool DiscField< Dim >::write ( Field< T, Dim, M, C > &  f)
inline

Definition at line 992 of file DiscField.h.

References DiscField< Dim >::write().

Here is the call graph for this function:

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

Definition at line 840 of file DiscField.hpp.

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

Referenced by DiscField< Dim >::write().

Here is the call graph for this function:

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

Definition at line 490 of file DiscField.hpp.

References Dim.

Referenced by DiscField< Dim >::write().

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

Definition at line 792 of file DiscField.hpp.

References Dim.

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

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

Definition at line 1022 of file DiscField.h.

template<unsigned Dim>
DiscConfig* DiscField< Dim >::Config
private
template<unsigned Dim>
bool DiscField< Dim >::ConfigOK
private

Definition at line 1016 of file DiscField.h.

Referenced by DiscField< Dim >::read(), and DiscField< Dim >::write().

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

Definition at line 1046 of file DiscField.h.

Referenced by DiscField< Dim >::write_offset_and_data().

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

Definition at line 1027 of file DiscField.h.

Referenced by DiscField< Dim >::get_Dimension(), and DiscField< Dim >::read().

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

Definition at line 1024 of file DiscField.h.

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

Definition at line 1073 of file DiscField.h.

Referenced by DiscField< Dim >::write().

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

Definition at line 1036 of file DiscField.h.

Referenced by DiscField< Dim >::write().

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

Definition at line 1064 of file DiscField.h.

Referenced by DiscField< Dim >::read_offset(), and DiscField< Dim >::write().

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

Definition at line 1042 of file DiscField.h.

Referenced by DiscField< Dim >::write().

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

Definition at line 1049 of file DiscField.h.

Referenced by DiscField< Dim >::get_Domain().

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

Definition at line 1023 of file DiscField.h.

Referenced by DiscField< Dim >::get_TypeString().

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

Definition at line 1052 of file DiscField.h.

Referenced by DiscField< Dim >::write().

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

Definition at line 1058 of file DiscField.h.

Referenced by DiscField< Dim >::read_offset(), and DiscField< Dim >::write().

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

Definition at line 1019 of file DiscField.h.

Referenced by DiscField< Dim >::read(), and DiscField< Dim >::write().


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