https://github.com/cphyc/batch_generator
https://github.com/cphyc/batch_generator
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cphyc/batch_generator
- Owner: cphyc
- License: gpl-3.0
- Created: 2018-04-06T15:43:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-06T16:48:29.000Z (about 8 years ago)
- Last Synced: 2025-02-23T19:15:18.927Z (over 1 year ago)
- Language: Python
- Size: 25.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Batch generator
This utility helps creating and submitting jobs on clusters. It also provides a unified interface to some popular job schedular (qsub and slurm).
## Install
```bash
git clone https://github.com/cphyc/batch_generator.git
pip install .
```
## Usage
To get a rough idea of how to use the utility, use
```
batch --help
```
or send me an email.
## Templates
The utility helps creating jobs using templates. Template are bash files with placeholders: the utility helps to fill the placeholders for you!
Templates should be stored in `~/.local/share/batch_generator/` on Linux systems and be valid bash files.
Placeholders have the following syntax:
```
{{name:type|Description}}
{{name:type|Description|default value}}
{{valid python code}}
```
The type should be a valid python type (e.g. `int`, `str`, `float`).
### Note about expressions
In the last case, the expression will be evaluated by Python providing the previously entered values.
### Example
Here is a (very) simple template for the qsub system:
```
#PBS -l nodes={{nodes:int|Number of nodes|1}}:ppn={{ppn:int|Number of process per node|16}}
echo Running on {{nodes*ppn}}.
```
If you run `batch`:
```
$ batch g
Number of nodes [1]: 2
Number of process per node [16]: 32
$ cat job.sh
#PBS -l nodes=2:ppn=32
echo Running on 64 nodes.
```