SST/macro
node_allocator.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_BACKENDS_NATIVE_LAUNCH_ALLOCATIONSTRATEGY_H_INCLUDED
13 #define SSTMAC_BACKENDS_NATIVE_LAUNCH_ALLOCATIONSTRATEGY_H_INCLUDED
14 
15 #include <sstmac/common/rng.h>
21 
23 #include <sprockit/debug.h>
25 #include <sprockit/unordered.h>
26 
27 DeclareDebugSlot(allocation);
28 
29 namespace sstmac {
30 namespace sw {
31 
32 /**
33  * Strategy type for assigning processes to nodes in a parallel run.
34  *
35  */
37 {
38  public:
39  void
40  set_topology(hw::topology* top) {
41  topology_ = top;
42  }
43 
44  virtual void
45  init_factory_params(sprockit::sim_parameters *params);
46 
47  virtual std::string
48  to_string() const {
49  return "allocation strategy";
50  }
51 
52  virtual
53  ~node_allocator() throw ();
54 
55  /** Get nodes.
56  @param nnode number of nodes requested
57  @param available the set of nodes that can be given
58  @param allocation returns the nodes that have been allocated
59  @return Whether the allocation succeeded based on available nodes
60  */
61  virtual void
62  allocate(int nnode,
63  const ordered_node_set& available,
64  ordered_node_set& allocation) const = 0;
65 
66  protected:
68  rt_(rt), topology_(0) {}
69 
70  protected:
71  hw::topology* topology_;
73 
74 };
75 
76 
78 
79 }
80 } // end of namespace sstmac
81 
82 #endif
83 
std::set< node_id > ordered_node_set
Definition: node_set.h:10
Strategy type for assigning processes to nodes in a parallel run.
void set_topology(hw::topology *top)
virtual void allocate(int nnode, const ordered_node_set &available, ordered_node_set &allocation) const =0
Get nodes.
node_allocator(parallel_runtime *rt)
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
parallel_runtime * rt_
DeclareFactory(blas_kernel)
virtual void init_factory_params(sprockit::sim_parameters *params)
DeclareDebugSlot(allocation)
virtual std::string to_string() const