Skip to content

Commit

Permalink
no-NOLINT for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Jan 16, 2025
1 parent 3f019d6 commit 278e5b1
Show file tree
Hide file tree
Showing 159 changed files with 1,134 additions and 1,134 deletions.
26 changes: 13 additions & 13 deletions bench/bcc_10/bcc_10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
/**
* general option.
*/
DEFINE_uint64(d, 1, "Duration of benchmark in seconds."); // NOLINT
DEFINE_bool(read_only, false, "whether it is read only mode."); // NOLINT
DEFINE_uint64(th, 112, "# worker threads."); // NOLINT
DEFINE_uint64(d, 1, "Duration of benchmark in seconds."); // LINT
DEFINE_bool(read_only, false, "whether it is read only mode."); // LINT
DEFINE_uint64(th, 112, "# worker threads."); // LINT

using namespace shirakami;

bool isReady(const std::vector<char>& readys) { // NOLINT
for (const char& b : readys) { // NOLINT
bool isReady(const std::vector<char>& readys) { // LINT
for (const char& b : readys) { // LINT
if (loadAcquire(b) == 0) return false;
}
return true;
Expand Down Expand Up @@ -87,17 +87,17 @@ void worker(const std::size_t thid, char& ready, const bool& start,
while (!loadAcquire(start)) _mm_pause();

while (likely(!loadAcquire(quit))) {
gen_tx_rw(opr_set, key_size, rec_size, tx_size, rratio, // NOLINT
gen_tx_rw(opr_set, key_size, rec_size, tx_size, rratio, // LINT
rnd, zipf);

if (FLAGS_read_only) {
if (tx_begin({token, // NOLINT
if (tx_begin({token, // LINT
transaction_options::transaction_type::READ_ONLY}) !=
Status::OK) {
LOG_FIRST_N(ERROR, 1);
}
} else {
if (tx_begin({token}) != Status::OK) { LOG_FIRST_N(ERROR, 1); } // NOLINT
if (tx_begin({token}) != Status::OK) { LOG_FIRST_N(ERROR, 1); } // LINT
}

// wait if read only tx
Expand All @@ -122,7 +122,7 @@ void worker(const std::size_t thid, char& ready, const bool& start,
}
}

auto rc{commit(token)}; // NOLINT
auto rc{commit(token)}; // LINT
if (rc == Status::OK) {
++ct_commit;
} else {
Expand All @@ -139,7 +139,7 @@ void invoke_leader() {
alignas(CACHE_LINE_SIZE) bool quit = false;
alignas(CACHE_LINE_SIZE) std::vector<simple_result> res(FLAGS_th);

std::vector<char> readys(FLAGS_th); // NOLINT
std::vector<char> readys(FLAGS_th); // LINT
std::vector<std::thread> thv;
for (std::size_t i = 0; i < FLAGS_th; ++i) {
thv.emplace_back(worker, i, std::ref(readys[i]), std::ref(start),
Expand Down Expand Up @@ -167,18 +167,18 @@ void init_google_logging() {
FLAGS_stderrthreshold = 0;
}

void init_gflags(int& argc, char* argv[]) { // NOLINT
void init_gflags(int& argc, char* argv[]) { // LINT
gflags::SetUsageMessage(
static_cast<const std::string&>("YCSB benchmark for shirakami"));
gflags::ParseCommandLineFlags(&argc, &argv, true);
}

int main(int argc, char* argv[]) try { // NOLINT
int main(int argc, char* argv[]) try { // LINT
init_google_logging();
init_gflags(argc, argv);
check_flags();

init(); // NOLINT
init(); // LINT
init_db();
if (FLAGS_read_only) {
usleep(PARAM_SNAPSHOT_EPOCH * epoch::get_global_epoch_time_us() * 2);
Expand Down
2 changes: 1 addition & 1 deletion bench/bcc_10/include/simple_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <cstdint>

class alignas(64) simple_result { // NOLINT
class alignas(64) simple_result { // LINT
public:
// getter
[[nodiscard]] std::uint64_t get_ct_commit() const { return ct_commit_; }
Expand Down
2 changes: 1 addition & 1 deletion bench/bcc_10/include/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @brief for tx workers.
* @details The thread id corresponds to the index position.
*/
inline shirakami::Storage st_{}; // NOLINT
inline shirakami::Storage st_{}; // LINT

/**
* global variable's getter
Expand Down
8 changes: 4 additions & 4 deletions bench/bcc_10/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ void brock_insert(Storage const st, size_t const start, size_t const end) {
_mm_pause(); // full session now.
}

auto rc{tx_begin({token})}; // NOLINT
if (rc != Status::OK) { LOG_FIRST_N(ERROR, 1) << log_location_prefix << rc; } // NOLINT
auto rc{tx_begin({token})}; // LINT
if (rc != Status::OK) { LOG_FIRST_N(ERROR, 1) << log_location_prefix << rc; } // LINT

std::size_t ctr{0};
for (uint64_t i = start; i <= end; ++i) {
rc = upsert(token, st, make_key(key_size, i),
std::string(val_size, '0'));
if (rc != Status::OK) { LOG_FIRST_N(ERROR, 1) << log_location_prefix << rc; }
++ctr;
if (ctr > 10) { // NOLINT
if (ctr > 10) { // LINT
rc = commit(token);
if (rc != Status::OK) { LOG_FIRST_N(ERROR, 1); }
ctr = 0;
Expand All @@ -66,7 +66,7 @@ void brock_insert(Storage const st, size_t const start, size_t const end) {
}

std::size_t comp_para_build_num(const std::size_t rec) {
if (rec <= 10000) return 1; // NOLINT
if (rec <= 10000) return 1; // LINT

return std::thread::hardware_concurrency();
}
Expand Down
4 changes: 2 additions & 2 deletions bench/bcc_10/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ using namespace shirakami;
void check_flags() {
std::cout << "general options" << std::endl;
if (FLAGS_d >= 1) {
printf("FLAGS_d :\t%zu\n", FLAGS_d); // NOLINT
printf("FLAGS_d :\t%zu\n", FLAGS_d); // LINT
} else {
LOG_FIRST_N(ERROR, 1) << log_location_prefix
<< "Duration of benchmark in seconds must be larger than 0.";
}
std::cout << "FLAGS_read_only\t" << FLAGS_read_only << std::endl;
std::cout << "FLAGS_th\t" << FLAGS_th << std::endl;
printf("Fin check_flags()\n"); // NOLINT
printf("Fin check_flags()\n"); // LINT
}

void output_result(std::vector<simple_result> const& res) {
Expand Down
16 changes: 8 additions & 8 deletions bench/bcc_11/bcc_11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
/**
* general option.
*/
DEFINE_uint64(d, 1, "Duration of benchmark in seconds."); // NOLINT
DEFINE_uint64(ops, 10, "write operation / tx."); // NOLINT
DEFINE_uint64(d, 1, "Duration of benchmark in seconds."); // LINT
DEFINE_uint64(ops, 10, "write operation / tx."); // LINT

using namespace shirakami;

Expand All @@ -68,12 +68,12 @@ void worker(std::atomic<bool>& quit) {
// loop exp
while (!quit.load(std::memory_order_acquire)) {
for (std::size_t i = 0; i < FLAGS_ops; ++i) {
std::string_view k{reinterpret_cast<char*>(&i), // NOLINT
sizeof(i)}; // NOLINT
std::string_view k{reinterpret_cast<char*>(&i), // LINT
sizeof(i)}; // LINT
auto rc = upsert(token, st, k, "v");
if (rc != Status::OK) { LOG(FATAL); }
}
auto rc{commit(token)}; // NOLINT
auto rc{commit(token)}; // LINT
if (rc != Status::OK) { LOG(FATAL); }
++ct_commit;
}
Expand Down Expand Up @@ -111,18 +111,18 @@ void init_google_logging() {
FLAGS_stderrthreshold = 0;
}

void init_gflags(int& argc, char* argv[]) { // NOLINT
void init_gflags(int& argc, char* argv[]) { // LINT
gflags::SetUsageMessage(
static_cast<const std::string&>("YCSB benchmark for shirakami"));
gflags::ParseCommandLineFlags(&argc, &argv, true);
}

int main(int argc, char* argv[]) try { // NOLINT
int main(int argc, char* argv[]) try { // LINT
init_google_logging();
init_gflags(argc, argv);
check_flags();

init(); // NOLINT
init(); // LINT
invoke_leader();
fin();

Expand Down
4 changes: 2 additions & 2 deletions bench/bcc_11/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ using namespace shirakami;
void check_flags() {
std::cout << "general options" << std::endl;
if (FLAGS_d >= 1) {
printf("FLAGS_d :\t%zu\n", FLAGS_d); // NOLINT
printf("FLAGS_d :\t%zu\n", FLAGS_d); // LINT
} else {
LOG_FIRST_N(ERROR, 1) << log_location_prefix
<< "Duration of benchmark in seconds must be larger than 0.";
}
std::cout << "FLAGS_ops\t" << FLAGS_ops << std::endl;
printf("Fin check_flags()\n"); // NOLINT
printf("Fin check_flags()\n"); // LINT
}
64 changes: 32 additions & 32 deletions bench/bcc_2b/bcc_2b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,36 @@ using namespace shirakami;
/**
* general option.
*/
DEFINE_uint64( // NOLINT
cpumhz, 2100, // NOLINT
"# cpu MHz of execution environment. It is used measuring some " // NOLINT
"time."); // NOLINT
DEFINE_uint64(duration, 1, "Duration of benchmark in seconds."); // NOLINT
DEFINE_uint64(key_len, 8, "# length of value(payload). min is 8."); // NOLINT
DEFINE_uint64(val_len, 8, "# length of value(payload)."); // NOLINT
DEFINE_uint64(rec, 10, // NOLINT
DEFINE_uint64( // LINT
cpumhz, 2100, // LINT
"# cpu MHz of execution environment. It is used measuring some " // LINT
"time."); // LINT
DEFINE_uint64(duration, 1, "Duration of benchmark in seconds."); // LINT
DEFINE_uint64(key_len, 8, "# length of value(payload). min is 8."); // LINT
DEFINE_uint64(val_len, 8, "# length of value(payload)."); // LINT
DEFINE_uint64(rec, 10, // LINT
"# database records for each worker.");

/**
* about online tx
*/
DEFINE_uint64(ol_ops, 1, "# operations per a online tx."); // NOLINT
DEFINE_uint64(ol_rratio, 100, "rate of reads in a online tx."); // NOLINT
DEFINE_uint64(ol_wp_rratio, 0, // NOLINT
DEFINE_uint64(ol_ops, 1, "# operations per a online tx."); // LINT
DEFINE_uint64(ol_rratio, 100, "rate of reads in a online tx."); // LINT
DEFINE_uint64(ol_wp_rratio, 0, // LINT
"Probability that online processing goes to read the WP target "
"area.");
DEFINE_double(ol_skew, 0.0, "access skew of online tx."); // NOLINT
DEFINE_uint64(ol_thread, 1, "# online worker threads."); // NOLINT
DEFINE_double(ol_skew, 0.0, "access skew of online tx."); // LINT
DEFINE_uint64(ol_thread, 1, "# online worker threads."); // LINT

/**
* about batch tx
*/
DEFINE_uint64(bt_ops, 1, "# operations per a batch tx."); // NOLINT
DEFINE_uint64(bt_rratio, 100, "rate of reads in a batch tx."); // NOLINT
DEFINE_double(bt_skew, 0.0, "access skew of batch tx."); // NOLINT
DEFINE_uint64(bt_ops, 1, "# operations per a batch tx."); // LINT
DEFINE_uint64(bt_rratio, 100, "rate of reads in a batch tx."); // LINT
DEFINE_double(bt_skew, 0.0, "access skew of batch tx."); // LINT

bool isReady(const std::vector<char>& readys) { // NOLINT
for (const char& b : readys) { // NOLINT
bool isReady(const std::vector<char>& readys) { // LINT
for (const char& b : readys) { // LINT
if (loadAcquire(b) == 0) return false;
}
return true;
Expand Down Expand Up @@ -117,12 +117,12 @@ void worker(const std::size_t thid, const bool is_ol, char& ready,
is_ol ? FLAGS_ol_rratio : FLAGS_bt_rratio, rnd, zipf);

if (!is_ol) {
tx_begin({token, // NOLINT
tx_begin({token, // LINT
transaction_options::transaction_type::LONG,
{get_bt_storages().at(0)}});
}

RETRY: // for wp premature // NOLINT
RETRY: // for wp premature // LINT
bool need_verify = true;
for (auto&& itr : opr_set) {
Status rc{};
Expand All @@ -133,7 +133,7 @@ void worker(const std::size_t thid, const bool is_ol, char& ready,
bool ol_read_bt{};
if (is_ol) {
ol_read_bt =
FLAGS_ol_wp_rratio > (rnd.next() % 100); // NOLINT
FLAGS_ol_wp_rratio > (rnd.next() % 100); // LINT
}

for (;;) {
Expand All @@ -143,7 +143,7 @@ void worker(const std::size_t thid, const bool is_ol, char& ready,
: storage,
itr.get_key(), vb);
if (!is_ol && rc == Status::WARN_PREMATURE) {
goto RETRY; // NOLINT
goto RETRY; // LINT
}
if (rc == Status::WARN_NOT_FOUND) { LOG_FIRST_N(ERROR, 1); }
if (rc == Status::OK || rc == Status::ERR_CC) { break; }
Expand All @@ -153,7 +153,7 @@ void worker(const std::size_t thid, const bool is_ol, char& ready,
rc = upsert(token, storage, itr.get_key(),
std::string(FLAGS_val_len, '0'));
if (!is_ol && rc == Status::WARN_PREMATURE) {
goto RETRY; // NOLINT
goto RETRY; // LINT
}
} else {
LOG_FIRST_N(ERROR, 1) << log_location_prefix << "unkown operation";
Expand All @@ -162,15 +162,15 @@ void worker(const std::size_t thid, const bool is_ol, char& ready,
++ct_abort;
abort(token);
need_verify = false;
goto RETRY; // NOLINT
goto RETRY; // LINT
// for occ
// Without it, OCC can commit well.
// Because if the transaction changes the access destination, the collision with the batch may be avoided.
}
}

if (need_verify) {
if (commit(token) == Status::OK) { // NOLINT
if (commit(token) == Status::OK) { // LINT
++ct_commit;
} else {
++ct_abort;
Expand All @@ -188,10 +188,10 @@ void invoke_leader() {
alignas(CACHE_LINE_SIZE) bool start = false;
alignas(CACHE_LINE_SIZE) bool quit = false;
alignas(CACHE_LINE_SIZE) std::vector<simple_result> res_ol(
FLAGS_ol_thread); // NOLINT
alignas(CACHE_LINE_SIZE) std::vector<simple_result> res_bt(1); // NOLINT
FLAGS_ol_thread); // LINT
alignas(CACHE_LINE_SIZE) std::vector<simple_result> res_bt(1); // LINT

std::vector<char> readys(FLAGS_ol_thread + 1); // NOLINT
std::vector<char> readys(FLAGS_ol_thread + 1); // LINT
std::vector<std::thread> thv;
thv.emplace_back(worker, 0, false, std::ref(readys[0]), std::ref(start),
std::ref(quit), std::ref(res_bt[0]));
Expand All @@ -205,7 +205,7 @@ void invoke_leader() {
storeRelease(start, true);
#if 0
for (size_t i = 0; i < FLAGS_duration; ++i) {
sleepMs(1000); // NOLINT
sleepMs(1000); // LINT
}
#else
if (sleep(FLAGS_duration) != 0) {
Expand All @@ -225,18 +225,18 @@ void init_google_logging() {
FLAGS_stderrthreshold = 0;
}

void init_gflags(int& argc, char* argv[]) { // NOLINT
void init_gflags(int& argc, char* argv[]) { // LINT
gflags::SetUsageMessage(
static_cast<const std::string&>("YCSB benchmark for shirakami"));
gflags::ParseCommandLineFlags(&argc, &argv, true);
}

int main(int argc, char* argv[]) try { // NOLINT
int main(int argc, char* argv[]) try { // LINT
init_google_logging();
init_gflags(argc, argv);
check_flags();

init(); // NOLINT
init(); // LINT
init_db();
invoke_leader();
fin();
Expand Down
2 changes: 1 addition & 1 deletion bench/bcc_2b/include/simple_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <cstdint>

class alignas(64) simple_result { // NOLINT
class alignas(64) simple_result { // LINT

Check warning on line 9 in bench/bcc_2b/include/simple_result.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers

64 is a magic number; consider replacing it with a named constant
public:
// getter
[[nodiscard]] std::uint64_t get_ct_abort() const { return ct_abort_; }
Expand Down
4 changes: 2 additions & 2 deletions bench/bcc_2b/include/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ using storages_type = std::vector<shirakami::Storage>;
* @brief for online tx workers.
* @details The thread id corresponds to the index position.
*/
inline storages_type ol_storages{}; // NOLINT
inline storages_type ol_storages{}; // LINT

/**
* @brief for batch tx workers.
* @details The thread id corresponds to the index position.
*/
inline storages_type bt_storages{}; // NOLINT
inline storages_type bt_storages{}; // LINT

/**
* global variable's getter
Expand Down
Loading

0 comments on commit 278e5b1

Please sign in to comment.