I have a python script main_script.py
that looks like this:
import os
Files = os.listdir(os.path.join(path, "."))
FilesNumber = len(Files)
for fileID in range (0,FilesNumber):
filename = Files[fileID]
# load file specified in filename and do stuff
basically it does the same kind of operations for each file in the variable Files
I would like to use qsub to parallelize the for loop.
Assuming that I have a txt file files.txt
containing all the files names:
//mypath//pathfile1
//mypath//pathfile2
...
//mypath//pathfile100
how can I write the shell script that calls qsub and runs main_script.py
I think that I would also need to adapt main_script.py
but I do not know how...
The scheduler is Torque/Maui
qsub
is used by several of them. – Bield