Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
|
Data Structures | |
class | CTF::TensorOperationBase |
Provides a untemplated base class for tensor operations. More... | |
class | CTF::TensorOperation |
A tensor operation, containing all the data (op, lhs, rhs) required to run it. Also provides methods to get a list of inputs and outputs, as well as successor and dependency information used in scheduling. More... | |
class | CTF::ScheduleBase |
struct | CTF::ScheduleTimer |
class | CTF::Schedule |
Enumerations | |
enum | CTF::TensorOperationTypes { CTF::TENSOR_OP_NONE, CTF::TENSOR_OP_SET, CTF::TENSOR_OP_SUM, CTF::TENSOR_OP_SUBTRACT, CTF::TENSOR_OP_MULTIPLY } |
Functions | |
virtual | CTF::TensorOperationBase::~TensorOperationBase () |
CTF::TensorOperation::TensorOperation (TensorOperationTypes op, Idx_Tensor *lhs, const CTF_int::Term *rhs) | |
Constructor, create the tensor operation lhs op= rhs. More... | |
void | CTF::TensorOperation::get_outputs (std::set< Idx_Tensor *, CTF_int::tensor_name_less > *outputs_set) const |
appends the tensors this writes to to the input set More... | |
void | CTF::TensorOperation::get_inputs (std::set< Idx_Tensor *, CTF_int::tensor_name_less > *inputs_set) const |
appends the tensors this depends on (reads from, including the output if a previous value is required) to the input set More... | |
void | CTF::TensorOperation::execute (std::map< CTF_int::tensor *, CTF_int::tensor * > *remap=NULL) |
runs this operation, but does NOT handle dependency scheduling optionally takes a remapping of tensors More... | |
double | CTF::TensorOperation::estimate_time () |
provides an estimated runtime cost More... | |
bool | CTF::TensorOperation::is_dummy () |
const char * | CTF::TensorOperation::name () |
virtual void | CTF::ScheduleBase::add_operation (TensorOperationBase *op)=0 |
CTF::ScheduleTimer::ScheduleTimer () | |
void | CTF::ScheduleTimer::operator+= (ScheduleTimer const &B) |
CTF::Schedule::Schedule (World *world=NULL) | |
Constructor, optionally specifying a world to restrict processor allocations to. More... | |
void | CTF::Schedule::record () |
Starts recording all tensor operations to this schedule (instead of executing them immediately) More... | |
ScheduleTimer | CTF::Schedule::execute () |
Executes the schedule and implicitly terminates recording. More... | |
ScheduleTimer | CTF::Schedule::partition_and_execute () |
Executes a slide of the ready_queue, partitioning it among the processors in the grid. More... | |
void | CTF::Schedule::schedule_op_successors (TensorOperation *op) |
Call when a tensor op finishes, this adds newly enabled ops to the ready queue. More... | |
void | CTF::Schedule::add_operation_typed (TensorOperation *op) |
Adds a tensor operation to this schedule. THIS IS CALL ORDER DEPENDENT - operations will appear to execute sequentially in the order they were added. More... | |
void | CTF::Schedule::add_operation (TensorOperationBase *op) |
void | CTF::Schedule::set_max_partitions (int in_partitions) |
Enumerator | |
---|---|
TENSOR_OP_NONE | |
TENSOR_OP_SET | |
TENSOR_OP_SUM | |
TENSOR_OP_SUBTRACT | |
TENSOR_OP_MULTIPLY |
Definition at line 13 of file schedule.h.
|
pure virtual |
Implemented in CTF::Schedule.
Referenced by CTF::Idx_Tensor::operator*=(), CTF::Idx_Tensor::operator+=(), CTF::Idx_Tensor::operator-=(), and CTF::Idx_Tensor::operator=().
|
virtual |
Implements CTF::ScheduleBase.
Definition at line 327 of file schedule.cxx.
References CTF::Schedule::add_operation_typed().
void CTF::Schedule::add_operation_typed | ( | TensorOperation * | op | ) |
Adds a tensor operation to this schedule. THIS IS CALL ORDER DEPENDENT - operations will appear to execute sequentially in the order they were added.
Definition at line 279 of file schedule.cxx.
References CTF::TensorOperation::dependency_count, CTF::TensorOperation::get_inputs(), CTF::TensorOperation::get_outputs(), CTF::Schedule::latest_write, CTF::TensorOperation::reads, CTF::Schedule::root_tasks, CTF::Schedule::steps_original, CTF::TensorOperation::successors, and CTF::TENSOR_OP_NONE.
Referenced by CTF::Schedule::add_operation().
double CTF::TensorOperation::estimate_time | ( | ) |
provides an estimated runtime cost
Definition at line 390 of file schedule.cxx.
Referenced by CTF::tensor_op_cost_greater().
void CTF::TensorOperation::execute | ( | std::map< CTF_int::tensor *, CTF_int::tensor * > * | remap = NULL | ) |
runs this operation, but does NOT handle dependency scheduling optionally takes a remapping of tensors
Definition at line 333 of file schedule.cxx.
References CTF::Idx_Tensor::clone(), CTF_int::Term::clone(), CTF::TENSOR_OP_MULTIPLY, CTF::TENSOR_OP_NONE, CTF::TENSOR_OP_SET, CTF::TENSOR_OP_SUBTRACT, and CTF::TENSOR_OP_SUM.
ScheduleTimer CTF::Schedule::execute | ( | ) |
Executes the schedule and implicitly terminates recording.
Definition at line 244 of file schedule.cxx.
References CTF::World::comm, CTF::ScheduleTimer::imbalance_acuum_time, CTF::ScheduleTimer::imbalance_wall_time, ctf.core::it, CTF::Schedule::partition_and_execute(), ctf.core::rank(), CTF::Schedule::ready_tasks, CTF::Schedule::root_tasks, CTF::Schedule::schedule_op_successors(), CTF::Schedule::steps_original, and CTF::Schedule::world.
void CTF::TensorOperation::get_inputs | ( | std::set< Idx_Tensor *, CTF_int::tensor_name_less > * | inputs_set | ) | const |
appends the tensors this depends on (reads from, including the output if a previous value is required) to the input set
Definition at line 372 of file schedule.cxx.
References CTF::TENSOR_OP_MULTIPLY, CTF::TENSOR_OP_SET, CTF::TENSOR_OP_SUBTRACT, and CTF::TENSOR_OP_SUM.
Referenced by CTF::Schedule::add_operation_typed().
void CTF::TensorOperation::get_outputs | ( | std::set< Idx_Tensor *, CTF_int::tensor_name_less > * | outputs_set | ) | const |
appends the tensors this writes to to the input set
Definition at line 366 of file schedule.cxx.
Referenced by CTF::Schedule::add_operation_typed().
|
inline |
Definition at line 70 of file schedule.h.
References CTF::TENSOR_OP_NONE.
|
inline |
Debugging Helpers
Definition at line 91 of file schedule.h.
|
inline |
Definition at line 127 of file schedule.h.
References CTF::ScheduleTimer::comm_down_time, CTF::ScheduleTimer::comm_up_time, CTF::ScheduleTimer::exec_time, CTF::ScheduleTimer::imbalance_acuum_time, CTF::ScheduleTimer::imbalance_wall_time, and CTF::ScheduleTimer::total_time.
|
inline |
Executes a slide of the ready_queue, partitioning it among the processors in the grid.
Definition at line 47 of file schedule.cxx.
References CTF_int::tensor::add_to_subworld(), CTF::World::comm, CTF::ScheduleTimer::comm_down_time, CTF::ScheduleTimer::comm_up_time, CTF::ScheduleTimer::exec_time, CTF::ScheduleTimer::imbalance_acuum_time, CTF::ScheduleTimer::imbalance_wall_time, CTF_int::algstrct::mulid(), CTF::Idx_Tensor::parent, CTF::Schedule::partitions, ctf.core::rank(), CTF::Schedule::ready_tasks, CTF::Schedule::schedule_op_successors(), CTF_int::tensor::sr, CTF::tensor_op_cost_greater(), CTF::ScheduleTimer::total_time, and CTF::Schedule::world.
Referenced by CTF::Schedule::execute().
void CTF::Schedule::record | ( | ) |
Starts recording all tensor operations to this schedule (instead of executing them immediately)
Definition at line 10 of file schedule.cxx.
|
inline |
Constructor, optionally specifying a world to restrict processor allocations to.
Definition at line 144 of file schedule.h.
|
inline |
Call when a tensor op finishes, this adds newly enabled ops to the ready queue.
Definition at line 14 of file schedule.cxx.
References CTF::TensorOperation::dependency_left, ctf.core::it, CTF::Schedule::ready_tasks, and CTF::TensorOperation::successors.
Referenced by CTF::Schedule::execute(), and CTF::Schedule::partition_and_execute().
|
inline |
Definition at line 119 of file schedule.h.
|
inline |
Testing functionality
Definition at line 181 of file schedule.h.
|
inline |
Constructor, create the tensor operation lhs op= rhs.
Definition at line 39 of file schedule.h.
|
inlinevirtual |
Definition at line 25 of file schedule.h.
|
protected |
Definition at line 100 of file schedule.h.
double CTF::ScheduleTimer::comm_down_time |
Definition at line 112 of file schedule.h.
Referenced by CTF::ScheduleTimer::operator+=(), and CTF::Schedule::partition_and_execute().
double CTF::ScheduleTimer::comm_up_time |
Definition at line 116 of file schedule.h.
Referenced by CTF::ScheduleTimer::operator+=(), and CTF::Schedule::partition_and_execute().
int CTF::TensorOperation::dependency_count |
Schedule Recording Variables
Definition at line 78 of file schedule.h.
Referenced by CTF::Schedule::add_operation_typed().
int CTF::TensorOperation::dependency_left |
Schedule Execution Variables
Definition at line 86 of file schedule.h.
Referenced by CTF::Schedule::schedule_op_successors().
double CTF::ScheduleTimer::exec_time |
Definition at line 113 of file schedule.h.
Referenced by CTF::ScheduleTimer::operator+=(), and CTF::Schedule::partition_and_execute().
ScheduleBase * CTF::global_schedule |
Definition at line 8 of file schedule.cxx.
Referenced by CTF::Idx_Tensor::operator*=(), CTF::Idx_Tensor::operator+=(), CTF::Idx_Tensor::operator-=(), and CTF::Idx_Tensor::operator=().
double CTF::ScheduleTimer::imbalance_acuum_time |
Definition at line 115 of file schedule.h.
Referenced by CTF::Schedule::execute(), CTF::ScheduleTimer::operator+=(), and CTF::Schedule::partition_and_execute().
double CTF::ScheduleTimer::imbalance_wall_time |
Definition at line 114 of file schedule.h.
Referenced by CTF::Schedule::execute(), CTF::ScheduleTimer::operator+=(), and CTF::Schedule::partition_and_execute().
|
protected |
Definition at line 223 of file schedule.h.
Referenced by CTF::Schedule::add_operation_typed().
|
protected |
Definition at line 97 of file schedule.h.
|
protected |
Definition at line 96 of file schedule.h.
|
protected |
Testing variables
Definition at line 234 of file schedule.h.
Referenced by CTF::Schedule::partition_and_execute().
std::vector<TensorOperation* > CTF::TensorOperation::reads |
Definition at line 81 of file schedule.h.
Referenced by CTF::Schedule::add_operation_typed().
|
protected |
Schedule Execution Variables
Definition at line 229 of file schedule.h.
Referenced by CTF::Schedule::execute(), CTF::Schedule::partition_and_execute(), and CTF::Schedule::schedule_op_successors().
|
protected |
Definition at line 98 of file schedule.h.
|
protected |
Internal scheduling operation overview: DAG Structure: Each task maintains: dependency_count: the number of dependencies that the task has dependency_left: the number of dependencies left before this task can execute successors: a vector of tasks which has this as a dependency On completing a task, it decrements the dependency_left of all successors. Once the count reaches zero, the task is added to the ready queue and can be scheduled for execution. To allow one schedule to be executed many times, dependency_count is only modified by recording tasks, and is copied to dependency_left when the schedule starts executing.
DAG Construction: A map from tensors pointers to operations is maintained, which contains the latest operation that writes to a tensor. When a new operation is added, it checks this map for all dependencies. If a dependency has no entry yet, then it is considered satisfied. Otherwise, it depends on the current entry - and the latest write operation adds this task as a successor. Then, the latest_write for this operation is updated. Schedule Recording Variables
Definition at line 217 of file schedule.h.
Referenced by CTF::Schedule::add_operation_typed(), and CTF::Schedule::execute().
|
protected |
Definition at line 220 of file schedule.h.
Referenced by CTF::Schedule::add_operation_typed(), and CTF::Schedule::execute().
std::vector<TensorOperation* > CTF::TensorOperation::successors |
Definition at line 80 of file schedule.h.
Referenced by CTF::Schedule::add_operation_typed(), and CTF::Schedule::schedule_op_successors().
double CTF::ScheduleTimer::total_time |
Definition at line 117 of file schedule.h.
Referenced by CTF::ScheduleTimer::operator+=(), and CTF::Schedule::partition_and_execute().
|
protected |
Definition at line 186 of file schedule.h.
Referenced by CTF::Schedule::execute(), and CTF::Schedule::partition_and_execute().