# Srun does not appear in the job submission file

**URL:** <https://aiida.discourse.group/t/srun-does-not-appear-in-the-job-submission-file/482>\
**Category:** New to AiiDA\
**Created:** [October 28, 2024, 12:36pm UTC](https://aiida.discourse.group/t/srun-does-not-appear-in-the-job-submission-file/482 "2024-10-28T12:36:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kayahan\_Saritas](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/kayahan_saritas/32/209_2.png) [@Kayahan\_Saritas](https://aiida.discourse.group/u/Kayahan_Saritas)\
**Post date:** [October 28, 2024, 12:36pm UTC](https://aiida.discourse.group/t/srun-does-not-appear-in-the-job-submission-file/482/1 "2024-10-28T12:36:18Z")

</div>

Hello,

I have installed aiida to a local institutional cluster and used the following commands in order:

1. verdi computer setup --config baseline.yml  
baseline.yml:

```auto
label: "localhost"
hostname: "localhost"
transport: "core.local"
scheduler: "core.slurm"
work_dir: "/gpfs/wolf2/cades/phy191/scratch/ksu/aiida"
mpirun_command: "srun -n {tot_num_mpiprocs}"
mpiprocs_per_machine: 128
prepend_text: |
   #SBATCH -p batch
   #SBATCH -A PHY191
   module purge; module load DefApps intel/20.0.4 openmpi/4.0.4 hdf5/1.14.3
   export OMP_NUM_THREADS=1

```

Also chose the following options from the interactive setup after invoking the command above:

```auto
Description []:
Shebang line (first line of each script, starting with #!) [#!/bin/bash]:
Default amount of memory per machine (kB).: 10000000
Escape CLI arguments in double quotes [y/N]: N

```

1. verdi -p ks computer configure core.local localhost

```auto
Use login shell when executing command [Y/n]: N
Connection cooldown time (s) [0.0]:

```

1. verdi code create core.code.installed -n --computer localhost --label pw --default-calc-job-plugin quantumespresso.pw --filepath-executable pw.x

Then I ran the example script from aiida.quantum\_espresso plugin:

> aiida-quantumespresso calculation launch pw -X pw@localhost -F SSSP/1.1/PBE/efficiency

In the folder where the calculation is submitted, here is the slurm submission script:

```auto
#!/bin/bash
#SBATCH --no-requeue
#SBATCH --job-name="aiida-221"
#SBATCH --get-user-env
#SBATCH --output=_scheduler-stdout.txt
#SBATCH --error=_scheduler-stderr.txt
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=128
#SBATCH --time=00:30:00
#SBATCH --mem=9765

#SBATCH -p batch
#SBATCH -A PHY191
module purge; module load DefApps intel/20.0.4 openmpi/4.0.4 hdf5/1.14.3
export OMP_NUM_THREADS=1

'pw.x' '-in' 'aiida.in' > 'aiida.out'

```

for some reason, the srun command is not picked up and that causes the calculation to fail. If I add the srun command by hand and submit the calculation by hand, then it runs with no error. Thank you for the help!

Kayahan

---

<div class="post-metadata">

**Author:** ![Kayahan\_Saritas](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/kayahan_saritas/32/209_2.png) [@Kayahan\_Saritas](https://aiida.discourse.group/u/Kayahan_Saritas)\
**Post date:** [October 28, 2024, 1:04pm UTC](https://aiida.discourse.group/t/srun-does-not-appear-in-the-job-submission-file/482/2 "2024-10-28T13:04:43Z")

</div>

I think the command line way to run QE does not use MPI version of pw.x. Using the API version of the tutorial in [Running a pw.x calculation — aiida-quantumespresso documentation](https://aiida-quantumespresso.readthedocs.io/en/latest/tutorials/first_pw.html#tutorials-pw-through-cli), my problem is resolved.

Thanks,  
Kayahan

---

<div class="post-metadata">

**Author:** ![t-reents](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/t-reents/32/82_2.png) [@t-reents](https://aiida.discourse.group/u/t-reents)\
**Post date:** [October 28, 2024, 1:12pm UTC](https://aiida.discourse.group/t/srun-does-not-appear-in-the-job-submission-file/482/3 "2024-10-28T13:12:35Z")

</div>

Hi @Kayahan_Saritas

the AiiDA-QE cli sets `with_mpi` to `False` per default. You could try running the same command and adding `--with-mpi True`. I think that this should solve your initial problem.
