SST 12.1.0
Structural Simulation Toolkit
sstpart.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_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
21namespace SST {
22
23class ConfigGraph;
24class PartitionGraph;
25
26namespace Partition {
27
28/**
29 * Base class for Partitioning graphs
30 */
32{
33
34public:
35 SST_ELI_DECLARE_BASE(SSTPartitioner)
36 SST_ELI_DECLARE_DEFAULT_INFO_EXTERN()
37 SST_ELI_DECLARE_CTOR_EXTERN(RankInfo,RankInfo,int)
38
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* UNUSED(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* UNUSED(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
75#endif
76
77#endif // SST_CORE_SSTPART_H
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:390
Definition: configGraph.h:619
Base class for Partitioning graphs.
Definition: sstpart.h:32
virtual void performPartition(PartitionGraph *UNUSED(graph))
Function to be overridden by subclasses.
Definition: sstpart.h:49
virtual void performPartition(ConfigGraph *UNUSED(graph))
Function to be overridden by subclasses.
Definition: sstpart.h:60
Definition: rankInfo.h:22