Skip to content

Commit

Permalink
more e option support (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjblanke authored Dec 13, 2020
1 parent cb05cfb commit d80edb2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
6 changes: 4 additions & 2 deletions python-bindings/chiapos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ PYBIND11_MODULE(chiapos, m)
uint32_t buffmegabytes,
uint32_t num_buckets,
uint32_t stripe_size,
uint8_t num_threads) {
uint8_t num_threads,
bool nobitfield) {
std::string memo_str(memo);
const uint8_t *memo_ptr = reinterpret_cast<const uint8_t *>(memo_str.data());
std::string id_str(id);
Expand All @@ -66,7 +67,8 @@ PYBIND11_MODULE(chiapos, m)
buffmegabytes,
num_buckets,
stripe_size,
num_threads);
num_threads,
nobitfield);
} catch (const std::exception &e) {
std::cout << "Caught plotting error: " << e.what() << std::endl;
throw e;
Expand Down
6 changes: 3 additions & 3 deletions src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) try {
string operation = "help";
string memo = "0102030405";
string id = "022fb42c08c12de3a6af053880199806532e79515f94e83461612101f9412f9e";
bool disablebitfield = false;
bool nobitfield = false;
uint32_t buffmegabytes = 0;

options.allow_unrecognised_options().add_options()(
Expand All @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) try {
"f, file", "Filename", cxxopts::value<string>(filename))(
"m, memo", "Memo to insert into the plot", cxxopts::value<string>(memo))(
"i, id", "Unique 32-byte seed for the plot", cxxopts::value<string>(id))(
"e, disablebitfield", "disable bitfield", cxxopts::value<bool>(disablebitfield))(
"e, nobitfield", "Disable bitfield", cxxopts::value<bool>(nobitfield))(
"b, buffer",
"Megabytes to be used as buffer for sorting and plotting",
cxxopts::value<uint32_t>(buffmegabytes))("help", "Print help");
Expand Down Expand Up @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) try {
num_buckets,
num_stripes,
num_threads,
disablebitfield);
nobitfield);
} else if (operation == "prove") {
if (argc < 3) {
HelpAndQuit(options);
Expand Down
4 changes: 2 additions & 2 deletions src/plotter_disk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DiskPlotter {
uint32_t num_buckets_input = 0,
uint64_t stripe_size_input = 0,
uint8_t num_threads_input = 0,
bool disablebitfield = false)
bool nobitfield = false)
{
// Increases the open file limit, we will open a lot of files.
#ifndef _WIN32
Expand Down Expand Up @@ -223,7 +223,7 @@ class DiskPlotter {

uint64_t finalsize=0;

if(disablebitfield)
if(nobitfield)
{
// Memory to be used for sorting and buffers
std::unique_ptr<uint8_t[]> memory(new uint8_t[memory_size + 7]);
Expand Down
4 changes: 2 additions & 2 deletions tests/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ TEST_CASE("F functions")
uint16_t idx_L[10000];
uint16_t idx_R[10000];

uint32_t idx_count = f2.FindMatches(left_bucket, right_bucket, idx_L, idx_R);
for(uint32_t i=0; i < idx_count; i++) {
int32_t idx_count = f2.FindMatches(left_bucket, right_bucket, idx_L, idx_R);
for(int32_t i=0; i < idx_count; i++) {
REQUIRE(CheckMatch(left_bucket[idx_L[i]].y, right_bucket[idx_R[i]].y));
}
total_matches += idx_count;
Expand Down
1 change: 1 addition & 0 deletions tests/test_python_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_k_21(self):
32,
8192,
8,
False,
)
pl = None

Expand Down

0 comments on commit d80edb2

Please sign in to comment.