I have a Bash script that I submit to a cluster that calls a pipeline of Python scripts which are built to be multithreaded for parallel processing. I need to call this pipeline on all files in a directory, which I can accomplish with a for-loop. However, I am worried that this will run the operations (i.e. the pipeline) on just a single-thread rather than the full range that was intended.
The batch file for submission looks like this:
#!/bin/bash
##SBATCH <parameters>
for filename in /path/to/*.txt; do
PythonScript1.py "$filename"
PythonScript2.py "$filename"
done
Will this work as intended, or will the for loop hamper the efficiency/parallel processing of the Python scripts?