SST  6.0.0
StructuralSimulationToolkit
sstpart.h
1 // Copyright 2009-2016 Sandia Corporation. Under the terms
2 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2016, Sandia Corporation
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/configGraph.h>
17 #include <sst/core/rankInfo.h>
18 
19 #include <map>
20 
21 namespace SST {
22 namespace Partition {
23 
24 /**
25  * Base class for Partitioning graphs
26  */
28 {
29 
30 public:
31 
32  typedef SSTPartitioner* (*partitionerAlloc)(RankInfo total_ranks, RankInfo my_rank, int verbosity);
33 private:
34  static std::map<std::string, SSTPartitioner::partitionerAlloc>& partitioner_allocs();
35  static std::map<std::string, std::string>& partitioner_descriptions();
36 
37 public:
38 
40  virtual ~SSTPartitioner() {};
41 
42  static bool addPartitioner(const std::string name, const SSTPartitioner::partitionerAlloc alloc, const std::string description);
43  static SSTPartitioner* getPartitioner(std::string name, RankInfo total_ranks, RankInfo my_rank, int verbosity);
44 
45  static const std::map<std::string, std::string>& getDescriptionMap() { return partitioner_descriptions(); }
46 
47 
48  /** Function to be overriden by subclasses
49  *
50  * Performs the partitioning of the Graph using the PartitionGraph object.
51  *
52  * Result of this function is that every ConfigComponent in
53  * graph has a Rank applied to it.
54  */
55  virtual void performPartition(PartitionGraph* graph) {}
56 
57  /** Function to be overriden by subclasses
58  *
59  * Performs the partitioning of the Graph using the ConfigGraph
60  * object. The consequence of using ConfigGraphs is that no-cut
61  * links are not supported.
62  *
63  * Result of this function is that every ConfigComponent in
64  * graph has a Rank applied to it.
65  */
66  virtual void performPartition(ConfigGraph* graph) {}
67 
68  virtual bool requiresConfigGraph() { return false; }
69 
70  virtual bool spawnOnAllRanks() { return false; }
71  // virtual bool supportsPartialPartitionInput() { return false; }
72 
73 
74 };
75 
76 }
77 }
78 
79 #endif
Definition: configGraph.h:397
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:202
Definition: action.cc:17
virtual void performPartition(PartitionGraph *graph)
Function to be overriden by subclasses.
Definition: sstpart.h:55
Definition: rankInfo.h:21
Base class for Partitioning graphs.
Definition: sstpart.h:27
virtual void performPartition(ConfigGraph *graph)
Function to be overriden by subclasses.
Definition: sstpart.h:66