SST  9.0.0
StructuralSimulationToolkit
linpart.h
1 // Copyright 2009-2019 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-2019, 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_IMPL_PARTITONERS_LINPART_H
14 #define SST_CORE_IMPL_PARTITONERS_LINPART_H
15 
16 #include <sst/core/sstpart.h>
17 #include <sst/core/eli/elementinfo.h>
18 
19 namespace SST {
20 
21 class Output;
22 
23 namespace IMPL {
24 namespace Partition {
25 
26 /**
27 Performs a linear partition scheme of an SST simulation configuration. In this
28 scheme a list of components (supplied as a graph) are grouped by slicing the list
29 into approximately equal parts. A "part" is generated for each MPI rank performing
30 the simulation. This means Components with sequential ids will be placed close together.
31 In general this scheme provides a very effective partition for most parallel
32 simulations which generate man similar components of interest close together in the input
33 Python configuration. It is also very fast to compute a linear partition scheme. For
34 more aggressive partition schemes users should try either a simple or Zoltan-based
35 partitioner.
36 */
38 
39 public:
40  SST_ELI_REGISTER_PARTITIONER(
42  "sst",
43  "linear",
44  SST_ELI_ELEMENT_VERSION(1,0,0),
45  "Partitions components by dividing Component ID space into roughly equal portions. Components with sequential IDs will be placed close together.")
46 
47 protected:
48  /** Number of ranks in the simulation */
49  RankInfo rankcount;
50  /** Output object to print partitioning information */
52 
53 public:
54  /**
55  Creates a new linear partition scheme.
56  \param mpiRankCount Number of MPI ranks in the simulation
57  \param verbosity The level of information to output
58  */
59  SSTLinearPartition(RankInfo rankCount, RankInfo my_rank, int verbosity);
60 
61  /**
62  Performs a partition of an SST simulation configuration
63  \param graph The simulation configuration to partition
64  */
65  void performPartition(PartitionGraph* graph) override;
66 
67  void performPartition(ConfigGraph* graph) override {
69  }
70 
71  bool requiresConfigGraph() override { return false; }
72  bool spawnOnAllRanks() override { return false; }
73 
74 };
75 
76 }
77 }
78 }
79 
80 #endif
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:54
Performs a linear partition scheme of an SST simulation configuration.
Definition: linpart.h:37
SST_ELI_REGISTER_PARTITIONER(SSTLinearPartition,"sst","linear", SST_ELI_ELEMENT_VERSION(1, 0, 0),"Partitions components by dividing Component ID space into roughly equal portions. Components with sequential IDs will be placed close together.") protected Output * partOutput
Number of ranks in the simulation.
Definition: linpart.h:40
Definition: configGraph.h:494
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:298
virtual void performPartition(PartitionGraph *UNUSED(graph))
Function to be overridden by subclasses.
Definition: sstpart.h:50
void performPartition(PartitionGraph *graph) override
Performs a partition of an SST simulation configuration.
Definition: linpart.cc:28
Definition: rankInfo.h:21
Base class for Partitioning graphs.
Definition: sstpart.h:32