SST  7.0.0
StructuralSimulationToolkit
zoltpart.h
1 // Copyright 2009-2017 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-2017, 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_ZOLT
14 #define SST_CORE_PART_ZOLT
15 
16 
17 #ifdef HAVE_ZOLTAN
18 
19 #include <sst/core/part/sstpart.h>
20 #include <sst/core/output.h>
21 #include <sst/core/elementinfo.h>
22 
23 // SST and ZOLTANŐs configurations are conflicting on the SST_CONFIG_HAVE_MPI definition.
24 // So temporarily shut down SSTŐs SST_CONFIG_HAVE_MPI, then allow ZOLTANŐs SST_CONFIG_HAVE_MPI to
25 //be defined, then reset SSTŐs SST_CONFIG_HAVE_MPI.
26 #ifdef SST_CONFIG_HAVE_MPI
27 #undef SST_CONFIG_HAVE_MPI
28 #include <zoltan.h>
29 #include <mpi.h>
30 #define SST_CONFIG_HAVE_MPI
31 #endif
32 
33 using namespace SST;
34 using namespace SST::Partition;
35 
36 namespace SST {
37 namespace Partition {
38 
39 /**
40  \class SSTZoltanPartition creates a partitioner interface to the
41  Zoltan partioner library developed by Sandia National Labs. This is
42  an option to partition simulations if the user has configured SST
43  to find and compile with the Zoltan external dependency.
44 */
45 class SSTZoltanPartition : public SST::Partition::SSTPartitioner {
46 
47 protected:
48  void initZoltan();
49  RankInfo rankcount;
50  struct Zoltan_Struct * zolt_config;
51  RankInfo rank;
52 
53 public:
54  /**
55  Create a Zoltan-based partition scheme
56  \param verbosity Verbosity level with which messages and information are generated
57  */
58  SSTZoltanPartition(RankInfo world_size, RankInfo my_rank, int verbosity);
59  ~SSTZoltanPartition();
60 
61  /**
62  Performs a partition of an SST partition graph. Components in the graph
63  have their setRank() attribute set based on the partition scheme computed
64  by Zoltan.
65  \param graph An SST partition graph
66  */
67  void performPartition(PartitionGraph* graph) override;
68 
69  bool requiresConfigGraph() override { return false; }
70 
71  bool spawnOnAllRanks() override { return true; }
72 
73  SST_ELI_REGISTER_PARTITIONER(SSTZoltanPartition,"sst","zoltan","zoltan parallel partitioner")
74 
75  SST_ELI_DOCUMENT_VERSION(1,0,0)
76 };
77 
78 }
79 }
80 
81 #endif // End of HAVE_ZOLTAN
82 
83 #endif
Definition: configGraph.h:530
Definition: element.h:31
Definition: action.cc:17
Definition: rankInfo.h:21
Base class for Partitioning graphs.
Definition: sstpart.h:31