Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
link89 committed Nov 26, 2023
1 parent 8f87562 commit 2380cb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/manual/batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ ai2-kit tool batch gen_batches --help

Suppose you want to run new CP2K tasks based on the previous runs, whose work directories can be found with `./old/iters*/label-cp2k/tasks/*`, and the new CP2K config file is in `./new/cp2k.inp`, then you can do the following steps:

1. Create new tasks directories by linking to (or copying) the old ones
#### 1. Create new tasks directories by linking to (or copying) the old ones

```bash
ai2-kit tool batch map_path ./old/iters*/label-cp2k/tasks/* --target "new/task-{i:04d}"
```
The command above will create new directories `new/task-0000`, `new/task-0001`, etc. and link the old tasks directories to them. If you want to copy the old tasks directories instead of linking them, you can use `--copy` option.

2. Generate batch scripts
#### 2. Generate batch scripts

Suppose you are using SLURM as your job scheduler, then you need to prepare a header file for your batch scripts. For example, you can create a file named `header.sh` with the following content:

Expand All @@ -52,7 +52,7 @@ ai2-kit tool batch gen_batches new/task-* --header_file header.sh --cmd "mpirun

The above command will generate 5 batch scripts named `new/cp2k-0.sbatch`, `new/cp2k-1.sbatch`, etc. and each batch script will run part of the tasks in `new/task-*` directory.

3. Submit batch scripts to your job scheduler
#### 3. Submit batch scripts to your job scheduler
You can submit the batch scripts to your job scheduler with `sbatch` and `xargs` commands.
```bash
ls -1 new/cp2k-*.sbatch | xargs -I {} sbatch {}
Expand Down

0 comments on commit 2380cb9

Please sign in to comment.