Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
exatn
Commits
51513e15
Commit
51513e15
authored
Jul 25, 2019
by
Mccaskey, Alex
Browse files
Fixing erroneous git push
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
10a01bf8
Changes
35
Hide whitespace changes
Inline
Side-by-side
src/driver-rpc/CMakeLists.txt
View file @
51513e15
add_subdirectory
(
mpi
)
if
(
MPI_FOUND
)
add_subdirectory
(
mpi
)
endif
()
file
(
GLOB HEADERS *.hpp
)
...
...
src/driver-rpc/mpi/tests/CMakeLists.txt
View file @
51513e15
...
...
@@ -24,4 +24,3 @@ endif()
add_dependencies
(
client_test exatensor-build
)
add_dependencies
(
server_test exatensor-build
)
add_subdirectory
(
example-tensor-method
)
src/numerics/tensor.cpp
View file @
51513e15
/** ExaTN::Numerics: Tensor
REVISION: 2019/07/
17
REVISION: 2019/07/
22
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
...
...
@@ -157,9 +157,9 @@ void Tensor::appendDimension(DimExtent dim_extent)
return
;
}
std
::
size_t
Tensor
::
getTensor
Id
()
const
TensorHashType
Tensor
::
getTensor
Hash
()
const
{
return
reinterpret_cast
<
std
::
size_t
>
(
this
);
return
reinterpret_cast
<
TensorHashType
>
(
this
);
}
}
//namespace numerics
...
...
src/numerics/tensor.hpp
View file @
51513e15
/** ExaTN::Numerics: Abstract Tensor
REVISION: 2019/07/
17
REVISION: 2019/07/
22
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
...
...
@@ -48,6 +48,8 @@ namespace exatn{
namespace
numerics
{
using
TensorHashType
=
std
::
size_t
;
class
Tensor
{
public:
...
...
@@ -126,7 +128,7 @@ public:
void
appendDimension
(
DimExtent
dim_extent
);
/** Get the unique integer tensor id. **/
std
::
size_t
getTensor
Id
()
const
;
TensorHashType
getTensor
Hash
()
const
;
private:
...
...
src/numerics/tensor_connected.cpp
View file @
51513e15
/** ExaTN::Numerics: Tensor connected to other tensors inside a tensor network
REVISION: 2019/07/
16
REVISION: 2019/07/
22
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
...
...
src/numerics/tensor_operation.cpp
View file @
51513e15
/** ExaTN::Numerics: Tensor operation
REVISION: 2019/0
6/05
REVISION: 2019/0
7/22
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
...
...
@@ -46,12 +46,12 @@ unsigned int TensorOperation::getNumOperandsSet() const
return
static_cast
<
unsigned
int
>
(
operands_
.
size
());
}
std
::
size_t
TensorOperation
::
getTensorOperand
Id
(
unsigned
int
op_num
)
TensorHashType
TensorOperation
::
getTensorOperand
Hash
(
unsigned
int
op_num
)
const
{
return
((
this
->
getTensorOperand
(
op_num
)
).
get
())
->
getTensor
Id
();
return
this
->
getTensorOperand
(
op_num
)
->
getTensor
Hash
();
}
std
::
shared_ptr
<
Tensor
>
TensorOperation
::
getTensorOperand
(
unsigned
int
op_num
)
std
::
shared_ptr
<
Tensor
>
TensorOperation
::
getTensorOperand
(
unsigned
int
op_num
)
const
{
if
(
op_num
<
operands_
.
size
())
return
operands_
[
op_num
];
return
std
::
shared_ptr
<
Tensor
>
(
nullptr
);
...
...
src/numerics/tensor_operation.hpp
View file @
51513e15
/** ExaTN::Numerics: Tensor operation
REVISION: 2019/0
6/05
REVISION: 2019/0
7/22
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
...
...
@@ -51,10 +51,10 @@ public:
unsigned
int
getNumOperandsSet
()
const
;
/** Returns a unique integer tensor operand identifier. **/
std
::
size_t
getTensorOperand
Id
(
unsigned
int
op_num
);
TensorHashType
getTensorOperand
Hash
(
unsigned
int
op_num
)
const
;
/** Returns a co-owned pointer to a specific tensor operand, or nullptr if not yet set. **/
std
::
shared_ptr
<
Tensor
>
getTensorOperand
(
unsigned
int
op_num
);
std
::
shared_ptr
<
Tensor
>
getTensorOperand
(
unsigned
int
op_num
)
const
;
/** Sets the next tensor operand. **/
void
setTensorOperand
(
std
::
shared_ptr
<
Tensor
>
tensor
);
...
...
src/runtime/CMakeLists.txt
View file @
51513e15
...
...
@@ -13,15 +13,17 @@ add_library(${LIBRARY_NAME}
target_include_directories
(
${
LIBRARY_NAME
}
PUBLIC .
PUBLIC .
graph optimizer executor
${
CMAKE_SOURCE_DIR
}
/tpls/ExaTensor/include
${
CMAKE_SOURCE_DIR
}
/src/exatn
${
CMAKE_SOURCE_DIR
}
/src/exatn
/numerics
${
CMAKE_SOURCE_DIR
}
/tpls/cppmicroservices/framework/include
PRIVATE
${
CMAKE_SOURCE_DIR
}
/src/exatn
${
CMAKE_SOURCE_DIR
}
/src/driver-rpc
)
target_link_libraries
(
${
LIBRARY_NAME
}
PUBLIC CppMicroServices exatn-numerics exatn-runtime-graph PRIVATE Boost::graph
)
target_link_libraries
(
${
LIBRARY_NAME
}
PUBLIC CppMicroServices exatn-numerics
PRIVATE exatn-runtime-executor exatn-runtime-graph Boost::graph
)
if
(
APPLE
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES INSTALL_RPATH
"@loader_path"
)
...
...
src/runtime/executor/CMakeLists.txt
View file @
51513e15
set
(
LIBRARY_NAME exatn-runtime-executor
)
file
(
GLOB SRC GraphExecutorActivator.cpp exatensor/ExatensorExecutor.cpp talsh/TalshExecutor.cpp
)
file
(
GLOB SRC
ExecutorActivator.cpp
node_executors/talsh/node_executor_talsh.cpp
node_executors/exatensor/node_executor_exatensor.cpp
graph_executors/eager/graph_executor_eager.cpp
graph_executors/lazy/graph_executor_lazy.cpp
)
usfunctiongetresourcesource
(
TARGET
${
LIBRARY_NAME
}
OUT SRC
)
usfunctiongeneratebundleinit
(
TARGET
${
LIBRARY_NAME
}
OUT SRC
)
...
...
@@ -12,8 +17,10 @@ add_library(${LIBRARY_NAME}
target_include_directories
(
${
LIBRARY_NAME
}
PUBLIC . talsh exatensor
${
CMAKE_SOURCE_DIR
}
/src/exatn
PUBLIC . node_executors/talsh node_executors/exatensor
graph_executors/eager graph_executors/lazy
${
CMAKE_SOURCE_DIR
}
/tpls/ExaTensor/include
${
CMAKE_SOURCE_DIR
}
/src/exatn/numerics
${
CMAKE_SOURCE_DIR
}
/tpls/cppmicroservices/framework/include
)
...
...
@@ -32,7 +39,7 @@ usfunctionembedresources(TARGET
FILES
manifest.json
)
target_link_libraries
(
${
LIBRARY_NAME
}
PUBLIC CppMicroServices PRIVATE exatn-runtime-graph
)
target_link_libraries
(
${
LIBRARY_NAME
}
PUBLIC CppMicroServices
exatn
PRIVATE exatn-runtime-graph
)
if
(
APPLE
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES INSTALL_RPATH
"@loader_path/../lib;@loader_path"
)
...
...
@@ -50,4 +57,3 @@ file (GLOB HEADERS *.hpp)
install
(
FILES
${
HEADERS
}
DESTINATION include/exatn/runtime
)
install
(
TARGETS
${
LIBRARY_NAME
}
DESTINATION plugins
)
src/runtime/executor/ExecutorActivator.cpp
0 → 100644
View file @
51513e15
#include
"graph_executor_eager.hpp"
#include
"graph_executor_lazy.hpp"
#include
"node_executor_talsh.hpp"
#include
"node_executor_exatensor.hpp"
#include
"cppmicroservices/BundleActivator.h"
#include
"cppmicroservices/BundleContext.h"
#include
<memory>
#include
<set>
using
namespace
cppmicroservices
;
namespace
{
/**
*/
class
US_ABI_LOCAL
ExecutorActivator
:
public
BundleActivator
{
public:
ExecutorActivator
()
{}
/**
*/
void
Start
(
BundleContext
context
)
{
auto
g1
=
std
::
make_shared
<
exatn
::
runtime
::
EagerGraphExecutor
>
();
auto
g2
=
std
::
make_shared
<
exatn
::
runtime
::
LazyGraphExecutor
>
();
context
.
RegisterService
<
exatn
::
runtime
::
TensorGraphExecutor
>
(
g1
);
context
.
RegisterService
<
exatn
::
runtime
::
TensorGraphExecutor
>
(
g2
);
auto
n1
=
std
::
make_shared
<
exatn
::
runtime
::
TalshNodeExecutor
>
();
auto
n2
=
std
::
make_shared
<
exatn
::
runtime
::
ExatensorNodeExecutor
>
();
context
.
RegisterService
<
exatn
::
runtime
::
TensorNodeExecutor
>
(
n1
);
context
.
RegisterService
<
exatn
::
runtime
::
TensorNodeExecutor
>
(
n2
);
}
/**
*/
void
Stop
(
BundleContext
/*context*/
)
{}
};
}
// namespace
CPPMICROSERVICES_EXPORT_BUNDLE_ACTIVATOR
(
ExecutorActivator
)
src/runtime/executor/graph_executors/eager/graph_executor_eager.cpp
0 → 100644
View file @
51513e15
#include
"graph_executor_eager.hpp"
namespace
exatn
{
namespace
runtime
{
void
EagerGraphExecutor
::
execute
(
TensorGraph
&
dag
)
{
int
nodes_executed
=
0
,
execnode_id
;
auto
num_nodes
=
dag
.
getNumNodes
();
while
(
nodes_executed
<=
num_nodes
)
{
execnode_id
=
nextExecutableNodeId
(
dag
);
node_executor_
->
execute
(
*
((
dag
.
getNodeProperties
(
execnode_id
)).
getOperation
()));
//TODO: update output tensor execution table
dag
.
setNodeExecuted
(
execnode_id
);
nodes_executed
++
;
num_nodes
=
dag
.
getNumNodes
();
}
}
int
EagerGraphExecutor
::
nextExecutableNodeId
(
TensorGraph
&
dag
){
auto
num_nodes
=
dag
.
getNumNodes
();
int
i
;
for
(
i
=
0
;
i
<
num_nodes
;
i
++
)
{
if
(
!
dag
.
nodeExecuted
(
i
))
{
if
(
dag
.
degree
(
i
)
==
0
)
break
;
else
{
auto
n_list
=
dag
.
getNeighborList
(
i
);
int
j
;
for
(
j
=
0
;
j
<
n_list
.
size
();
j
++
)
if
(
!
dag
.
nodeExecuted
(
j
))
break
;
if
(
j
>=
n_list
.
size
())
break
;
}
}
}
assert
(
i
<
num_nodes
);
return
i
;
}
}
//namespace runtime
}
//namespace exatn
src/runtime/executor/graph_executors/eager/graph_executor_eager.hpp
0 → 100644
View file @
51513e15
/** ExaTN:: Tensor Runtime: Tensor graph executor: Eager
REVISION: 2019/07/24
Copyright (C) 2018-2019 Tiffany Mintz, Dmitry Lyakh, Alex McCaskey
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle)
Rationale:
**/
#ifndef EXATN_RUNTIME_EAGER_GRAPH_EXECUTOR_HPP_
#define EXATN_RUNTIME_EAGER_GRAPH_EXECUTOR_HPP_
#include
"tensor_graph_executor.hpp"
#include
<memory>
namespace
exatn
{
namespace
runtime
{
class
EagerGraphExecutor
:
public
TensorGraphExecutor
{
public:
/** Traverses the DAG and executes all its nodes. **/
void
execute
(
TensorGraph
&
dag
)
override
;
protected:
int
nextExecutableNodeId
(
TensorGraph
&
dag
);
};
}
//namespace runtime
}
//namespace exatn
#endif //EXATN_RUNTIME_EAGER_GRAPH_EXECUTOR_HPP_
src/runtime/executor/graph_executors/lazy/graph_executor_lazy.cpp
0 → 100644
View file @
51513e15
#include
"graph_executor_lazy.hpp"
namespace
exatn
{
namespace
runtime
{
void
LazyGraphExecutor
::
execute
(
TensorGraph
&
dag
)
{
//`Implement
return
;
}
}
//namespace runtime
}
//namespace exatn
src/runtime/executor/graph_executors/lazy/graph_executor_lazy.hpp
0 → 100644
View file @
51513e15
/** ExaTN:: Tensor Runtime: Tensor graph executor: Lazy
REVISION: 2019/07/24
Copyright (C) 2018-2019 Dmitry Lyakh, Tiffany Mintz, Alex McCaskey
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle)
Rationale:
**/
#ifndef EXATN_RUNTIME_LAZY_GRAPH_EXECUTOR_HPP_
#define EXATN_RUNTIME_LAZY_GRAPH_EXECUTOR_HPP_
#include
"tensor_graph_executor.hpp"
#include
<memory>
namespace
exatn
{
namespace
runtime
{
class
LazyGraphExecutor
:
public
TensorGraphExecutor
{
public:
/** Traverses the DAG and executes all its nodes. **/
void
execute
(
TensorGraph
&
dag
)
override
;
protected:
};
}
//namespace runtime
}
//namespace exatn
#endif //EXATN_RUNTIME_LAZY_GRAPH_EXECUTOR_HPP_
src/runtime/executor/node_executors/exatensor/node_executor_exatensor.cpp
0 → 100644
View file @
51513e15
#include
"node_executor_exatensor.hpp"
namespace
exatn
{
namespace
runtime
{
NodeExecHandleType
ExatensorNodeExecutor
::
execute
(
TensorOperation
&
op
)
{
//`Implement
return
0
;
}
bool
ExatensorNodeExecutor
::
sync
(
NodeExecHandleType
op_handle
,
bool
wait
)
{
//`Implement
return
false
;
}
}
//namespace runtime
}
//namespace exatn
src/runtime/executor/node_executors/exatensor/node_executor_exatensor.hpp
0 → 100644
View file @
51513e15
/** ExaTN:: Tensor Runtime: Tensor graph node executor: Exatensor
REVISION: 2019/07/24
Copyright (C) 2018-2019 Dmitry Lyakh, Tiffany Mintz, Alex McCaskey
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle)
Rationale:
**/
#ifndef EXATN_RUNTIME_EXATENSOR_NODE_EXECUTOR_HPP_
#define EXATN_RUNTIME_EXATENSOR_NODE_EXECUTOR_HPP_
#include
"tensor_node_executor.hpp"
namespace
exatn
{
namespace
runtime
{
class
ExatensorNodeExecutor
:
public
TensorNodeExecutor
{
public:
NodeExecHandleType
execute
(
TensorOperation
&
op
)
override
;
bool
sync
(
NodeExecHandleType
op_handle
,
bool
wait
)
override
;
protected:
//`ExaTENSOR executor state
};
}
//namespace runtime
}
//namespace exatn
#endif //EXATN_RUNTIME_EXATENSOR_NODE_EXECUTOR_HPP_
src/runtime/executor/node_executors/talsh/node_executor_talsh.cpp
0 → 100644
View file @
51513e15
#include
"node_executor_talsh.hpp"
namespace
exatn
{
namespace
runtime
{
NodeExecHandleType
TalshNodeExecutor
::
execute
(
TensorOperation
&
op
)
{
//`Implement
return
0
;
}
bool
TalshNodeExecutor
::
sync
(
NodeExecHandleType
op_handle
,
bool
wait
)
{
//`Implement
return
false
;
}
}
//namespace runtime
}
//namespace exatn
src/runtime/executor/node_executors/talsh/node_executor_talsh.hpp
0 → 100644
View file @
51513e15
/** ExaTN:: Tensor Runtime: Tensor graph node executor: Talsh
REVISION: 2019/07/24
Copyright (C) 2018-2019 Dmitry Lyakh, Tiffany Mintz, Alex McCaskey
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle)
Rationale:
**/
#ifndef EXATN_RUNTIME_TALSH_NODE_EXECUTOR_HPP_
#define EXATN_RUNTIME_TALSH_NODE_EXECUTOR_HPP_
#include
"tensor_node_executor.hpp"
namespace
exatn
{
namespace
runtime
{
class
TalshNodeExecutor
:
public
TensorNodeExecutor
{
public:
NodeExecHandleType
execute
(
TensorOperation
&
op
)
override
;
bool
sync
(
NodeExecHandleType
op_handle
,
bool
wait
)
override
;
protected:
//`TALSH executor state
};
}
//namespace runtime
}
//namespace exatn
#endif //EXATN_RUNTIME_TALSH_NODE_EXECUTOR_HPP_
src/runtime/executor/tensor_graph_executor.hpp
0 → 100644
View file @
51513e15
/** ExaTN:: Tensor Runtime: Tensor graph executor
REVISION: 2019/07/24
Copyright (C) 2018-2019 Dmitry Lyakh, Tiffany Mintz, Alex McCaskey
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle)
Rationale:
**/
#ifndef EXATN_RUNTIME_TENSOR_GRAPH_EXECUTOR_HPP_
#define EXATN_RUNTIME_TENSOR_GRAPH_EXECUTOR_HPP_
#include
"tensor_graph.hpp"
#include
"tensor_node_executor.hpp"
#include
"tensor_operation.hpp"
#include
<memory>
namespace
exatn
{
namespace
runtime
{
class
TensorGraphExecutor
{
public:
/** Set the DAG node executor (tensor operation executor). **/
bool
setNodeExecutor
(
std
::
shared_ptr
<
TensorNodeExecutor
>
node_executor
)
{
if
(
node_executor_
)
return
false
;
node_executor_
=
node_executor
;
return
true
;
}
/** Traverses the DAG and executes all its nodes. **/
virtual
void
execute
(
TensorGraph
&
dag
)
=
0
;
protected:
std
::
shared_ptr
<
TensorNodeExecutor
>
node_executor_
;
};
}
//namespace runtime
}
//namespace exatn
#endif //EXATN_RUNTIME_TENSOR_GRAPH_EXECUTOR_HPP_
src/runtime/executor/tensor_node_executor.hpp
0 → 100644
View file @
51513e15
/** ExaTN:: Tensor Runtime: Tensor graph node executor
REVISION: 2019/07/24
Copyright (C) 2018-2019 Dmitry Lyakh, Tiffany Mintz, Alex McCaskey
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle)
Rationale:
**/
#ifndef EXATN_RUNTIME_TENSOR_NODE_EXECUTOR_HPP_
#define EXATN_RUNTIME_TENSOR_NODE_EXECUTOR_HPP_
#include
"tensor_operation.hpp"
namespace
exatn
{
namespace
runtime
{
// Tensor implementation:
using
numerics
::
TensorHashType
;
//each numerics::Tensor has its unique integer hash
using
numerics
::
Tensor
;
using
numerics
::
TensorOperation
;
// DAG node execution handle (tensor operation execution handle):
using
NodeExecHandleType
=
std
::
size_t
;
class
TensorNodeExecutor
{
public:
/** Executes the tensor operation found in a DAG node. **/
virtual
NodeExecHandleType
execute
(
TensorOperation
&
op
)
=
0
;
/** Synchronizes the execution of a tensor operation. **/
virtual
bool
sync
(
NodeExecHandleType
op_handle
,
bool
wait
=
false
)
=
0
;
};
}
//namespace runtime
}
//namespace exatn
#endif //EXATN_RUNTIME_TENSOR_NODE_EXECUTOR_HPP_
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment