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