Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow limiting number of plotting processes during Stage 1 #177

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
8 changes: 6 additions & 2 deletions python-bindings/chiapos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ PYBIND11_MODULE(chiapos, m)
uint32_t num_buckets,
uint32_t stripe_size,
uint8_t num_threads,
bool nobitfield) {
bool nobitfield,
const std::string runtime_dir,
uint32_t phase1_max_processes) {
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 @@ -68,7 +70,9 @@ PYBIND11_MODULE(chiapos, m)
num_buckets,
stripe_size,
num_threads,
nobitfield);
nobitfield,
runtime_dir,
phase1_max_processes);
} catch (const std::exception &e) {
std::cout << "Caught plotting error: " << e.what() << std::endl;
throw e;
Expand Down
8 changes: 7 additions & 1 deletion src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ int main(int argc, char *argv[]) try {
string memo = "0102030405";
string id = "022fb42c08c12de3a6af053880199806532e79515f94e83461612101f9412f9e";
bool nobitfield = false;
uint32_t phase1_max_processes = 0;
string runtimedir = ".";
uint32_t buffmegabytes = 0;

options.allow_unrecognised_options().add_options()(
Expand All @@ -96,6 +98,8 @@ int main(int argc, char *argv[]) try {
"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, nobitfield", "Disable bitfield", cxxopts::value<bool>(nobitfield))(
"p1maxproc", "Phase 1 max process count", cxxopts::value<uint32_t>(phase1_max_processes))(
"runtimedir", "Runtime directory", cxxopts::value<string>(runtimedir))(
"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 +149,9 @@ int main(int argc, char *argv[]) try {
num_buckets,
num_stripes,
num_threads,
nobitfield);
nobitfield,
runtimedir,
phase1_max_processes);
} else if (operation == "prove") {
if (argc < 3) {
HelpAndQuit(options);
Expand Down
Loading