SST 15.0
Structural Simulation Toolkit
simplepart.h
1// Copyright 2009-2025 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-2025, 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 <cstdint>
21#include <map>
22
23namespace SST::IMPL::Partition {
24
25class SimplePartitioner : public SST::Partition::SSTPartitioner
26{
27
28public:
29 SST_ELI_REGISTER_PARTITIONER(
30 SimplePartitioner,
31 "sst",
32 "simple",
33 SST_ELI_ELEMENT_VERSION(1,0,0),
34 "Simple partitioning scheme which attempts to partition on high latency links "
35 "while balancing number of components per rank.")
36
37private:
38 RankInfo world_size;
39 uint32_t total_parts;
40
41 RankInfo convertPartNum(uint32_t partNum)
42 {
43 return RankInfo(partNum / world_size.thread, partNum % world_size.thread);
44 }
45
46 void simple_partition_step(PartitionComponentMap_t& component_map, ComponentId_t* setA, const int lengthA,
47 int rankA, ComponentId_t* setB, const int lengthB, int rankB,
48 std::map<ComponentId_t, std::map<ComponentId_t, SimTime_t>*> timeTable, int step);
49
50public:
51 SimplePartitioner(RankInfo total_ranks, RankInfo my_rank, int verbosity);
52 SimplePartitioner();
53 ~SimplePartitioner() {}
54
55 void performPartition(PartitionGraph* graph) override;
56
57 bool requiresConfigGraph() override { return false; }
58 bool spawnOnAllRanks() override { return false; }
59};
60
61} // namespace SST::IMPL::Partition
62
63#endif // SST_CORE_IMPL_PARTITONERS_SIMPLERPART_H
void performPartition(PartitionGraph *graph) override
Function to be overridden by subclasses.
Definition simplepart.cc:184
Definition configGraph.h:692
Base class for Partitioning graphs.
Definition sstpart.h:32
Definition rankInfo.h:24