00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 #ifndef SST_CORE_PART_BASE
00014 #define SST_CORE_PART_BASE
00015 
00016 #include <sst/core/configGraph.h>
00017 
00018 #include <map>
00019 
00020 namespace SST {
00021 namespace Partition {
00022 
00023 
00024 
00025 
00026 class SSTPartitioner
00027 {
00028 
00029 public:
00030 
00031     typedef SSTPartitioner* (*partitionerAlloc)(int total_ranks, int my_rank, int verbosity);
00032 private:
00033     static std::map<std::string, SSTPartitioner::partitionerAlloc>& partitioner_allocs();
00034     static std::map<std::string, std::string>& partitioner_descriptions();
00035     
00036 public:
00037 
00038     SSTPartitioner();
00039     virtual ~SSTPartitioner() {};
00040     
00041     static bool addPartitioner(const std::string name, const SSTPartitioner::partitionerAlloc alloc, const std::string description);
00042     static SSTPartitioner* getPartitioner(std::string name, int total_ranks, int my_rank, int verbosity);
00043 
00044     static const std::map<std::string, std::string>& getDescriptionMap() { return partitioner_descriptions(); }
00045 
00046     
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054     virtual void performPartition(PartitionGraph* graph) {}
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065     virtual void performPartition(ConfigGraph* graph) {}
00066     
00067     virtual bool requiresConfigGraph() { return false; }
00068     
00069     virtual bool spawnOnAllRanks() { return false; }
00070     
00071 
00072 
00073 };
00074 
00075 }
00076 }
00077 
00078 #endif