Giter VIP home page Giter VIP logo

nurs's Introduction

nurs

> nurs
nurs 0.1.0
nurs makes srun easy to use with predefined configurations

USAGE:
    nurs [OPTIONS] [-- <COMMAND>...]

ARGS:
    <COMMAND>...    Override the command to execute on slurm

OPTIONS:
        --config <PATH>            Custom config file location
        --profile <NAME>           Profile name to use
        --export <PATH>            Export to sbatch script instead of executing srun command
    -c, --cpu <##>                 Override the number of cores
    -g, --gpu <#>                  Override the number of GPU
    -m, --mem <##k/##m/##g>        Override the amount of memory
    -p, --partition <PARTITION>    Override the name of partition
    -n, --nodes <NODES>...         Override the name of node
        --dry-run                  DO NOT execute; just print the command/script on stdout
    -h, --help                     Print help information
    -V, --version                  Print version information

Configuration

Configuration file looks like:

default = "train"      # name of default profile

[profile.train]        # profile section; all fields are optional
cpu = 12               # number of cores   (default = 1)
gpu = 1                # number of gpu     (default = 0)
mem = "2G"             # amount of memory  (default = 10m)
partition = "dev_gpu"  # name of partition

[profile.monitor]
nodes = ["dev101"]     # name of node
command = ["htop"]     # command to execute on slurm

[profile.tensorboard]
partition = "dev"
command = ["tensorboard", "--bind-all"]

nurs will detect the configuration file located in one of the following:

  • CUSTOM_PATH, when --config CUSTOM_PATH argument is given
  • $PWD/.nurs.toml, $PWD/../.nurs.toml, $PWD/../../.nurs.toml and so on...
  • $XDG_CONFIG_DIR/nurs.toml or $HOME/.config/nurs.toml
  • $HOME/.nurs.toml

Usage

Remove --dry-run to actually execute the script/command.

> nurs --dry-run -- python script.py
srun --partition=dev_gpu --nodes=1 --cpus-per-task=12 --mem=2g --gres=gpu:1 --pty python script.py

> nurs --dry-run --export sbatch.sh -- python script.py
#!/bin/bash

#SBATCH --partition=dev_gpu
#SBATCH --nodes=1
#SBATCH --cpus-per-task=12
#SBATCH --mem=2g
#SBATCH --gres=gpu:1

python script.py

> nurs --dry-run --profile monitor
srun --nodelist=dev101 --nodes=1 --cpus-per-task=1 --mem=10m --gres=gpu:0 --pty htop

> nurs --dry-run --profile monitor --mem 2m
srun --nodelist=dev101 --nodes=1 --cpus-per-task=1 --mem=2m --gres=gpu:0 --pty htop

> nurs --dry-run --profile monitor -- top
srun --nodelist=dev101 --nodes=1 --cpus-per-task=1 --mem=10m --gres=gpu:0 --pty top

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.