How to run the same command to execute a file in multiple directories?
0
votes
1
answer
397
views
I want to do the following, I have a set of directories:
e.g) 400K 500K 600K and so on
In each directory I have a "run.pbs" file, that I want to submit through batch with "qsub run.pbs".
I was doing something like:
for var in "@/run.pbs"
do
qsub run.pbs
done
I made this script based on some searching I did online. However, after running the script I get an error indicating that run.pbs cannot be found.
So I am wondering whether I am missing a step or not, such that the script is not accessing each directory.
My script is in the same directory where the subdirectories (400K 500K ...) are.
The path would be something like: /home/d/user/sims/study/temperatures
Thanks!
Edit:
The run.pbs is as follows:
#!/bin/bash
#PBS -N name_of_simulation
#PBS -l nodes=1:ppn=20
#PBS -l walltime=120:00:00
#PBS -A name_of_allocation
#PBS -j
# cd to working directory
cd $PBS_O_WORKDIR
module load module1
module load module2
module load module3
mpirun -np 20 nameofprogram < input_file.in
Asked by dareToDiffer07
(125 rep)
Nov 1, 2018, 02:44 PM
Last activity: Nov 21, 2018, 11:14 PM
Last activity: Nov 21, 2018, 11:14 PM