SST/macro
hostname_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_BACKENDS_NATIVE_LAUNCH_hostname_allocation_H_INCLUDED
13 #define SSTMAC_BACKENDS_NATIVE_LAUNCH_hostname_allocation_H_INCLUDED
14 
17 
19 
20 namespace sstmac {
21 
22 namespace sw {
24 {
25 
26  public:
28  node_allocator(rt){}
29 
30  virtual void
31  init_factory_params(sprockit::sim_parameters* params);
32 
33  /**
34  * This function reads in a map file for mapping host names to network coordinates.
35  * @param here the function making the call, used for more informative exceptions
36  * @param mapfile name of the map file
37  * @param hostmap map in which host mappings are placed
38  */
39  static void
41  const char* here,
42  const std::string &mapfile,
43  std::map<std::string,std::vector<int> >& hostmap);
44 
45  virtual void
46  allocate(int nnode_requested,
47  const ordered_node_set& available,
48  ordered_node_set &allocation) const;
49 
50  virtual
51  ~hostname_allocation() throw () {
52  }
53 
54  typedef spkt_unordered_map<std::string, node_id> nodemap_t;
55  static nodemap_t hostnamemap_;
56 
57  static std::map<long, std::string> nodenum_to_host_map_;
58 
59  protected:
60  std::string mapfile_;
61 
62 };
63 
64 }
65 }
66 
67 #endif /* hostname_allocation_H_ */
68 
std::set< node_id > ordered_node_set
Definition: node_set.h:10
static std::map< long, std::string > nodenum_to_host_map_
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...
hostname_allocation(parallel_runtime *rt)
static void read_map_file(parallel_runtime *rt, const char *here, const std::string &mapfile, std::map< std::string, std::vector< int > > &hostmap)
This function reads in a map file for mapping host names to network coordinates.
virtual void init_factory_params(sprockit::sim_parameters *params)
virtual void allocate(int nnode_requested, const ordered_node_set &available, ordered_node_set &allocation) const
Get nodes.
spkt_unordered_map< std::string, node_id > nodemap_t