Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSSP adaptive #351

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lonestar/analytics/cpu/sssp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ install(TARGETS sssp-cpu DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT apps EX

add_test_scale(small1 sssp-cpu "${BASEINPUT}/reference/structured/rome99.gr" -delta 8)
add_test_scale(small2 sssp-cpu "${BASEINPUT}/scalefree/rmat10.gr" -delta 8)
add_test_scale(adaptive sssp-cpu "${BASEINPUT}/scalefree/rmat10.gr" -delta 1 -algo=deltaStepAdaptive)
21 changes: 15 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,11 @@ int main(int argc, char** argv) {
topoTileAlgo(graph, source);
break;

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

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