Skip to content

Commit

Permalink
Add adaptive variant of SSSP.
Browse files Browse the repository at this point in the history
  • Loading branch information
insertinterestingnamehere committed Jul 27, 2020
1 parent 1de76b8 commit 0e03cd4
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lonestar/analytics/cpu/sssp/SSSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include "galois/Galois.h"
#include "galois/worklists/AdaptiveObim.h"
#include "galois/AtomicHelpers.h"
#include "galois/Reduction.h"
#include "galois/PriorityQueue.h"
Expand Down Expand Up @@ -59,6 +60,7 @@ enum Algo {
deltaTile = 0,
deltaStep,
deltaStepBarrier,
deltaStepAdaptive,
serDeltaTile,
serDelta,
dijkstraTile,
Expand All @@ -69,15 +71,17 @@ enum Algo {
};

const char* const ALGO_NAMES[] = {
"deltaTile", "deltaStep", "deltaStepBarrier", "serDeltaTile",
"serDelta", "dijkstraTile", "dijkstra", "topo",
"topoTile", "Auto"};
"deltaTile", "deltaStep", "deltaStepBarrier",
"deltaStepAdaptive", "serDeltaTile", "serDelta",
"dijkstraTile", "dijkstra", "topo",
"topoTile", "Auto"};

static cll::opt<Algo> algo(
"algo", cll::desc("Choose an algorithm (default value auto):"),
cll::values(clEnumVal(deltaTile, "deltaTile"),
clEnumVal(deltaStep, "deltaStep"),
clEnumVal(deltaStepBarrier, "deltaStepBarrier"),
clEnumVal(deltaStepAdaptive, "deltaStepAdaptive"),
clEnumVal(serDeltaTile, "serDeltaTile"),
clEnumVal(serDelta, "serDelta"),
clEnumVal(dijkstraTile, "dijkstraTile"),
Expand Down Expand Up @@ -111,9 +115,9 @@ using TileRangeFn = SSSP::TileRangeFn;
namespace gwl = galois::worklists;
using PSchunk = gwl::PerSocketChunkFIFO<CHUNK_SIZE>;
using OBIM = gwl::OrderedByIntegerMetric<UpdateRequestIndexer, PSchunk>;
using OBIM_Barrier =
gwl::OrderedByIntegerMetric<UpdateRequestIndexer,
PSchunk>::with_barrier<true>::type;
using OBIM_Adaptive =
gwl::AdaptiveOrderedByIntegerMetric<UpdateRequestIndexer, PSchunk>;
using OBIM_Barrier = OBIM::with_barrier<true>::type;

template <typename T, typename OBIMTy = OBIM, typename P, typename R>
void deltaStepAlgo(Graph& graph, GNode source, const P& pushWrap,
Expand Down Expand Up @@ -450,6 +454,10 @@ int main(int argc, char** argv) {
topoTileAlgo(graph, source);
break;

case deltaStepAdaptive:
deltaStepAlgo<UpdateRequest, OBIM_Adaptive>(graph, source, ReqPushWrap(),
OutEdgeRangeFn{graph});

case deltaStepBarrier:
deltaStepAlgo<UpdateRequest, OBIM_Barrier>(graph, source, ReqPushWrap(),
OutEdgeRangeFn{graph});
Expand Down

0 comments on commit 0e03cd4

Please sign in to comment.