Public Member Functions |
|
| Tensor (std::string filename, const Ref< MemoryGrp > &mem) |
|
std::string | filename () const |
| | returns filename_
|
|
MemoryGrpRegion * | file () const |
| | returns MemoryGrpRegion for this tensor
|
|
std::fstream * | file () |
|
void | set_filesize (long i) |
| | set/get the filesize of the tensor
|
|
long | get_filesize () const |
|
void | createfile () |
| | create/delete the distributed file for the tensor
|
|
void | deletefile () |
|
void | input_offset (long tag, long offset) |
| | input for the hash table
|
|
void | get_block (long tag, double *data) |
| | get a block from the distributed file (non-blocking)
|
|
void | add_block (long tag, double *data) |
| | add a block to the distributed file (non-blocking); double* data will be destroyed
|
|
void | put_block (long tag, double *data) |
| | put a block to the distributed file (non-blocking)
|
|
bool | exists (long tag) const |
| | does this block exist?
|
|
bool | is_this_local (long tag) |
| | returns if a block associated with long tag resides in a local memory or not
|
|
void | zero () |
| | initialize/clear tensors to zero
|
|
void | assign (double a) |
| | assigns all values to a
|
|
double | norm () const |
| | obtain the norm of a tensor
|
|
double | ddot (Ref< Tensor > &) const |
| | obtain the ddot of two tensors
|
|
Ref< Tensor > | copy () const |
| | return a copy of self
|
|
Ref< Tensor > | clone () const |
| | return a tensor that have the same hashtable, and is intilaized to zero
|
|
void | daxpy (const Ref< Tensor > &, double) |
| | perform daxpy of tensors (self+=a*other)
|
|
void | scale (double a) |
| | scale self by a
|
|
void | sync () const |
| | sync
|
|
void | sync () const |
|
void | print (const std::string &label, std::ostream &os=ExEnv::out0()) const |
| | print
|
Protected Member Functions |
|
std::vector< long > | determine_filesizes () |
| | determines the distribution of blocks to nodes
|
Protected Attributes |
|
const Ref< MemoryGrp > & | mem_ |
|
std::string | filename_ |
| | for use in disk-based algorithm
|
|
std::map< long, long > | hash_table_ |
| | hash table: hash_table_.insert(key,offset)
|
|
long | filesize_ |
| | tensor size in double
|
|
MemoryGrpRegion * | file_ |
| | data area
|
|
std::fstream * | file_ |
|
bool | file_allocated_ |