Git Product home page Git Product logo

cluster-jobs's Introduction

How to use?

python3 /home/vagrawal/cluster-jobs/create_job.py --script /home/vagrawal/cluster-jobs/run.sh --template /home/vagrawal/cluster-jobs/template.sh --dir /home/vagrawal/ --gpu 2 --mem 64 --cpu 1 --array --pull --gpu-names V100-32 --bid 1000 --avoid g048

There are three folders of interest. (There could be more if your codebase is on multiple repos)

  • ~/cluster-jobs
  • ~/your_repo(s)_which_contains_your_code_to_run_and_data
  • ~/jobs (if this doesn't exist, mkdir it)

Jobs folder

  • Everytime you submit a job (i.e. python3 create_job.py …..), a new subfolder is created inside ~/jobs/
  • Each of those subfolders contains a few files.
  • stdout-idx.txt : this contains the terminal output that you would get if you would run the "python your_main_file.py" file in local machine (used for debugging)

Git for submitting jobs (this repo)

  • “cluster-jobs”
  • git pull all the latest changes (on the cluster)
  • Before submitting any job, make sure you have a “~/jobs” folder on your cluster

Data & Files

  • This contains the actual files that you need to run on cluster
  • git pull all the repos that you need. This would include all the data and files that you need to run.
  • (Let's say) Path where you cloned this repo in the cluster: ~/your_repo(s)_which_contains_your_code_to_run_and_data

How to submit a job?

In cluster-jobs folder, you have three files.

  • run.sh contains the python commands to run ("unbuffer" is optional) → (unbuffer) python file_name.py
  • template.sh contains the new and updated/modified environment variables.
  • create_job.py this is the submission script. it's responsible for creating jobs and submitting them. It takes each line from run.sh and create a job for it. This also pulls all the git-repos that you mention here before submitting your jobs.

You just have to run this create_job.py file, with the required arguments to handle everything. It runs on python3.

To run this submission script, this sample command could be

python3 /home/vagrawal/cluster-jobs/create_job.py --script /home/vagrawal/cluster-jobs/run.sh --template /home/vagrawal/cluster-jobs/template.sh --dir /home/vagrawal/ --gpu 2 --mem 64 --cpu 4 --array --pull --gpu-names V100-32 --bid 1800 --avoid g048
  • --dir the jobs are submitted from this folder. This becomes the "pwd" (present working directory).

For information on other tags, check out the argument parser in create_job.py

Important

If your project needs to activate a virtual environment, it is suggested to activate it before running the submission script. (create_job.py)

Miscellaneous

To login to the cluster, $ssh [email protected]

To load cuda, do this from inside the cluster: $module load cuda/10.2

You need to load these modules every time you open a new terminal and activate your env.

cluster-jobs's People

Contributors

theinfamouswayne avatar

Watchers

James Cloos 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.