FasTensor  1.0.0
Transform Supercomputing for AI
Public Member Functions | List of all members
EndpointBinary Class Reference

#include <src/ft_endpoint_binary.h>

Inheritance diagram for EndpointBinary:
Endpoint EndpointTDMS

Public Member Functions

 EndpointBinary (std::string endpoint_info_p)
 Construct a new EndpointBinary object. More...
 
 EndpointBinary ()
 Construct a new Endpoint in Binary Nothing to do there, can be used as sub-endpoint of directory. More...
 
virtual ~EndpointBinary ()
 
void SetMode (std::string model_str_p)
 
std::string GetMode ()
 
int ExtractMeta () override
 extracts metadata, possbile endpoint_ranks/endpoint_dim_size/data_element_type More...
 
int PrintInfo () override
 print information about the endpoint More...
 
int Create () override
 create the endpoint More...
 
int Open () override
 open the endpoint More...
 
int Read (std::vector< unsigned long long > start, std::vector< unsigned long long > end, void *data) override
 read the data from end-point More...
 
int Write (std::vector< unsigned long long > start, std::vector< unsigned long long > end, void *data) override
 write the data to the end-point More...
 
int Close () override
 close the end-point More...
 
void Map2MyType () override
 call the finalize to close everything (like call Destractor) More...
 
int ParseEndpointInfo () override
 parse endpoint_info to my own info In binary, it map endpoint_info to filename, More...
 
virtual void UpdateSeekOffset ()
 update the seek_offset More...
 
int Control (int opt_code, std::vector< std::string > &parameter_v) override
 call a special operator on binary endpoint such as OP_SET_BINARY_SIZE More...
 
FILE * GetFP ()
 Get file point. More...
 
void SetSeekOffset (long int seek_offset_p)
 Set the Seek Offset. More...
 
int MapOpStr2Int (std::string op_cmd_str) override
 map a op_cmd_str to int as input of SpecialOperator More...
 
std::string MapOpInt2Str (int op_int) override
 map op_int to string More...
 
void EnableTranposeOnRead ()
 EnableTranposeOnRead. More...
 
void EnableTranposeOnWrite ()
 EnableTranposeOnWrite. More...
 
void DisableTranposeOnRead ()
 DisableTranposeOnRead. More...
 
void DisableTranposeOnWrite ()
 DisableTranposeOnWrite. More...
 
- Public Member Functions inherited from Endpoint
 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 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 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...
 

Additional Inherited Members

- Protected Attributes inherited from Endpoint
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
 

Constructor & Destructor Documentation

◆ EndpointBinary() [1/2]

EndpointBinary::EndpointBinary ( std::string  endpoint_info_p)
inline

Construct a new EndpointBinary object.

Parameters
data_endpointcontains the info of the endpoint, e.g., file type + file info

◆ EndpointBinary() [2/2]

EndpointBinary::EndpointBinary ( )
inline

Construct a new Endpoint in Binary Nothing to do there, can be used as sub-endpoint of directory.

◆ ~EndpointBinary()

virtual EndpointBinary::~EndpointBinary ( )
inlinevirtual

Member Function Documentation

◆ Close()

int EndpointBinary::Close ( )
overridevirtual

close the end-point

Returns
int int < 0 error, >= 0 works

Implements Endpoint.

◆ Control()

int EndpointBinary::Control ( int  opt_code,
std::vector< std::string > &  parameter_v 
)
overridevirtual

call a special operator on binary endpoint such as OP_SET_BINARY_SIZE

Parameters
opt_code,speciallydefined code

Reimplemented from Endpoint.

◆ Create()

int EndpointBinary::Create ( )
overridevirtual

create the endpoint

Returns
< 0 error, >= 0 works

Implements Endpoint.

◆ DisableTranposeOnRead()

void EndpointBinary::DisableTranposeOnRead ( )

DisableTranposeOnRead.

◆ DisableTranposeOnWrite()

void EndpointBinary::DisableTranposeOnWrite ( )

DisableTranposeOnWrite.

◆ EnableTranposeOnRead()

void EndpointBinary::EnableTranposeOnRead ( )

EnableTranposeOnRead.

◆ EnableTranposeOnWrite()

void EndpointBinary::EnableTranposeOnWrite ( )

EnableTranposeOnWrite.

◆ ExtractMeta()

int EndpointBinary::ExtractMeta ( )
overridevirtual

extracts metadata, possbile endpoint_ranks/endpoint_dim_size/data_element_type

Returns
int < 0 error, >= 0 works

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

Implements Endpoint.

Reimplemented in EndpointTDMS.

◆ GetFP()

FILE * EndpointBinary::GetFP ( )

Get file point.

Returns
FILE* return null if nothing opened

◆ GetMode()

std::string EndpointBinary::GetMode ( )
inline

◆ Map2MyType()

void EndpointBinary::Map2MyType ( )
overridevirtual

call the finalize to close everything (like call Destractor)

Returns
int

Implements Endpoint.

◆ MapOpInt2Str()

std::string EndpointBinary::MapOpInt2Str ( int  op_int)
overridevirtual

map op_int to string

Parameters
op_int
Returns
std::string

Reimplemented from Endpoint.

◆ MapOpStr2Int()

int EndpointBinary::MapOpStr2Int ( std::string  op_cmd_str)
overridevirtual

map a op_cmd_str to int as input of SpecialOperator

Parameters
op_cmd_strcmd string
Returns
int

Reimplemented from Endpoint.

◆ Open()

int EndpointBinary::Open ( )
overridevirtual

open the endpoint

Returns
< 0 error, >= 0 works

Implements Endpoint.

◆ ParseEndpointInfo()

int EndpointBinary::ParseEndpointInfo ( )
overridevirtual

parse endpoint_info to my own info In binary, it map endpoint_info to filename,

parse endpoint_info to my own info In TMDS, it map endpoint_info to filename

Returns
int: 0 works, < 0 error,

Implements Endpoint.

◆ PrintInfo()

int EndpointBinary::PrintInfo ( )
overridevirtual

print information about the endpoint

Returns
< 0 error, >= 0 works

Implements Endpoint.

◆ Read()

int EndpointBinary::Read ( std::vector< unsigned long long >  start,
std::vector< unsigned long long >  end,
void *  data 
)
overridevirtual

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

Implements Endpoint.

◆ SetMode()

void EndpointBinary::SetMode ( std::string  model_str_p)
inline

◆ SetSeekOffset()

void EndpointBinary::SetSeekOffset ( long int  seek_offset_p)

Set the Seek Offset.

Parameters
seek_offset_p: set offset to be used for reading

◆ UpdateSeekOffset()

void EndpointBinary::UpdateSeekOffset ( )
virtual

update the seek_offset

Reimplemented in EndpointTDMS.

◆ Write()

int EndpointBinary::Write ( std::vector< unsigned long long >  start,
std::vector< unsigned long long >  end,
void *  data 
)
overridevirtual

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

Implements Endpoint.


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