That makes sense, although I would go for another solution.
As I understand it, you have program number 1, which determines which of your 50,000 files should be calculated by program number 2. Both programs # 1 and # 2 are written in Python. Great choice.
, Python, : https://gist.github.com/stefanedwards/8841307
qsub-, ( , ), . -v, , :
[me@local ~] $ python isprime.py 1
1: True
[me@local ~] $ head -n 5 isprime.py
import os
os.chdir(os.environ.get('PBS_O_WORKDIR','.'))
[me@local ~] $ qsub -v isprime='1 2 3' isprime.py
123456.cluster.control.com
[me@local ~]
isprime.py , argparse. , script , (os.environ).
№2 , №1 subprocess.call(['qsub','-v options=...','programme2.py'], shell=FALSE)
(, SQLite). № 1, , (, , ).
№2 , .
: №2
python script bash script, :
#!/bin/bash
cd .
if [ -n $option1 ]; then _opt1="--opt1 $option1"; fi
_opt2='--no-verbose'
if [ -n $opt2 ]; then _opt2="-o $opt2"; fi
/path/to/exe $_opt1 $opt2
, python script, , ( ), , subprocess, , , ..