Skip to content
Snippets Groups Projects
Commit e542c0e4 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Check parallel implementation.

parent a3c1abcc
No related branches found
No related tags found
No related merge requests found
......@@ -55,12 +55,15 @@ if __name__ == '__main__':
c = cdsapi.Client()
# download data for the different variables
for var in variables:
c.retrieve(product, {**CONFIG, **{'variable': var}}, str(
target.joinpath('_'.join(['ERA5', var, years[0], years[-1]])
+ '.nc')))
# Parallel(n_jobs=min(len(variables), os.cpu_count()), verbose=51)(
# delayed(c.retrieve)(product, {**CONFIG, **{'variable': var}}, str(
# sequential implementation
# for var in variables:
# c.retrieve(product, {**CONFIG, **{'variable': var}}, str(
# target.joinpath('_'.join(['ERA5', var, years[0], years[-1]])
# + '.nc'))) for var in variables)
# + '.nc')))
# parallel implementation
Parallel(n_jobs=min(len(variables), os.cpu_count()), verbose=51)(
delayed(c.retrieve)(product, {**CONFIG, **{'variable': var}}, str(
target.joinpath('_'.join(['ERA5', var, years[0], years[-1]])
+ '.nc'))) for var in variables)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment