SST  12.0.0
StructuralSimulationToolkit
simplepart.h
1 // Copyright 2009-2022 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2022, NTESS
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 
12 #ifndef SST_CORE_IMPL_PARTITONERS_SIMPLEPART_H
13 #define SST_CORE_IMPL_PARTITONERS_SIMPLEPART_H
14 
15 #include "sst/core/configGraph.h"
16 #include "sst/core/eli/elementinfo.h"
17 #include "sst/core/sst_types.h"
18 #include "sst/core/sstpart.h"
19 
20 #include <map>
21 
22 namespace SST {
23 namespace IMPL {
24 namespace Partition {
25 
27 {
28 
29 public:
30  SST_ELI_REGISTER_PARTITIONER(
32  "sst",
33  "simple",
34  SST_ELI_ELEMENT_VERSION(1,0,0),
35  "Simple partitioning scheme which attempts to partition on high latency links "
36  "while balancing number of components per rank.")
37 
38 private:
39  RankInfo world_size;
40  uint32_t total_parts;
41 
42  RankInfo convertPartNum(uint32_t partNum)
43  {
44  return RankInfo(partNum / world_size.thread, partNum % world_size.thread);
45  }
46 
47  void simple_partition_step(
48  PartitionComponentMap_t& component_map, ComponentId_t* setA, const int lengthA, int rankA, ComponentId_t* setB,
49  const int lengthB, int rankB, std::map<ComponentId_t, std::map<ComponentId_t, SimTime_t>*> timeTable, int step);
50 
51 public:
52  SimplePartitioner(RankInfo total_ranks, RankInfo my_rank, int verbosity);
54  ~SimplePartitioner() {}
55 
56  void performPartition(PartitionGraph* graph) override;
57 
58  bool requiresConfigGraph() override { return false; }
59  bool spawnOnAllRanks() override { return false; }
60 };
61 
62 } // namespace Partition
63 } // namespace IMPL
64 } // namespace SST
65 #endif // SST_CORE_IMPL_PARTITONERS_SIMPLERPART_H
Definition: configGraph.h:616
Definition: simplepart.h:26
Definition: rankInfo.h:21
Base class for Partitioning graphs.
Definition: sstpart.h:31
void performPartition(PartitionGraph *graph) override
Function to be overridden by subclasses.
Definition: simplepart.cc:183