Skip to content
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
4 changes: 2 additions & 2 deletions src/ucs/datastruct/static_bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ BEGIN_C_DECLS
#define _UCS_STATIC_BITMAP_UNARY_OP(_bitmap, _op_name, _uid) \
({ \
ucs_typeof(_bitmap) _b_##_uid = (_bitmap); \
ucs_typeof(_bitmap) _r_##_uid; \
ucs_typeof(_bitmap) _r_##_uid = {0}; \
\
ucs_bitmap_bits_##_op_name(UCS_STATIC_BITMAP_BITS_ARGS(&_r_##_uid), \
UCS_STATIC_BITMAP_BITS_CARGS(&_b_##_uid)); \
Expand All @@ -255,7 +255,7 @@ BEGIN_C_DECLS
({ \
ucs_typeof(_bitmap1) _b1_##_uid = (_bitmap1); \
ucs_typeof(_bitmap2) _b2_##_uid = (_bitmap2); \
ucs_typeof(_bitmap1) _r_##_uid; \
ucs_typeof(_bitmap1) _r_##_uid = {0}; \
\
ucs_bitmap_bits_binary_op(UCS_STATIC_BITMAP_BITS_ARGS(&_r_##_uid), \
UCS_STATIC_BITMAP_BITS_CARGS(&_b1_##_uid), \
Expand Down
11 changes: 10 additions & 1 deletion test/apps/iodemo/io_demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <csignal>
#include <cerrno>
#include <vector>
#include <random>
#include <map>
#include <queue>
#include <algorithm>
Expand Down Expand Up @@ -2998,9 +2999,17 @@ static int do_client(options_t& test_opts)
IoDemoRandom::srand(test_opts.random_seed);
LOG << "random seed: " << test_opts.random_seed;

// randomize servers to optimize startup
// randomize servers to optimize startup (handle C++17+)
#if __cplusplus >= 201703L
// std::shuffle replaces std::random_shuffle in C++17
std::random_device rd;
std::mt19937 rng(rd());
std::shuffle(test_opts.servers.begin(), test_opts.servers.end(), rng);
#else
// For older C++ standards, keep std::random_shuffle
std::random_shuffle(test_opts.servers.begin(), test_opts.servers.end(),
IoDemoRandom::urand<size_t>);
#endif

UcxLog vlog(LOG_PREFIX, test_opts.verbose);
vlog << "List of servers:";
Expand Down
Loading