SST/macro
cart_allocation.h
Go to the documentation of this file.
1 /*
2  * This file is part of SST/macroscale:
3  * The macroscale architecture simulator from the SST suite.
4  * Copyright (c) 2009 Sandia Corporation.
5  * This software is distributed under the BSD License.
6  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7  * the U.S. Government retains certain rights in this software.
8  * For more information, see the LICENSE file in the top
9  * SST/macroscale directory.
10  */
11 
12 #ifndef SSTMAC_SOFTWARE_SERVICES_LAUNCH_ALLOCATION_CARTALLOCATION_H_INCLUDED
13 #define SSTMAC_SOFTWARE_SERVICES_LAUNCH_ALLOCATION_CARTALLOCATION_H_INCLUDED
14 
15 #include <vector>
18 
19 namespace sstmac {
20 namespace sw {
21 
23  public node_allocator
24 {
25 
26  public:
28  node_allocator(rt){}
29 
30  void
31  init_factory_params(sprockit::sim_parameters* params);
32 
33  virtual
34  ~cart_allocation() throw () {}
35 
36  /**
37  * @brief allocate
38  * @param nnode
39  * @param available
40  * @param allocation
41  * @return Whether the allocation succeeded based on the available nodes
42  */
43  void
44  allocate(int nnode,
45  const ordered_node_set& available,
46  ordered_node_set& allocation) const;
47 
48  private:
49  /**
50  * @brief insert
51  * @param coords The cartesian coordinates defining the node
52  * @param available The set of available nodes
53  * @param allocation The set of nodes storing the current allocation
54  * @return Whether the insertion succeeded based on the available nodes
55  */
56  void
57  insert(
59  const std::vector<int>& coords,
60  const ordered_node_set& available,
61  ordered_node_set& allocation) const;
62 
63  /**
64  * @brief allocate_dim Recursive method for looping dimensions in the block
65  * and adding them to the allocation
66  * @param dim
67  * @param vec
68  * @param available
69  * @param allocation
70  * @return Whether the allocation succeeded based on the available nodes
71  */
72  void
75  int dim,
76  std::vector<int>& vec,
77  const ordered_node_set& available,
78  ordered_node_set& allocation) const;
79 
80  std::vector<int> sizes_;
81  std::vector<int> offsets_;
82 
84 
85 };
86 
87 }
88 }
89 
90 #endif
91 
std::vector< int > sizes_
std::set< node_id > ordered_node_set
Definition: node_set.h:10
void insert(hw::structured_topology *regtop, const std::vector< int > &coords, const ordered_node_set &available, ordered_node_set &allocation) const
insert
cart_allocation(parallel_runtime *rt)
void allocate_dim(hw::structured_topology *regtop, int dim, std::vector< int > &vec, const ordered_node_set &available, ordered_node_set &allocation) const
allocate_dim Recursive method for looping dimensions in the block and adding them to the allocation ...
Strategy type for assigning processes to nodes in a parallel run.
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
std::vector< int > offsets_
Encapsulates a topology like torus, fat tree, butterfly which has a regular, well-defined structure...
void init_factory_params(sprockit::sim_parameters *params)
void allocate(int nnode, const ordered_node_set &available, ordered_node_set &allocation) const
allocate