Skip to content

Commit

Permalink
Benchmarks: update mstress client to compile with modern C++ compiler…
Browse files Browse the repository at this point in the history
… and libraries.
  • Loading branch information
mikeov committed May 1, 2024
1 parent 77c1855 commit caa0b5b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion benchmarks/mstress/mstress_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
#include <queue>
#include <algorithm>

#if __cplusplus >= 201103L
#include <random>
#endif

using namespace std;

#include "libclient/KfsClient.h"
Expand Down Expand Up @@ -197,7 +201,13 @@ void unique_random(vector<size_t>& result, size_t range)
result[i] = i;
}

random_shuffle(result.begin(), result.end() ) ;
#if __cplusplus < 201103L
random_shuffle(result.begin(), result.end()) ;
#else
random_device theRandDev;
mt19937 theRandGen(theRandDev());
shuffle(result.begin(), result.end(), theRandGen);
#endif
}

void parse_options(int argc, char* argv[], Client* client)
Expand Down

0 comments on commit caa0b5b

Please sign in to comment.