SST  7.2.0
StructuralSimulationToolkit
simplepart.h
1 // Copyright 2009-2017 Sandia Corporation. Under the terms
2 // of Contract DE-NA0003525 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2017, Sandia Corporation
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 #ifndef SST_CORE_PART_SIMPLEPART_H
12 #define SST_CORE_PART_SIMPLEPART_H
13 
14 #include <map>
15 #include <sst/core/sst_types.h>
16 #include <sst/core/part/sstpart.h>
17 #include <sst/core/elementinfo.h>
18 #include <sst/core/configGraph.h>
19 
20 namespace SST {
21 namespace Partition{
22 
24 
25 public:
26 
27  SST_ELI_REGISTER_PARTITIONER(
29  "sst",
30  "simple",
31  SST_ELI_ELEMENT_VERSION(1,0,0),
32  "Simple partitioning scheme which attempts to partition on high latency links while balancing number of components per rank.")
33 
34 private:
35  RankInfo world_size;
36  uint32_t total_parts;
37 
38  RankInfo convertPartNum(uint32_t partNum) {
39  return RankInfo(partNum / world_size.thread, partNum % world_size.thread);
40  }
41 
42  void simple_partition_step(PartitionComponentMap_t& component_map,
43  ComponentId_t* setA, const int lengthA, int rankA,
44  ComponentId_t* setB, const int lengthB, int rankB,
45  std::map<ComponentId_t, std::map<ComponentId_t, SimTime_t>*> timeTable,
46  int step);
47 public:
48 
49  SimplePartitioner(RankInfo total_ranks, RankInfo my_rank, int verbosity);
51  ~SimplePartitioner() {}
52 
53  void performPartition(PartitionGraph* graph) override;
54 
55  bool requiresConfigGraph() override { return false; }
56  bool spawnOnAllRanks() override { return false; }
57 
58 };
59 
60 } // namespace partition
61 } //namespace SST
62 #endif //SST_CORE_PART_SIMPLERPART_H
Definition: simplepart.h:23
Definition: configGraph.h:490
Definition: action.cc:17
Definition: rankInfo.h:21
Base class for Partitioning graphs.
Definition: sstpart.h:31