|
|
long long | getN () const |
| | Get the number of primal variables in this node and its children.
|
|
long long | getMY () const |
| | Get the number of equality constraints in this node and its children.
|
|
long long | getMYL () const |
| | Get the number of linking equality constraints in this node and its children.
|
|
long long | getMZ () const |
| | Get the number of inequality constraints in this node and its children.
|
|
long long | getMZL () const |
| | Get the number of linking inequality constraints in this node and its children.
|
|
virtual std::unique_ptr< DistributedTree > | clone () const =0 |
| | Create a deep copy of this tree node.
|
| virtual void | computeGlobalSizes ()=0 |
| | Computes the total problem dimensions for the subtree rooted at this node.
|
| void | getGlobalSizes (long long &n, long long &my, long long &mz) const |
| | Get the total problem dimensions for the subtree rooted at this node.
|
| void | getGlobalSizes (long long &n, long long &my, long long &myl, long long &mz, long long &mzl) const |
| | Get the total problem dimensions including linking constraints for the subtree rooted at this node.
|
| void | assignProcesses (MPI_Comm comm=MPI_COMM_WORLD) |
| | Assigns MPI processes to the nodes of the tree.
|
|
virtual | ~DistributedTree ()=default |
| | Virtual destructor.
|
|
bool | distributedPreconditionerActive () const |
| | Check if a distributed preconditioner is active.
|
|
void | startMonitors () |
| | Start performance monitors for IPM iterations.
|
|
void | startNodeMonitors () |
| | Start performance monitors for this node.
|
|
void | stopMonitors () |
| | Stop performance monitors for IPM iterations.
|
|
void | stopNodeMonitors () |
| | Stop performance monitors for this node.
|
| void | getSyncInfo (int myRank, int &syncNeeded, int &sendOrRecv, int &toFromCPU) |
| | Get synchronization information for load balancing.
|
|
virtual std::unique_ptr< DistributedSymmetricMatrix > | createQ () const =0 |
| | Create the Hessian matrix (Q) for this node. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createc () const =0 |
| | Create the objective vector (c) for this node. Pure virtual.
|
|
virtual double | createobjconst () const =0 |
| | Create the objective constant for this node. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createxlow () const =0 |
| | Create the lower bound vector for primal variables (x). Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createixlow () const =0 |
| | Create the indicator vector for lower bounds on x. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createxupp () const =0 |
| | Create the upper bound vector for primal variables (x). Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createixupp () const =0 |
| | Create the indicator vector for upper bounds on x. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | create_variable_integrality_type () const =0 |
| | Create the vector indicating the integrality type of variables. Pure virtual.
|
|
virtual std::unique_ptr< DistributedMatrix > | createA () const =0 |
| | Create the equality constraint matrix (A) for this node. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createb () const =0 |
| | Create the right-hand side vector for equality constraints (b). Pure virtual.
|
|
virtual std::unique_ptr< DistributedMatrix > | createC () const =0 |
| | Create the inequality constraint matrix (C) for this node. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createclow () const =0 |
| | Create the lower bound vector for inequality constraints. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createiclow () const =0 |
| | Create the indicator vector for lower bounds on inequality constraints. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createcupp () const =0 |
| | Create the upper bound vector for inequality constraints. Pure virtual.
|
|
virtual std::unique_ptr< DistributedVector< double > > | createicupp () const =0 |
| | Create the indicator vector for upper bounds on inequality constraints. Pure virtual.
|
| template<typename T> |
| std::unique_ptr< DistributedVector< T > > | new_primal_vector (bool empty=false) const |
| | Create a new distributed vector for primal variables.
|
| template<typename T> |
| std::unique_ptr< DistributedVector< T > > | new_equalities_dual_vector (bool empty=false) const |
| | Create a new distributed vector for equality constraint duals.
|
| template<typename T> |
| std::unique_ptr< DistributedVector< T > > | new_inequalities_dual_vector (bool empty=false) const |
| | Create a new distributed vector for inequality constraint duals.
|
|
std::unique_ptr< DistributedVector< double > > | new_right_hand_side () const |
| | Create a new distributed vector for the right-hand side of the augmented system.
|
|
const DistributedTree * | getSubRoot () const |
| | Get the sub-root of this node for hierarchical structures.
|
|
const std::vector< std::unique_ptr< DistributedTree > > & | getChildren () const |
| | Get the children of this node.
|
|
unsigned int | nChildren () const |
| | Get the number of children of this node.
|
|
MPI_Comm | getCommWorkers () const |
| | Get the MPI communicator for the workers of this node.
|
|
virtual int | nx () const =0 |
| | Get the local number of primal variables. Pure virtual.
|
|
virtual int | my () const =0 |
| | Get the local number of equality constraints. Pure virtual.
|
|
virtual int | myl () const =0 |
| | Get the local number of linking equality constraints. Pure virtual.
|
|
virtual int | mzl () const =0 |
| | Get the local number of linking inequality constraints. Pure virtual.
|
|
virtual int | mz () const =0 |
| | Get the local number of inequality constraints. Pure virtual.
|
|
virtual int | id () const =0 |
| | Get the ID of this node. Pure virtual.
|
|
double | processLoad () const |
| | Get the processing load of this node and its subtree.
|
|
bool | isHierarchicalRoot () const |
| | Check if this node is a hierarchical root.
|
|
void | setHierarchicalInnerRoot () |
| | Set this node as a hierarchical inner root.
|
|
bool | isHierarchicalInnerRoot () const |
| | Check if this node is a hierarchical inner root.
|
|
void | setHierarchicalInnerLeaf () |
| | Set this node as a hierarchical inner leaf.
|
|
bool | isHierarchicalInnerLeaf () const |
| | Check if this node is a hierarchical inner leaf.
|
|
virtual std::unique_ptr< DistributedTree > | shaveDenseBorder (int nx_to_shave, int myl_to_shave, int mzl_to_shave, std::unique_ptr< DistributedTree > pointer_to_this)=0 |
| | Shave off a dense border from the problem structure. Pure virtual. Adds an additional top layer.
|
|
virtual std::pair< int, int > | splitTree (int n_layers, DistributedProblem *data)=0 |
| | Split the tree to introduce more layers for hierarchical parallelism. Pure virtual. Adds an additional layer below this one by adding sqrt(nChildren) children each with sqrt(nChildren) of our current children.
|
|
virtual std::unique_ptr< DistributedTree > | switchToHierarchicalTree (DistributedProblem *&data, std::unique_ptr< DistributedTree > pointer_to_this)=0 |
| | Switch to a hierarchical tree structure. Pure virtual.
|
|
void | printProcessTree () const |
| | Print the process tree to standard output.
|
|
bool | was_A0_moved_to_border () const |
| | Check if the A0 matrix was moved to the border.
|
|
|
MPI_Comm | commWrkrs {MPI_COMM_NULL} |
| | MPI communicator for the workers assigned to this subtree.
|
|
std::vector< int > | myProcs |
| | Ranks of processes assigned to this node.
|
|
std::vector< int > | myOldProcs |
| | Ranks of processes previously assigned to this node (used for load balancing).
|
|
MPI_Comm | commP2ZeroW {MPI_COMM_NULL} |
| | Communicator between preconditioner (rank P+1) and the root worker (rank 0).
|
|
long long | N {0} |
| | Total number of primal variables in the subtree rooted at this node.
|
|
long long | MY {0} |
| | Total number of equality constraints in the subtree rooted at this node.
|
|
long long | MZ {0} |
| | Total number of inequality constraints in the subtree rooted at this node.
|
|
long long | MYL {0} |
| | Total number of linking equality constraints in the subtree rooted at this node.
|
|
long long | MZL {0} |
| | Total number of linking inequality constraints in the subtree rooted at this node.
|
|
int | np {-1} |
| | Number of variables in the parent node.
|
|
double | IPMIterExecTIME {-1.0} |
| | Execution time for an IPM iteration, used for load balancing. Not used since loads of nodes and processes are currently not computed.
|
|
std::vector< std::unique_ptr< DistributedTree > > | children |
| | Children of this node in the tree.
|
|
std::unique_ptr< DistributedTree > | sub_root {} |
| | Sub-tree for hierarchical approach. Implies sub structure inside the current Bmat.
|
|
bool | is_hierarchical_root {false} |
| | Flag indicating if this is the root of a hierarchical problem structure.
|
|
bool | is_hierarchical_inner_root {false} |
| | Flag indicating if this is an inner root in a hierarchical structure.
|
|
bool | is_hierarchical_inner_leaf {false} |
| | Flag indicating if this is an inner leaf in a hierarchical structure.
|
|
bool | was_a0_moved_to_border {false} |
| | Flag indicating if the A0 matrix was moved to the border.
|
Represents the hierarchical structure of a distributed optimization problem.
This is an abstract base class that defines the tree structure of a stochastic or distributed optimization problem. Each node in the tree can represent a subproblem, a scenario, a stage, or a block. The tree structure is used to manage the distribution of data and computations across multiple processes in an MPI environment.
Derived classes are responsible for implementing the pure virtual functions to provide the actual problem data (matrices, vectors, etc.) for each node.