Skip to content

Commit abeb66b

Browse files
author
Landon Clipp
authored
Update README.md
1 parent f18b3c0 commit abeb66b

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
# batch4py
1+
# batch4py
2+
3+
batch4py is a lightweight Python module that provides a programmatic interface to many common High Performance Computing (HPC) batch schedulers. It also provides a simple way to define directed acyclic graphs (DAG) of job chains.
4+
5+
A common workflow to submit jobs on a batch scheduler looks something like this:
6+
7+
```
8+
$ qsub job1.pbs
9+
$ qsub -W afterany:8625371 job2.pbs
10+
$ qsub -W afterany:8625371 job3.pbs
11+
$ qsub -W afterany:8625372 job4.pbs
12+
```
13+
14+
Performing these steps manually is fine for a handful of jobs, but doing it for dozens or hundreds of jobs becomes impractical. A 100-batch job looks like this in batch4py:
15+
16+
```
17+
job_list = []
18+
chain = batch4py.JobChain( 'pbs' )
19+
for i in range(100):
20+
new_job = batch4py.Job( list_of_job_files[i] )
21+
job_list.append( new_job )
22+
chain.add_job( job_list[i] )
23+
24+
# Define a simple linear tree
25+
for i in range(99):
26+
chain.set_dep( job_list[i], job_list[i+1], 'afterany' )
27+
28+
# Submit job chain
29+
chain.submit()
30+
```
31+

0 commit comments

Comments
 (0)