FasTensor  1.0.0
Transform Supercomputing for AI
Public Member Functions | Protected Attributes | List of all members
Endpoint Class Referenceabstract

Define the class for the Endpoint used by ArrayUDF to store the data. It contains basic infomation for the endpoint as well as the operations supported by the endpoint. More...

#include <src/ft_endpoint.h>

Inheritance diagram for Endpoint:
EndpointADIOS EndpointBinary EndpointDIR EndpointHDF5 EndpointMEMORY EndpointPnetCDF EndpointTDMS

Public Member Functions

 Endpoint ()
 
virtual ~Endpoint ()
 
std::vector< unsigned long long > GetDimensions ()
 Get the Dimensions of the data. More...
 
void SetDimensions (std::vector< unsigned long long > endpoint_dim_size_p)
 Set the Dimensions. More...
 
void SetDataElementType (AuEndpointDataType data_element_type_p)
 set the type of data element More...
 
AuEndpointDataType GetDataElementType ()
 Get the Type of Data Element. More...
 
int GetDataElementTypeSize ()
 Get the size of the type for the element. More...
 
void SetEndpointType (AuEndpointType endpoint_type_p)
 Set the Endpoint Type object. More...
 
AuEndpointType GetEndpointType ()
 Get the Endpoint Type object. More...
 
bool GetOpenFlag ()
 
void SetOpenFlag (bool open_flag_p)
 
bool GetCreateFlag ()
 
void SetCreateFlag (bool open_flag_p)
 
void SetRwFlag (unsigned read_write_flag_p)
 
unsigned GetRwFlag ()
 
std::vector< AuEndpointDataTypeUnionVoid2Union (void *vp, size_t n_elements)
 convert my data in (void *) type to Union type More...
 
void * Union2Void (std::vector< AuEndpointDataTypeUnion > &data_vector_in_union_type)
 convert data from union to void type More...
 
void SetEndpointInfo (std::string endpoint_info_p)
 set the endpoint_info string More...
 
std::string GetEndpointInfo ()
 Get the endpoint_info string. More...
 
virtual int ParseEndpointInfo ()=0
 parse endpoint_info to my own info More...
 
virtual int ExtractMeta ()=0
 extracts metadata, possbile endpoint_ranks/endpoint_dim_size/other ep_type dependents ones More...
 
virtual int PrintInfo ()=0
 print information about the endpoint More...
 
virtual int Create ()=0
 create the endpoint More...
 
virtual int Open ()=0
 open the endpoint More...
 
virtual int Read (std::vector< unsigned long long > start, std::vector< unsigned long long > end, void *data)=0
 read the data from end-point More...
 
virtual int Write (std::vector< unsigned long long > start, std::vector< unsigned long long > end, void *data)=0
 write the data to the end-point More...
 
virtual int WriteAttribute (const std::string &name, const void *data, FTDataType data_type_p, const size_t &data_length_p=0)
 Set the Attribute object Do not need to be pure virtual method. More...
 
virtual int ReadAttribute (const std::string &name, void *data, FTDataType data_type_p, const size_t &data_length_p=0)
 Get the Attribute object Do not need to be pure virtual method. More...
 
virtual int GetAttributeSize (const std::string &name, FTDataType data_type_p)
 
virtual int Close ()=0
 close the end-point More...
 
virtual void Map2MyType ()=0
 call the finalize to close everything (like call Destractor) More...
 
virtual void EnableCollectiveIO ()
 
virtual void DisableCollectiveIO ()
 
virtual std::vector< std::string > GetDirFileVector ()
 Get the Dir File Vector object. More...
 
virtual void SetDirFileVector (std::vector< std::string > &file_list)
 Set the Dir File Vector object. More...
 
virtual std::vector< int > GetDirChunkSize ()
 Get the Dir Chunk Size object. More...
 
virtual void SetDirChunkSize (std::vector< int > &dir_chunk_size_p)
 Set the Dir Chunk Size object. More...
 
virtual int Control (int opt_code, std::vector< std::string > &parameter_v)
 call a special operator on endpoint such as, enable collective I/O for HDF5 dump file from MEMORY to HDF5 More...
 
virtual int MapOpStr2Int (std::string op_cmd_str)
 map a op_cmd_str to int as input of SpecialOperator More...
 
virtual std::string MapOpInt2Str (int op_int)
 map op_int to string More...
 

Protected Attributes

AuEndpointType endpoint_type
 
std::string endpoint_info
 
std::vector< unsigned long long > endpoint_size
 
int endpoint_ranks
 
AuEndpointDataType data_element_type
 
std::string data_endpoint_orig
 
bool set_endpoint_dim_size_flag = false
 
bool open_flag = false
 
bool create_flag = false
 
unsigned read_write_flag
 

Detailed Description

Define the class for the Endpoint used by ArrayUDF to store the data. It contains basic infomation for the endpoint as well as the operations supported by the endpoint.

Constructor & Destructor Documentation

◆ Endpoint()

Endpoint::Endpoint ( )
inline

◆ ~Endpoint()

virtual Endpoint::~Endpoint ( )
inlinevirtual

Member Function Documentation

◆ Close()

virtual int Endpoint::Close ( )
pure virtual

close the end-point

Returns
int int < 0 error, >= 0 works

Implemented in EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ Control()

int Endpoint::Control ( int  opt_code,
std::vector< std::string > &  parameter_v 
)
virtual

call a special operator on endpoint such as, enable collective I/O for HDF5 dump file from MEMORY to HDF5

Parameters
opt_code,speciallydefined code

call a special operator on endpoint such as, enable collective I/O for HDF5 dump file from MEMORY to HDF5

Parameters
opt_code,speciallydefined code
parameter_v,vectorof argument

Reimplemented in EndpointHDF5, EndpointDIR, and EndpointBinary.

◆ Create()

virtual int Endpoint::Create ( )
pure virtual

create the endpoint

Returns
< 0 error, >= 0 works

Implemented in EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ DisableCollectiveIO()

void Endpoint::DisableCollectiveIO ( )
virtual

Reimplemented in EndpointHDF5, EndpointDIR, and EndpointMEMORY.

◆ EnableCollectiveIO()

void Endpoint::EnableCollectiveIO ( )
virtual

Reimplemented in EndpointHDF5, EndpointDIR, and EndpointMEMORY.

◆ ExtractMeta()

virtual int Endpoint::ExtractMeta ( )
pure virtual

extracts metadata, possbile endpoint_ranks/endpoint_dim_size/other ep_type dependents ones

Returns
int < 0 error, >= 0 works

Implemented in EndpointTDMS, EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ GetAttributeSize()

int Endpoint::GetAttributeSize ( const std::string &  name,
FTDataType  data_type_p 
)
virtual

Reimplemented in EndpointHDF5, and EndpointDIR.

◆ GetCreateFlag()

bool Endpoint::GetCreateFlag ( )

◆ GetDataElementType()

AuEndpointDataType Endpoint::GetDataElementType ( )

Get the Type of Data Element.

Returns
AuEndpointDataType

◆ GetDataElementTypeSize()

int Endpoint::GetDataElementTypeSize ( )

Get the size of the type for the element.

Returns
int

◆ GetDimensions()

std::vector< unsigned long long > Endpoint::GetDimensions ( )

Get the Dimensions of the data.

Returns
vector for the size of data endpoint_dim_size.size() is the rank

Author: Bin Dong dbin@.nosp@m.lbl..nosp@m.gov Web: https://crd.lbl.gov/bin-dong Scientific Data Management Research Group Lawrence Berkeley National Laboratory

Returns
vector for the size of data endpoint_dim_size.size() is the rank

◆ GetDirChunkSize()

std::vector< int > Endpoint::GetDirChunkSize ( )
virtual

Get the Dir Chunk Size object.

Returns
std::vector<int>

Reimplemented in EndpointDIR.

◆ GetDirFileVector()

std::vector< std::string > Endpoint::GetDirFileVector ( )
virtual

Get the Dir File Vector object.

Returns
std::vector<std::string>

Reimplemented in EndpointDIR.

◆ GetEndpointInfo()

std::string Endpoint::GetEndpointInfo ( )

Get the endpoint_info string.

Returns
std::string

◆ GetEndpointType()

AuEndpointType Endpoint::GetEndpointType ( )

Get the Endpoint Type object.

Returns
AuEndpointType

◆ GetOpenFlag()

bool Endpoint::GetOpenFlag ( )

◆ GetRwFlag()

unsigned Endpoint::GetRwFlag ( )

◆ Map2MyType()

virtual void Endpoint::Map2MyType ( )
pure virtual

call the finalize to close everything (like call Destractor)

Returns
int

Implemented in EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ MapOpInt2Str()

std::string Endpoint::MapOpInt2Str ( int  op_int)
virtual

map op_int to string

Parameters
op_int
Returns
std::string

Reimplemented in EndpointBinary.

◆ MapOpStr2Int()

int Endpoint::MapOpStr2Int ( std::string  op_cmd_str)
virtual

map a op_cmd_str to int as input of SpecialOperator

Parameters
op_cmd_strcmd string
Returns
int

Reimplemented in EndpointBinary.

◆ Open()

virtual int Endpoint::Open ( )
pure virtual

open the endpoint

Returns
< 0 error, >= 0 works

Implemented in EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ ParseEndpointInfo()

virtual int Endpoint::ParseEndpointInfo ( )
pure virtual

parse endpoint_info to my own info

Returns
int: 0 works, < 0 error,

Implemented in EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ PrintInfo()

virtual int Endpoint::PrintInfo ( )
pure virtual

print information about the endpoint

Returns
< 0 error, >= 0 works

Implemented in EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ Read()

virtual int Endpoint::Read ( std::vector< unsigned long long >  start,
std::vector< unsigned long long >  end,
void *  data 
)
pure virtual

read the data from end-point

Parameters
start,coordinatesof the cell to start (including)
end,coordinatesof the cell to end (including)
data,storethe result data
Returns
int < 0 error, >= 0 works

Implemented in EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ ReadAttribute()

int Endpoint::ReadAttribute ( const std::string &  name,
void *  data,
FTDataType  data_type_p,
const size_t &  data_length_p = 0 
)
virtual

Get the Attribute object Do not need to be pure virtual method.

Get the Attribute object.

Parameters
name
data
Returns
int

Reimplemented in EndpointHDF5, and EndpointDIR.

◆ SetCreateFlag()

void Endpoint::SetCreateFlag ( bool  open_flag_p)

◆ SetDataElementType()

void Endpoint::SetDataElementType ( AuEndpointDataType  data_element_type_p)

set the type of data element

Parameters
data_element_type_p

◆ SetDimensions()

void Endpoint::SetDimensions ( std::vector< unsigned long long >  endpoint_dim_size_p)

Set the Dimensions.

Returns
< 0 error, works otherwise

◆ SetDirChunkSize()

void Endpoint::SetDirChunkSize ( std::vector< int > &  dir_chunk_size_p)
virtual

Set the Dir Chunk Size object.

Parameters
dir_chunk_size_p

Reimplemented in EndpointDIR.

◆ SetDirFileVector()

void Endpoint::SetDirFileVector ( std::vector< std::string > &  file_list)
virtual

Set the Dir File Vector object.

Parameters
file_list

Reimplemented in EndpointDIR.

◆ SetEndpointInfo()

void Endpoint::SetEndpointInfo ( std::string  endpoint_info_p)

set the endpoint_info string

Parameters
endpoint_info

◆ SetEndpointType()

void Endpoint::SetEndpointType ( AuEndpointType  endpoint_type_p)

Set the Endpoint Type object.

Parameters
endpoint_type_p

◆ SetOpenFlag()

void Endpoint::SetOpenFlag ( bool  open_flag_p)

◆ SetRwFlag()

void Endpoint::SetRwFlag ( unsigned  read_write_flag_p)

◆ Union2Void()

void * Endpoint::Union2Void ( std::vector< AuEndpointDataTypeUnion > &  data_vector_in_union_type)

convert data from union to void type

Parameters
data_vector_in_union_type: vector of data in union type
Returns
void* : pointer to data (for write)

◆ Void2Union()

std::vector< AuEndpointDataTypeUnion > Endpoint::Void2Union ( void *  vp,
size_t  n_elements 
)

convert my data in (void *) type to Union type

Parameters
vp: pointer to data (after read)
Returns
std::vector<AuEndpointDataTypeUnion> : return value

◆ Write()

virtual int Endpoint::Write ( std::vector< unsigned long long >  start,
std::vector< unsigned long long >  end,
void *  data 
)
pure virtual

write the data to the end-point

Parameters
start,coordinatesof the cell to start (including)
end,coordinatesof the cell to end (including)
data,storethe result data
Returns
int < 0 error, >= 0 works

Implemented in EndpointPnetCDF, EndpointHDF5, EndpointDIR, EndpointBinary, EndpointADIOS, and EndpointMEMORY.

◆ WriteAttribute()

int Endpoint::WriteAttribute ( const std::string &  name,
const void *  data,
FTDataType  data_type_p,
const size_t &  data_length_p = 0 
)
virtual

Set the Attribute object Do not need to be pure virtual method.

Set the Attribute object.

Parameters
name
data
Returns
int

Reimplemented in EndpointHDF5, and EndpointDIR.

Member Data Documentation

◆ create_flag

bool Endpoint::create_flag = false
protected

◆ data_element_type

AuEndpointDataType Endpoint::data_element_type
protected

◆ data_endpoint_orig

std::string Endpoint::data_endpoint_orig
protected

◆ endpoint_info

std::string Endpoint::endpoint_info
protected

◆ endpoint_ranks

int Endpoint::endpoint_ranks
protected

◆ endpoint_size

std::vector<unsigned long long> Endpoint::endpoint_size
protected

◆ endpoint_type

AuEndpointType Endpoint::endpoint_type
protected

◆ open_flag

bool Endpoint::open_flag = false
protected

◆ read_write_flag

unsigned Endpoint::read_write_flag
protected

◆ set_endpoint_dim_size_flag

bool Endpoint::set_endpoint_dim_size_flag = false
protected

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