Galois
|
Policies that use a custom assignment of masters (from the user). More...
#include <BasePolicies.h>
Public Member Functions | |
CustomMasterAssignment (uint32_t hostID, uint32_t numHosts, uint64_t numNodes, uint64_t numEdges) | |
Calls parent constructor to initialize common data. More... | |
uint32_t | retrieveMaster (uint32_t gid) const |
Retrieves a saved master mapping: does not fail if a GID mapping is not found but instead returns -1 if in stage 1, else fails. More... | |
void | saveGID2HostInfo (std::unordered_map< uint64_t, uint32_t > &gid2offsets, std::vector< uint32_t > &localNodeToMaster, uint64_t nodeOffset) |
Given gid to master mapping info, save it into a local map. More... | |
bool | masterAssignPhase () const |
Returns true as policies that inherit from this should define master assignment function. More... | |
void | enterStage2 () |
Shifts master assignment phase to stage 2. More... | |
template<typename EdgeTy > | |
uint32_t | getMaster (uint32_t, galois::graphs::BufferedGraph< EdgeTy > &, const std::vector< uint32_t > &, std::unordered_map< uint64_t, uint32_t > &, const std::vector< uint64_t > &, std::vector< galois::CopyableAtomic< uint64_t >> &, const std::vector< uint64_t > &, std::vector< galois::CopyableAtomic< uint64_t >> &) |
CuSP's "getMaster" function. More... | |
bool | addMasterMapping (uint32_t gid, uint32_t mappedMaster) |
Add a new master mapping to the local map: needs to be in stage 1. More... | |
Public Member Functions inherited from galois::graphs::PartitioningScaffold | |
PartitioningScaffold (uint32_t hostID, uint32_t numHosts, uint64_t numNodes, uint64_t numEdges) | |
Constructor for Scaffold. More... | |
void | saveGIDToHost (std::vector< std::pair< uint64_t, uint64_t >> &gid2host) |
Save a provided map from host to nodes a host has read into this object. More... | |
Protected Member Functions | |
unsigned | getHostReader (uint64_t gid) const |
Return the reader of a particular node. More... | |
Protected Attributes | |
char | _status |
Specifies what phase of master assignment partitioner is on. More... | |
std::vector< uint32_t > | _localNodeToMaster |
Metadata for determining where a node's master is. More... | |
std::unordered_map< uint64_t, uint32_t > | _gid2masters |
Map GID to its master. More... | |
uint64_t | _nodeOffset |
This host's node offset (each host reads a distinct contiguous portion of graph. More... | |
Protected Attributes inherited from galois::graphs::PartitioningScaffold | |
uint32_t | _hostID |
host ID of owner of this object More... | |
uint32_t | _numHosts |
total number of hosts More... | |
uint64_t | _numNodes |
number of nodes in graph More... | |
uint64_t | _numEdges |
number of edges in graph More... | |
std::vector< std::pair < uint64_t, uint64_t > > | _gid2host |
maps from host id to nodes that host as read from disk More... | |
Policies that use a custom assignment of masters (from the user).
Needs to go through a master assignment phase, which adds overhead to partitioning, but may get better quality partitions.
|
inline |
Calls parent constructor to initialize common data.
|
inline |
Add a new master mapping to the local map: needs to be in stage 1.
gid | GID to map; should not be a GID read by this host (won't cause problems, but would just be a waste of compute resouces) |
mappedMaster | master to map a GID to |
|
inline |
Shifts master assignment phase to stage 2.
|
inlineprotected |
Return the reader of a particular node.
gid | GID of node to get reader of |
|
inline |
CuSP's "getMaster" function.
This function should be defined by user in child class to assign a node to a host.
|
inline |
Returns true as policies that inherit from this should define master assignment function.
|
inline |
Retrieves a saved master mapping: does not fail if a GID mapping is not found but instead returns -1 if in stage 1, else fails.
gid | GID to get master of |
|
inline |
Given gid to master mapping info, save it into a local map.
gid2offsets | Map a GID to an offset into a vector containing master mapping information |
localNodeToMaster | Vector that represents the master mapping of local nodes |
nodeOffset | First GID of nodes read by this host |
|
protected |
Map GID to its master.
|
protected |
Metadata for determining where a node's master is.
|
protected |
This host's node offset (each host reads a distinct contiguous portion of graph.
|
protected |
Specifies what phase of master assignment partitioner is on.