SST  11.1.0
StructuralSimulationToolkit
sstpart.h
1 // Copyright 2009-2021 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-2021, 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_SSTPART_H
13 #define SST_CORE_SSTPART_H
14 
15 #include "sst/core/eli/elementinfo.h"
16 #include "sst/core/rankInfo.h"
17 #include "sst/core/warnmacros.h"
18 
19 #include <map>
20 
21 namespace SST {
22 
23 class ConfigGraph;
24 class PartitionGraph;
25 
26 namespace Partition {
27 
28 /**
29  * Base class for Partitioning graphs
30  */
31 class SSTPartitioner
32 {
33 
34 public:
35  SST_ELI_DECLARE_BASE(SSTPartitioner)
36  SST_ELI_DECLARE_DEFAULT_INFO_EXTERN()
37  SST_ELI_DECLARE_CTOR_EXTERN(RankInfo,RankInfo,int)
38 
39  SSTPartitioner() {}
40  virtual ~SSTPartitioner() {}
41 
42  /** Function to be overridden by subclasses
43  *
44  * Performs the partitioning of the Graph using the PartitionGraph object.
45  *
46  * Result of this function is that every ConfigComponent in
47  * graph has a Rank applied to it.
48  */
49  virtual void performPartition(PartitionGraph* graph);
50 
51  /** Function to be overridden by subclasses
52  *
53  * Performs the partitioning of the Graph using the ConfigGraph
54  * object. The consequence of using ConfigGraphs is that no-cut
55  * links are not supported.
56  *
57  * Result of this function is that every ConfigComponent in
58  * graph has a Rank applied to it.
59  */
60  virtual void performPartition(ConfigGraph* graph);
61 
62  virtual bool requiresConfigGraph() { return false; }
63 
64  virtual bool spawnOnAllRanks() { return false; }
65  // virtual bool supportsPartialPartitionInput() { return false; }
66 };
67 
68 } // namespace Partition
69 } // namespace SST
70 
71 #ifndef SST_ELI_REGISTER_PARTITIONER
72 #define SST_ELI_REGISTER_PARTITIONER(cls, lib, name, version, desc) \
73  SST_ELI_REGISTER_DERIVED(SST::Partition::SSTPartitioner,cls,lib,name,ELI_FORWARD_AS_ONE(version),desc)
74 #endif
75 
76 #endif // SST_CORE_SSTPART_H
virtual void performPartition(PartitionGraph *UNUSED(graph))
Function to be overridden by subclasses.
Definition: sstpart.h:49