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

Adding dynamic progress based starting of plots. #1091

Open
wants to merge 5 commits into
base: development
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,4 @@ dmypy.json
# Custom
config.yaml
*.bak
.idea
5 changes: 5 additions & 0 deletions config.yaml.default
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ jobs:
# size: This refers to the k size of the plot. You would type in something like 32, 33, 34, 35... in here.
# bitfield: This refers to whether you want to use bitfield or not in your plotting. Typically, you want to keep
# this as true.
# [OPTIONAL] percent: Use progress percentage to control starting plots, this will aim to space plots 1/max_concurrent
# spacing apart dynamically. It's recommended to use a short stagger minutes with this as well as
# max_concurrent_with_start_early >= max_concurrent + 1
# threads: This is the number of threads that will be assigned to the plotter. Only phase 1 uses more than 1 thread.
# buckets: The number of buckets to use. The default provided by Chia is 128.
# memory_buffer: The amount of memory you want to allocate to the process.
Expand Down Expand Up @@ -183,6 +186,7 @@ jobs:
destination_directory: J:\Plots
size: 32
bitfield: true
percent: false
threads: 8
buckets: 128
memory_buffer: 4000
Expand Down Expand Up @@ -216,6 +220,7 @@ jobs:
- K:\Plots
size: 32
bitfield: true
percent: false
threads: 8
buckets: 128
memory_buffer: 4000
Expand Down
9 changes: 9 additions & 0 deletions plotmanager/library/utilities/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def load_jobs(config_jobs):

job.size = info['size']
job.bitfield = info['bitfield']
job.percent = info['percent']
job.threads = info['threads']
job.buckets = info['buckets']
job.memory_buffer = info['memory_buffer']
Expand Down Expand Up @@ -204,10 +205,18 @@ def monitor_jobs_to_start(jobs, running_work, max_concurrent, max_for_phase_1, n
f'Setting Max: {max_for_phase_1}')
continue
phase_1_count = 0
percent = 0
for pid in job.running_work:
percent += float(running_work[pid].progress.strip("%"))
if running_work[pid].current_phase > 1:
continue
phase_1_count += 1
if job.total_running != 0:
percent = round(percent / job.total_running, 2)
minimum_percent = (job.total_running + 1) / 2 / job.max_concurrent * 100
if percent < minimum_percent and job.percent:
logging.info(f'Minimum percent not met, {percent} vs {minimum_percent}')
continue
logging.info(f'Total jobs in phase 1: {phase_1_count}')
if job.max_for_phase_1 and phase_1_count >= job.max_for_phase_1:
logging.info(f'Job max for phase 1 met, skipping. Max: {job.max_for_phase_1}')
Expand Down
1 change: 1 addition & 0 deletions plotmanager/library/utilities/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Job:
skip_full_destinations = None
size = None
bitfield = None
percent = None
threads = None
buckets = None
memory_buffer = None
Expand Down