-
Notifications
You must be signed in to change notification settings - Fork 49
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
Parallelize reads for timeseries #199
Comments
I set
Except for the section at the very beginning, |
Comparing the verbose curl output from the main repo (before multithreading). These four lines are present in the multithreaded output (which errors), and not present in the serial version. Everything else is the same.
Instead, it does:
Simply skipping that section. |
I tried running the threading reads outside of setlist = ['https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/18/T/VR/2017/10/S2A_18TVR_20171006_0_L2A/SCL.tif',
'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/18/T/VR/2017/10/S2B_18TVR_20171008_0_L2A/SCL.tif',
'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/18/T/VR/2017/10/S2A_18TVR_20171013_0_L2A/SCL.tif',
]
def readdata(url):
with rio.open(url, sharing=False) as src:
data = src.read(1, window=Window(0, 0, 50, 50))
return data
thread_pool = ThreadPoolExecutor(len(setlist))
futures = []
for index, url in enumerate(setlist):
futures.append(thread_pool.submit(lambda: readdata(url)))
datas = []
for future in as_completed(futures):
datas.append(future.result())
print(datas[-1]) I also tried this with 50 images and it works. |
Continuing from coiled/feedback#229.
Previous Discussion
Attempted Solution
I attempted to multithread the reads in
fetch_raster_window
:Problem
Unfortunately, this produces an error:
What I Tried:
thread_pool
gdal_env
rasterio.session
synchronous
schedulerDo you have any suggestions for how to deal with this problem? Or is there a better approach for me to achieve parallelism here?
The text was updated successfully, but these errors were encountered: