From 85333db252dc602408a8121fbc61ed81a9337943 Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Tue, 12 Oct 2021 21:24:14 -0600 Subject: [PATCH 1/7] Initial support for Chives --- src/plotman/plotters/madmax.py | 119 ++++++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/src/plotman/plotters/madmax.py b/src/plotman/plotters/madmax.py index 1a688555..0a510181 100644 --- a/src/plotman/plotters/madmax.py +++ b/src/plotman/plotters/madmax.py @@ -17,11 +17,15 @@ @attr.frozen class Options: executable: str = "chia_plot" + k: typing.Optional[int] = 32 + n_count: int = 1 n_threads: int = 4 n_buckets: int = 256 n_buckets3: int = 256 n_rmulti2: int = 1 - + network_port: int = 8444 + tmptoggle: bool = False + waitforcopy: bool = False def check_configuration( options: Options, pool_contract_address: typing.Optional[str] @@ -53,10 +57,14 @@ def create_command_line( options.executable, "-n", str(1), + "-k", + str(options.k), "-r", str(options.n_threads), "-u", str(options.n_buckets), + "-x", + str(options.network_port), "-t", tmpdir if tmpdir.endswith("/") else (tmpdir + "/"), "-d", @@ -71,6 +79,10 @@ def create_command_line( if options.n_rmulti2 is not None: args.append("-K") args.append(str(options.n_rmulti2)) + if options.tmptoggle: + args.append("-G") + if options.waitforcopy: + args.append("-w") if farmer_public_key is not None: args.append("-f") @@ -649,3 +661,108 @@ def _cli_974d6e5f1440f68c48492122ca33828a98864dfc() -> None: ) def _cli_aaa3214d4abbd49bb99c2ec087e27c765424cd65() -> None: pass + +# Madmax Git on 2021-10-12 -> https://github.com/madMAx43v3r/chia-plotter/commit/a9f35cd605517a8c134e7bb4e2af88dd3d3ac236 +@commands.register(version=(3,)) +@click.command() +# https://github.com/madMAx43v3r/chia-plotter/blob/a9f35cd605517a8c134e7bb4e2af88dd3d3ac236/LICENSE +# https://github.com/madMAx43v3r/chia-plotter/blob/a9f35cd605517a8c134e7bb4e2af88dd3d3ac236/src/chia_plot.cpp#L238-L253 +@click.option( + "-k", + "--size", + help="K size (default = 32, k <= 32)", + type=int, + default=32, + show_default=True, +) +@click.option( + "-x", + "--port", + help="Network port (default = 8444, chives = 9699)", + type=int, + default=8444, + show_default=True, +) +@click.option( + "-n", + "--count", + help="Number of plots to create (default = 1, -1 = infinite)", + type=int, + default=1, + show_default=True, +) +@click.option( + "-r", + "--threads", + help="Number of threads (default = 4)", + type=int, + default=4, + show_default=True, +) +@click.option( + "-u", + "--buckets", + help="Number of buckets (default = 256)", + type=int, + default=256, + show_default=True, +) +@click.option( + "-v", + "--buckets3", + help="Number of buckets for phase 3+4 (default = buckets)", + type=int, + default=256, +) +@click.option( + "-t", + "--tmpdir", + help="Temporary directory, needs ~220 GiB (default = $PWD)", + type=click.Path(), + default=pathlib.Path("."), + show_default=True, +) +@click.option( + "-2", + "--tmpdir2", + help="Temporary directory 2, needs ~110 GiB [RAM] (default = )", + type=click.Path(), + default=None, +) +@click.option( + "-d", + "--finaldir", + help="Final directory (default = )", + type=click.Path(), + default=pathlib.Path("."), + show_default=True, +) +@click.option( + "-w", + "--waitforcopy", + help="Wait for copy to start next plot", + type=bool, + default=False, + show_default=True, +) +@click.option( + "-p", "--poolkey", help="Pool Public Key (48 bytes)", type=str, default=None +) +@click.option( + "-c", "--contract", help="Pool Contract Address (62 chars)", type=str, default=None +) +@click.option( + "-f", "--farmerkey", help="Farmer Public Key (48 bytes)", type=str, default=None +) +@click.option( + "-G", "--tmptoggle", help="Alternate tmpdir/tmpdir2", type=str, default=None +) +@click.option( + "-K", + "--rmulti2", + help="Thread multiplier for P2 (default = 1)", + type=int, + default=1, +) +def _cli_a9f35cd605517a8c134e7bb4e2af88dd3d3ac236() -> None: + pass From eb7608f209d88d498039dd391a9c0b1c2d1e3b17 Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Tue, 12 Oct 2021 22:00:27 -0600 Subject: [PATCH 2/7] Can't support multiple plots per run due to single log file for analysis. --- src/plotman/plotters/madmax.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plotman/plotters/madmax.py b/src/plotman/plotters/madmax.py index 0a510181..a1c3ca67 100644 --- a/src/plotman/plotters/madmax.py +++ b/src/plotman/plotters/madmax.py @@ -18,7 +18,6 @@ class Options: executable: str = "chia_plot" k: typing.Optional[int] = 32 - n_count: int = 1 n_threads: int = 4 n_buckets: int = 256 n_buckets3: int = 256 From 386442066e6e594bf7f776e748658df913415135 Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Thu, 14 Oct 2021 16:37:23 -0600 Subject: [PATCH 3/7] Always send the k param, default to 32 when not in config. --- src/plotman/plotters/madmax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plotman/plotters/madmax.py b/src/plotman/plotters/madmax.py index a1c3ca67..d832aa9a 100644 --- a/src/plotman/plotters/madmax.py +++ b/src/plotman/plotters/madmax.py @@ -17,7 +17,7 @@ @attr.frozen class Options: executable: str = "chia_plot" - k: typing.Optional[int] = 32 + k: int = 32 n_threads: int = 4 n_buckets: int = 256 n_buckets3: int = 256 From 62b6829219f531b0021f95def2cb806e2f4251d6 Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Thu, 28 Oct 2021 16:54:26 -0600 Subject: [PATCH 4/7] Support k33 and k34 plotting by latest Madmax. --- src/plotman/plotters/madmax.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plotman/plotters/madmax.py b/src/plotman/plotters/madmax.py index d832aa9a..2851958f 100644 --- a/src/plotman/plotters/madmax.py +++ b/src/plotman/plotters/madmax.py @@ -17,6 +17,7 @@ @attr.frozen class Options: executable: str = "chia_plot" + n: int = 1 k: int = 32 n_threads: int = 4 n_buckets: int = 256 @@ -53,9 +54,9 @@ def create_command_line( pool_contract_address: typing.Optional[str], ) -> typing.List[str]: args = [ - options.executable, + options.executable if options.k <= 32 else 'chia_plot_k34', "-n", - str(1), + str(options.n), "-k", str(options.k), "-r", @@ -164,13 +165,13 @@ def identify_process(cls, command_line: typing.List[str]) -> bool: if len(command_line) == 0: return False - return "chia_plot" == os.path.basename(command_line[0]).lower() + return os.path.basename(command_line[0]).lower().startswith("chia_plot") def common_info(self) -> plotman.plotters.CommonInfo: return self.info.common() def parse_command_line(self, command_line: typing.List[str], cwd: str) -> None: - # drop the chia_plot + # drop the chia_plot or chia_plot_k34 arguments = command_line[1:] # TODO: We could at some point do chia version detection and pick the @@ -661,15 +662,15 @@ def _cli_974d6e5f1440f68c48492122ca33828a98864dfc() -> None: def _cli_aaa3214d4abbd49bb99c2ec087e27c765424cd65() -> None: pass -# Madmax Git on 2021-10-12 -> https://github.com/madMAx43v3r/chia-plotter/commit/a9f35cd605517a8c134e7bb4e2af88dd3d3ac236 +# Madmax Git on 2021-10-28 -> https://github.com/madMAx43v3r/chia-plotter/commit/8332d625220b9a54c097d85d6eb4c6b0c9464214 @commands.register(version=(3,)) @click.command() -# https://github.com/madMAx43v3r/chia-plotter/blob/a9f35cd605517a8c134e7bb4e2af88dd3d3ac236/LICENSE -# https://github.com/madMAx43v3r/chia-plotter/blob/a9f35cd605517a8c134e7bb4e2af88dd3d3ac236/src/chia_plot.cpp#L238-L253 +# https://github.com/madMAx43v3r/chia-plotter/blob/8332d625220b9a54c097d85d6eb4c6b0c9464214/LICENSE +# https://github.com/madMAx43v3r/chia-plotter/blob/8332d625220b9a54c097d85d6eb4c6b0c9464214/src/chia_plot.cpp#L238-L253 @click.option( "-k", "--size", - help="K size (default = 32, k <= 32)", + help="K size (default = 32, supports 29,30,31,32,34)", type=int, default=32, show_default=True, @@ -763,5 +764,5 @@ def _cli_aaa3214d4abbd49bb99c2ec087e27c765424cd65() -> None: type=int, default=1, ) -def _cli_a9f35cd605517a8c134e7bb4e2af88dd3d3ac236() -> None: +def _cli_8332d625220b9a54c097d85d6eb4c6b0c9464214() -> None: pass From 4c3f3a918a86ea1eb9178c7ef0b0842b98a13260 Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Sun, 7 Nov 2021 13:08:58 -0700 Subject: [PATCH 5/7] Due to Madmax plotting speed for Chives, analyze should show exact time in seconds without rounding. --- src/plotman/analyzer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plotman/analyzer.py b/src/plotman/analyzer.py index 43303140..1c87dafb 100644 --- a/src/plotman/analyzer.py +++ b/src/plotman/analyzer.py @@ -163,7 +163,9 @@ def analyze( ) ) elif len(values) == 1: - row.append(plot_util.human_format(values[0], 1)) + row.append(values[0]) # Use exact time in seconds. + # Due to Madmax and Bladebit speed, don't round times in seconds to nearest thousands + #row.append(plot_util.human_format(values[0], 1)) else: row.append("N/A") From 0805ad00df59420dc31eb9c382f5773aee7f9bbf Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Tue, 16 Nov 2021 15:08:56 -0700 Subject: [PATCH 6/7] Improved default display on wider consoles. --- src/plotman/plotman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plotman/plotman.py b/src/plotman/plotman.py index e111f5a3..9e49483f 100755 --- a/src/plotman/plotman.py +++ b/src/plotman/plotman.py @@ -162,7 +162,7 @@ def parse_args(self) -> typing.Any: def get_term_width(cfg: configuration.PlotmanConfig) -> int: - default_columns = 120 # 80 is typically too narrow. + default_columns = 160 # 80 is typically too narrow, support wider consoles. if cfg.user_interface.use_stty_size: try: (rows_string, columns_string) = os.popen("stty size", "r").read().split() From 97e508fddc0087b9f9cdba5e39eb530cafe12ab4 Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Mon, 3 Jan 2022 19:58:37 -0700 Subject: [PATCH 7/7] Support new MMX plot name format. --- src/plotman/plotters/madmax.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plotman/plotters/madmax.py b/src/plotman/plotters/madmax.py index 2851958f..225fab6a 100644 --- a/src/plotman/plotters/madmax.py +++ b/src/plotman/plotters/madmax.py @@ -349,10 +349,11 @@ def tmp2_dir(match: typing.Match[str], info: SpecificInfo) -> SpecificInfo: @handlers.register( - expression=r"^Plot Name: (?Pplot-k(?P\d+)-(?P\d+)-(?P\d+)-(?P\d+)-(?P\d+)-(?P\d+)-(?P\w+))$" + expression=r"^Plot Name: (?Pplot(-mmx)?-k(?P\d+)-(?P\d+)-(?P\d+)-(?P\d+)-(?P\d+)-(?P\d+)-(?P\w+))$" ) def plot_name_line(match: typing.Match[str], info: SpecificInfo) -> SpecificInfo: # Plot Name: plot-k32-2021-07-11-16-52-3a3872f5a124497a17fb917dfe027802aa1867f8b0a8cbac558ed12aa5b697b2 + # Plot Name: plot-mmx-k30-2022-01-03-19-44-06982c6179c6242979b68d81950577017d4594f59ec0e6859e83c7f9141cbc35 return attr.evolve( info, plot_size=int(match.group("size")),