Skip to main content

A simple Linux command-line utility which submits a job to one of the multiple servers

Project description

ΣΣJob

PyPI version Downloads License

ΣΣJob or SumsJob (Simple Utility for Multiple-Servers Job Submission) is a simple Linux command-line utility which submits a job to one of the multiple servers each with limited GPUs. ΣΣJob provides similar key functions for multiple servers as Slurm Workload Manager for supercomputers and computer clusters. It provides the following key functions:

  • show the status of GPUs on all servers,
  • submit a job to servers in noninteractive mode, i.e., the job will be running in the background of the server,
  • submit a job to servers in interactive mode, just as the job is running in your local machine,
  • display all running jobs,
  • cancel running jobs.

Motivation

Assume you have a few GPU servers: server1, server2, ... When you need to run a code from your computer, you will

  1. Select one server and log in

    $ ssh LAN (You may need to first log in a local area network)
    $ ssh server1
    
  2. Check GPU status. If no free GPU, go to step 1

    $ nvidia-smi or $ gpustat

  3. Copy the code from your computer to the server

    $ scp -r codes server1:~/project/codes
    
  4. Run the code in the server

    $ cd ~/project/codes
    $ CUDA_VISIBLE_DEVICES=0 python main.py
    
  5. Transfer back the results

    $ scp server1:~/project/codes/results.dat .
    

These steps are boring. ΣΣJob makes all these steps automatic.

Features

  • Simple to use
  • Two modes: noninteractive mode, and interactive mode
  • Noninteractive mode: the job will be running in the background of the server
    • You can turn off your local machine
  • Interactive mode: just as the job is running in your local machine
    • Display the output of the program in the terminal of your local machine in real time
    • Kill the job by Ctrl-C

Usage

$ gpuresource

Show the status of GPUs on all servers. For example,

$ submit jobfile [jobname]

Submit a job to GPU servers. Automatically do the following steps:

  1. Find a GPU with low utilization and sufficient memory (the criterion is in the configuration file). You can also specify the server and GPU by -s SERVER and --gpuid GPUID.
  2. Copy the code to the server.
  3. Run the job on it in noninteractive mode (default) or interactive mode (with -i).
  4. Save the output in a log file.
  5. For interactive mode, when the code finishes, transfer back the result files and the log file.
  • jobfile : File to be run
  • jobname : Job name, and also the folder name of the job. If not provided, a random number will be used.

Options:

  • -h, --help : Show this help message and exit
  • -i, --interact : Submit as an interactive job
  • -s SERVER, --server SERVER : Server host name
  • --gpuid GPUID : GPU ID to be used; -1 to use CPU only

$ sacct

Display all running jobs ordered by the start time. For example,

$ scancel jobname

Cancel a running job.

  • jobname : Job name.

Installation

Install SumsJob with pip:

$ pip install sumsjob

You also need to do the following:

  • Make sure you can ssh to each server, ideally without typing the password by SSH keys.
  • Install gpustat in each server.
  • Have a configuration file at ~/.sumsjob/config.py. Use config.py as a template, and modify the values to your configurations.
  • Make sure ~/.local/bin is in your $PATH.

Then run gpuresource to check if everything works.

License

GNU GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SumsJob-0.6.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SumsJob-0.6.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file SumsJob-0.6.0.tar.gz.

File metadata

  • Download URL: SumsJob-0.6.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for SumsJob-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8510c4795601ea9c7cd623d92480b84c25601797c6a06fd69bd5bbe6ca74da18
MD5 66a9d61ffaa6f838617253762d7df31d
BLAKE2b-256 d4ca3fc1d1697e8b77e60b11407cdb81bebda17c792ba495edd540770dc0107b

See more details on using hashes here.

File details

Details for the file SumsJob-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: SumsJob-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for SumsJob-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3799ecb637d23184eeb4915e25dc3fa14dc06d1396baa2a30725a5a115233656
MD5 1763a94a338bcf9d3d2e4c22da4f92a5
BLAKE2b-256 ef200694b4c786f143db9c36bb1dede768325fc442ddb8a236b0de7b846385af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page