Giter Site home page Giter Site logo

elhuhdron / cluster_tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scalableminds/cluster_tools

0.0 0.0 0.0 264 KB

Task distribution with Slurm and multi-processing for Python

License: MIT License

Python 92.87% Dockerfile 4.05% Shell 3.09%

cluster_tools's Introduction

Cluster Tools

CircleCI

This package provides python Executor classes for distributing tasks on a slurm cluster or via multi processing.

Example

import cluster_tools

def square(n):
  return n * n

if __name__ == '__main__':
  strategy = "slurm"  # other valid values are "multiprocessing" and "sequential"
  with cluster_tools.get_executor(strategy) as executor:
    result = list(executor.map(square, [2, 3, 4]))
    assert result == [4, 9, 16]

Dev Setup

cd dockered-slurm
docker build -t slurm-docker-cluster:latest .
docker-compose up -d
docker exec -it slurmctld bash
docker exec -it c1 bash

Tests can be executed with python3 -m pytest -s test.py after entering the container. Linting can be ran with python3 -m pylint cluster_tools/. Code formatting (black) can be ran with python3 -m black cluster_tools *.py.

Credits

Thanks to sampsyo/clusterfutures for providing the slurm core abstraction and giovtorres/slurm-docker-cluster for providing the slurm docker environment which we use for CI based testing.

cluster_tools's People

Contributors

philippotto avatar daniel-wer avatar normanrz avatar fm3 avatar georgwiese avatar jstriebel avatar elhuhdron avatar dependabot-preview[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.