Comments (1)
A dask version of the approach outlined in George's presentation is trivial to implement:
e.g. instead of:
results = []
for i in iterable:
results.append(my_function(i))
Something like:
import dask.bag as db
# this is needed if running on SPICE to correctly determine CPUs requested
if "SLURM_NTASKS" in os.environ.keys():
WORKERS = int(os.environ["SLURM_NTASKS"])
else:
WORKERS = os.cpu_count()
iter_bag = db.from_sequence(iterable)
results = iter_bag.map(my_function).compute(num_workers=WORKERS)
This is the approach that I've used for some time to do e.g. multiple MOOSE retrievals in parallel, parallel processing of multiple files on disk, and to break up some other calculation work (e.g. by year).
I have been investigating a little more with the use of dask.array
for more sophisticated stuff that should be more efficient for some tasks with time / memory, but it will need to wait till I have my Antigua stuff out the way as it's a bit more involved (mainly in setting up the correct dask environment before hand, the code itself is in some cases even simpler), and my approaches using dask.bag
are good enough for now
from catnip.
Related Issues (20)
- significant digits
- doctests for new extract_rot_cube fail HOT 1
- Support for user specified projection in vector plot function HOT 2
- Documentation and Licence test
- feature_update_action HOT 1
- Update documentation HOT 3
- fix pytests
- use requirement.txt in setup.py
- Update actions with MO default-current and current-next
- Implement version tags
- Conda installable
- Deploy on project disk for MO
- Updated documentation and instructions
- List more features
- Feature: add domain plotter code
- Masking without ASCEND - part 1 getting country shapefiles by name
- Masking without ASCEND - part 2 applying a mask to a cube
- Add copyright headers to all files HOT 1
- add CONTRIBUTING.md
- update conda envs used in testing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catnip.