|
| 1 | +#define GLOBAL_VALUE_DEFINE |
| 2 | + |
| 3 | +#include "include/common.hh" |
| 4 | +#include "include/result.hh" |
| 5 | +#include "include/transaction.hh" |
| 6 | +#include "include/util.hh" |
| 7 | + |
| 8 | +#include "../../include/cpu.hh" |
| 9 | +#include "../../include/debug.hh" |
| 10 | +#include "../../include/masstree_wrapper.hh" |
| 11 | +#include "../../include/result.hh" |
| 12 | +#include "../../include/tsc.hh" |
| 13 | +#include "../../include/util.hh" |
| 14 | +#include "../../include/ycsb.hh" |
| 15 | + |
| 16 | +#include "../../common/runner.hh" |
| 17 | + |
| 18 | +int main(int argc, char* argv[]) try { |
| 19 | + gflags::SetUsageMessage("YCSB SS2PL benchmark."); |
| 20 | + gflags::ParseCommandLineFlags(&argc, &argv, true); |
| 21 | + chkArg(); |
| 22 | + YcsbWorkload::displayWorkloadParameter(); |
| 23 | + YcsbWorkload::makeDB<Tuple, void>(nullptr); |
| 24 | + |
| 25 | + initResult(TotalThreadNum); |
| 26 | + |
| 27 | + ccbench::run<TxExecutor, TransactionStatus, YcsbWorkload>( |
| 28 | + TotalThreadNum, ccbench::RunnerOptions{}, |
| 29 | + [](std::size_t thid, const bool& quit, Backoff& /*unused*/) { |
| 30 | + return TxExecutor(thid, &CCBenchResults[thid], quit); |
| 31 | + }, |
| 32 | + [](TxExecutor& /*trans*/, std::size_t thid) { |
| 33 | +#ifdef Linux |
| 34 | + setThreadAffinity(thid); |
| 35 | +#endif |
| 36 | +#if MASSTREE_USE |
| 37 | + MasstreeWrapper<Tuple>::thread_init(static_cast<int>(thid)); |
| 38 | +#endif |
| 39 | + }); |
| 40 | + |
| 41 | + return 0; |
| 42 | +} catch (const std::bad_alloc&) { ERR; } |
0 commit comments