ExaTN
Public Member Functions | List of all members
exatn::NumServer Class Referencefinal

Public Member Functions

 NumServer (const NumServer &)=delete
 
NumServeroperator= (const NumServer &)=delete
 
 NumServer (NumServer &&) noexcept=delete
 
NumServeroperator= (NumServer &&) noexcept=delete
 
void reconfigureTensorRuntime (const std::string &dag_executor_name, const std::string &node_executor_name)
 
void resetRuntimeLoggingLevel (int level=0)
 
void registerTensorMethod (const std::string &tag, std::shared_ptr< TensorMethod > method)
 
std::shared_ptr< TensorMethod > getTensorMethod (const std::string &tag)
 
void registerExternalData (const std::string &tag, std::shared_ptr< BytePacket > packet)
 
std::shared_ptr< BytePacket > getExternalData (const std::string &tag)
 
ScopeId openScope (const std::string &scope_name)
 
ScopeId closeScope ()
 
SpaceId createVectorSpace (const std::string &space_name, DimExtent space_dim, const VectorSpace **space_ptr=nullptr)
 
void destroyVectorSpace (const std::string &space_name)
 
void destroyVectorSpace (SpaceId space_id)
 
const VectorSpacegetVectorSpace (const std::string &space_name) const
 
SubspaceId createSubspace (const std::string &subspace_name, const std::string &space_name, std::pair< DimOffset, DimOffset > bounds, const Subspace **subspace_ptr=nullptr)
 
void destroySubspace (const std::string &subspace_name)
 
void destroySubspace (SubspaceId subspace_id)
 
const SubspacegetSubspace (const std::string &subspace_name) const
 
void submit (std::shared_ptr< TensorOperation > operation)
 
void submit (TensorNetwork &network)
 
void submit (std::shared_ptr< TensorNetwork > network)
 
bool sync (const Tensor &tensor, bool wait=true)
 
bool sync (TensorOperation &operation, bool wait=true)
 
bool sync (TensorNetwork &network, bool wait=true)
 
bool sync (const std::string &name, bool wait=true)
 
TensorgetTensorRef (const std::string &name)
 
TensorElementType getTensorElementType (const std::string &name) const
 
template<typename... Args>
bool createTensor (const std::string &name, TensorElementType element_type, Args &&... args)
 
template<typename... Args>
bool createTensorSync (const std::string &name, TensorElementType element_type, Args &&... args)
 
bool destroyTensor (const std::string &name)
 
bool destroyTensorSync (const std::string &name)
 
template<typename NumericType >
bool initTensor (const std::string &name, NumericType value)
 
template<typename NumericType >
bool initTensorSync (const std::string &name, NumericType value)
 
bool transformTensor (const std::string &name, std::shared_ptr< TensorMethod > functor)
 
bool transformTensorSync (const std::string &name, std::shared_ptr< TensorMethod > functor)
 
template<typename NumericType >
bool addTensors (const std::string &addition, NumericType alpha)
 
template<typename NumericType >
bool addTensorsSync (const std::string &addition, NumericType alpha)
 
template<typename NumericType >
bool contractTensors (const std::string &contraction, NumericType alpha)
 
template<typename NumericType >
bool contractTensorsSync (const std::string &contraction, NumericType alpha)
 
bool evaluateTensorNetwork (const std::string &name, const std::string &network)
 
bool evaluateTensorNetworkSync (const std::string &name, const std::string &network)
 
std::shared_ptr< talsh::Tensor > getLocalTensor (std::shared_ptr< Tensor > tensor, const std::vector< std::pair< DimOffset, DimExtent >> &slice_spec)
 
std::shared_ptr< talsh::Tensor > getLocalTensor (std::shared_ptr< Tensor > tensor)
 
std::shared_ptr< talsh::Tensor > getLocalTensor (const std::string &name, const std::vector< std::pair< DimOffset, DimExtent >> &slice_spec)
 
std::shared_ptr< talsh::Tensor > getLocalTensor (const std::string &name)
 

Member Function Documentation

◆ addTensors()

template<typename NumericType >
bool exatn::NumServer::addTensors ( const std::string &  addition,
NumericType  alpha 
)

Performs tensor addition: tensor0 += tensor1 * alpha

◆ closeScope()

ScopeId exatn::NumServer::closeScope ( )

Closes the currently open TAProL scope and returns its parental scope id.

◆ contractTensors()

template<typename NumericType >
bool exatn::NumServer::contractTensors ( const std::string &  contraction,
NumericType  alpha 
)

Performs tensor contraction: tensor0 += tensor1 * tensor2 * alpha

◆ createSubspace()

SubspaceId exatn::NumServer::createSubspace ( const std::string &  subspace_name,
const std::string &  space_name,
std::pair< DimOffset, DimOffset >  bounds,
const Subspace **  subspace_ptr = nullptr 
)

Creates a named subspace of a named vector space, returns its registered id, and, optionally, a non-owning pointer to it.

◆ createTensor()

template<typename... Args>
bool exatn::NumServer::createTensor ( const std::string &  name,
TensorElementType  element_type,
Args &&...  args 
)

Declares, registers and actually creates a tensor via processing backend. See numerics::Tensor constructors for different creation options.

◆ createVectorSpace()

SpaceId exatn::NumServer::createVectorSpace ( const std::string &  space_name,
DimExtent  space_dim,
const VectorSpace **  space_ptr = nullptr 
)

Creates a named vector space, returns its registered id, and, optionally, a non-owning pointer to it.

◆ destroySubspace()

void exatn::NumServer::destroySubspace ( const std::string &  subspace_name)

Destroys a previously created named subspace of a named vector space.

◆ destroyTensor()

bool exatn::NumServer::destroyTensor ( const std::string &  name)

Destroys a tensor, including its backend representation.

◆ destroyVectorSpace()

void exatn::NumServer::destroyVectorSpace ( const std::string &  space_name)

Destroys a previously created named vector space.

◆ evaluateTensorNetwork()

bool exatn::NumServer::evaluateTensorNetwork ( const std::string &  name,
const std::string &  network 
)

Performs a full evaluation of a tensor network.

◆ getExternalData()

std::shared_ptr< BytePacket > exatn::NumServer::getExternalData ( const std::string &  tag)

Retrieves a registered external data packet.

◆ getLocalTensor() [1/4]

std::shared_ptr< talsh::Tensor > exatn::NumServer::getLocalTensor ( const std::string &  name)

This overload returns a copy of the full tensor while referencing it by its registered name.

◆ getLocalTensor() [2/4]

std::shared_ptr< talsh::Tensor > exatn::NumServer::getLocalTensor ( const std::string &  name,
const std::vector< std::pair< DimOffset, DimExtent >> &  slice_spec 
)

This overload references the ExaTN tensor by its registered name.

◆ getLocalTensor() [3/4]

std::shared_ptr< talsh::Tensor > exatn::NumServer::getLocalTensor ( std::shared_ptr< Tensor tensor)

This overload will return a copy of the full tensor.

◆ getLocalTensor() [4/4]

std::shared_ptr< talsh::Tensor > exatn::NumServer::getLocalTensor ( std::shared_ptr< Tensor tensor,
const std::vector< std::pair< DimOffset, DimExtent >> &  slice_spec 
)

Returns a locally stored tensor slice (talsh::Tensor) providing access to tensor elements. This slice will be extracted from the exatn::numerics::Tensor implementation as a copy. The returned future becomes ready once the execution thread has retrieved the slice copy.

◆ getSubspace()

const Subspace * exatn::NumServer::getSubspace ( const std::string &  subspace_name) const

Returns a non-owning pointer to a previosuly registered named subspace of a previously registered named vector space.

◆ getTensorElementType()

TensorElementType exatn::NumServer::getTensorElementType ( const std::string &  name) const

Returns the tensor element type.

◆ getTensorMethod()

std::shared_ptr< TensorMethod > exatn::NumServer::getTensorMethod ( const std::string &  tag)

Retrieves a registered external tensor method.

◆ getTensorRef()

Tensor & exatn::NumServer::getTensorRef ( const std::string &  name)

Returns the reference to the actual tensor object.

◆ getVectorSpace()

const VectorSpace * exatn::NumServer::getVectorSpace ( const std::string &  space_name) const

Returns a non-owning pointer to a previosuly registered vector space, including the anonymous vector space.

◆ initTensor()

template<typename NumericType >
bool exatn::NumServer::initTensor ( const std::string &  name,
NumericType  value 
)

Initializes a tensor to some scalar value.

◆ openScope()

ScopeId exatn::NumServer::openScope ( const std::string &  scope_name)

Opens a new (child) TAProL scope and returns its id.

◆ reconfigureTensorRuntime()

void exatn::NumServer::reconfigureTensorRuntime ( const std::string &  dag_executor_name,
const std::string &  node_executor_name 
)

Reconfigures tensor runtime implementation.

◆ registerExternalData()

void exatn::NumServer::registerExternalData ( const std::string &  tag,
std::shared_ptr< BytePacket >  packet 
)

Registers an external data packet.

◆ registerTensorMethod()

void exatn::NumServer::registerTensorMethod ( const std::string &  tag,
std::shared_ptr< TensorMethod >  method 
)

Registers an external tensor method.

◆ resetRuntimeLoggingLevel()

void exatn::NumServer::resetRuntimeLoggingLevel ( int  level = 0)

Resets the runtime logging level (0:none).

◆ submit() [1/2]

void exatn::NumServer::submit ( std::shared_ptr< TensorOperation operation)

Submits an individual tensor operation for processing.

◆ submit() [2/2]

void exatn::NumServer::submit ( TensorNetwork network)

Submits a tensor network for processing (evaluating the tensor-result).

◆ sync() [1/4]

bool exatn::NumServer::sync ( const std::string &  name,
bool  wait = true 
)

HIGHER-LEVEL WRAPPERS Synchronizes all outstanding update operations on a given tensor.

◆ sync() [2/4]

bool exatn::NumServer::sync ( const Tensor tensor,
bool  wait = true 
)

Synchronizes all update operations on a given tensor.

◆ sync() [3/4]

bool exatn::NumServer::sync ( TensorNetwork network,
bool  wait = true 
)

Synchronizes execution of a specific tensor network.

◆ sync() [4/4]

bool exatn::NumServer::sync ( TensorOperation operation,
bool  wait = true 
)

Synchronizes execution of a specific tensor operation.

◆ transformTensor()

bool exatn::NumServer::transformTensor ( const std::string &  name,
std::shared_ptr< TensorMethod >  functor 
)

Transforms (updates) a tensor according to a user-defined tensor functor.


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