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

Group and order high zoom metatile jobs by rawr size threshold #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tgrigsby-sc
Copy link
Contributor

Instead of simply splitting between grouping at size 7 and 10, group at sizes 7, 8, 9, and 10 to minimize build time. Also order by sum of constituent rawr tile sizes because they correlate strongly with build times.

This was confirmed working in last tile build.

@tgrigsby-sc tgrigsby-sc requested review from iandees and peitili June 2, 2021 23:42

missing_low[c] = True
missing_low[this_coord] = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just a set?

counts_at_zoom[this_coord.zoom] += 1
else:
# too big for this zoom, queue the children
top_left_child = this_coord.zoomBy(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thiiink the tile object has a children() function that returns this list so you don't have to calculate it?

coord, sizes = task.get()
all_sizes.update(sizes)

# now use all_sizes plus the size_threshold to find the lowest zoom we can group each coordinate into
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add another line or two of comment here? My intuition is that we're trying to group tiles by estimated memory usage so that we get to but don't go beyond a target usage. What you have here is good, but maybe needs the extra bit of info about why grouping is happening.


# validate counts by zoom - expecting the equivalent of 4^10 zoom 10 jobs.
counts_at_zoom_sum = 0
for z in counts_at_zoom.keys():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is equivalent to:

Suggested change
for z in counts_at_zoom.keys():
for z in counts_at_zoom:

On second thought, maybe what you have is easier to read and you should ignore me.

count_at_this_zoom = counts_at_zoom[z]
zoom_10_equiv_count = count_at_this_zoom * (4 ** (10 - z))
counts_at_zoom_sum += zoom_10_equiv_count
if counts_at_zoom_sum == 4**10:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe extract 4**10 into a single variable so this check and the math below are easier to read.

cfg.yml["batch"]["memory"] = int(min(cfg.yml["batch"]["memory"] * mem_multiplier, mem_max))
# now that we know what we want, pick something AWS actually supports
viable_mem_request, required_min_cpus = viable_container_overrides(adjusted_mem)
print("REMOVEME: [%s] enqueueing %s at %s mem mb and %s cpus" % (time.ctime(), coord_line, viable_mem_request, required_min_cpus))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line or remove the REMOVEME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants