#include <iostream>
#include <string>
using GNode = Graph::GraphNode;
using UpdateRequest = std::pair<unsigned, GNode>;
static const unsigned int DIST_INFINITY =
constexpr unsigned int stepShift = 14;
int main(int argc, char** argv) {
if (argc != 3) {
std::cout << "Usage: " << argv[0]
<< " filename <dchunk16|obim|ParaMeter|det>\n";
return 1;
} else {
std::cout << "Note: This is just a very simple example and provides no "
"useful information for performance\n";
}
Graph graph;
argv[1]);
[&graph](GNode N) {
graph.getData(N) = DIST_INFINITY;
}
);
auto SSSP = [&](GNode active_node, auto& ctx) {
auto srcData = graph.getData(active_node);
for (auto ii : graph.edges(active_node)) {
auto dst = graph.getEdgeDst(ii);
auto weight = graph.getEdgeData(ii);
auto& dstData = graph.getData(dst);
if (dstData > weight + srcData) {
dstData = weight + srcData;
ctx.push(dst);
}
}
};
auto reqIndexer = [&](const GNode& N) {
};
using namespace galois::worklists;
std::string schedule = argv[2];
graph.getData(*graph.begin()) = 0;
if ("dchunk16" == schedule) {
{*graph.begin()}),
SSSP
,
galois::wl<PSchunk>()
,
} else if ("obim" == schedule) {
{*graph.begin()}),
SSSP
,
galois::wl<OBIM>(reqIndexer)
,
}
else if ("ParaMeter" == schedule) {
{*graph.begin()}),
SSSP
,
,
} else if ("det") {
{*graph.begin()}),
SSSP
,
,
} else {
std::cerr << "Unknown schedule " << schedule << std::endl;
return 1;
}
T.stop();
return 0;
}