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

Add multi-worker support for tile import. #818

Merged
merged 2 commits into from
Apr 14, 2023
Merged

Conversation

olsen232
Copy link
Collaborator

Affects both point cloud and raster tile import.
Doesn't affect diffing or committing..

Resurrected existing (deprecated) option --num-processes, but made it an alias for the preferred name: --num-workers.

Checklist:

  • Have you reviewed your own change?
  • Have you included test(s)? Existing tests pass
  • Have you updated the changelog?

Affects both point cloud and raster tile import.
Doesn't affect diffing or committing..

Resurrected existing (deprecated) option --num-processes,
but made it an alias for the preferred name: --num-workers.

def get_default_num_workers(self):
num_workers = get_num_available_cores()
click.echo(num_workers)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
click.echo(num_workers)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

num_workers = 1
elif num_workers > self.MAX_WORKERS:
raise click.UsageError(
f"Importing with more than {self.MAX_WORKERS} workers is not supported"
Copy link
Member

Choose a reason for hiding this comment

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

why? this was here for the old v2 tabular import code because each process handled one dest subtree, but it doesn't seem like it makes sense for tile-based imports

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed arbitrary MAX_WORKERS limit

@@ -524,6 +572,25 @@ def import_tiles_to_stream(self, stream, sources):

p.update(1)

def copy_multiple_files_to_lfs_cache(self, copy_and_convert_tasks):
Copy link
Member

Choose a reason for hiding this comment

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

needs a docstring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@olsen232 olsen232 merged commit 8d187e2 into master Apr 14, 2023
@olsen232 olsen232 deleted the parallelize-tile-imports branch April 14, 2023 00:30
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.

None yet

2 participants